Use UNIT_PERCENTAGE constant (#34054)
This commit is contained in:
1 parent
4f50b858d0
commit
9f713dac7f
6 files changed
+27
-19
No files matched your search
@@ -7,6 +7,7 @@ from homeassistant.const import (
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
TEMP_CELSIUS,
|
||||
UNIT_PERCENTAGE,
|
||||
)
|
||||
|
||||
from .common import setup_platform
|
||||
@@ -31,7 +32,7 @@ async def test_attributes(hass):
|
||||
assert not state.attributes.get("battery_low")
|
||||
assert not state.attributes.get("no_response")
|
||||
assert state.attributes.get("device_type") == "LM"
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "%"
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UNIT_PERCENTAGE
|
||||
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Environment Sensor Humidity"
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == DEVICE_CLASS_HUMIDITY
|
||||
|
||||
|
||||
Reference in new issue
Block a user