Add and use percentage constant (#32094)

* Add and use percentage constant

* Fix pylint error and broken test
This commit is contained in:
springstan 2020-02-28 20:46:48 +01:00 committed by GitHub
parent c7f128f286
commit f1a0ca7cd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
155 changed files with 735 additions and 459 deletions

View file

@ -1,6 +1,6 @@
"""Reads vehicle status from StarLine API."""
from homeassistant.components.sensor import DEVICE_CLASS_TEMPERATURE
from homeassistant.const import TEMP_CELSIUS
from homeassistant.const import TEMP_CELSIUS, UNIT_PERCENTAGE
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.icon import icon_for_battery_level, icon_for_signal_level
@ -13,7 +13,7 @@ SENSOR_TYPES = {
"balance": ["Balance", None, None, "mdi:cash-multiple"],
"ctemp": ["Interior Temperature", DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS, None],
"etemp": ["Engine Temperature", DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS, None],
"gsm_lvl": ["GSM Signal", None, "%", None],
"gsm_lvl": ["GSM Signal", None, UNIT_PERCENTAGE, None],
}