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
@@ -4,6 +4,7 @@ from homeassistant.const import (
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
TEMP_CELSIUS,
|
||||
UNIT_PERCENTAGE,
|
||||
)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
@@ -23,7 +24,12 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||
12,
|
||||
),
|
||||
DemoSensor(
|
||||
"sensor_2", "Outside Humidity", 54, DEVICE_CLASS_HUMIDITY, "%", None
|
||||
"sensor_2",
|
||||
"Outside Humidity",
|
||||
54,
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
UNIT_PERCENTAGE,
|
||||
None,
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user