Add and use percentage constant (#32094)
* Add and use percentage constant * Fix pylint error and broken test
This commit is contained in:
1 parent
c7f128f286
commit
f1a0ca7cd3
155 files changed
+735
-459
No files matched your search
@@ -2,6 +2,7 @@
|
||||
import logging
|
||||
|
||||
from homeassistant.components.sensor import ENTITY_ID_FORMAT
|
||||
from homeassistant.const import UNIT_PERCENTAGE
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.icon import icon_for_battery_level
|
||||
@@ -25,7 +26,9 @@ SENSORS = [
|
||||
EVSensorConfig("Electric Range", "electricRange", "miles", "mdi:speedometer"),
|
||||
EVSensorConfig("Charged By", "estimatedFullChargeBy"),
|
||||
EVSensorConfig("Charge Mode", "chargeMode"),
|
||||
EVSensorConfig("Battery Level", BATTERY_SENSOR, "%", "mdi:battery", ["charging"]),
|
||||
EVSensorConfig(
|
||||
"Battery Level", BATTERY_SENSOR, UNIT_PERCENTAGE, "mdi:battery", ["charging"]
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user