Add and use UNIT_VOLT constant (#33994)

* Add and use UNIT_VOLT constant

* Run isort
This commit is contained in:
springstan 2020-04-11 02:04:58 +02:00 committed by GitHub
parent 32e87fc4c7
commit 04c4501455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 125 additions and 64 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, UNIT_PERCENTAGE
from homeassistant.const import TEMP_CELSIUS, UNIT_PERCENTAGE, UNIT_VOLT
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.icon import icon_for_battery_level, icon_for_signal_level
@ -9,7 +9,7 @@ from .const import DOMAIN
from .entity import StarlineEntity
SENSOR_TYPES = {
"battery": ["Battery", None, "V", None],
"battery": ["Battery", None, UNIT_VOLT, None],
"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],