Use UNIT_PERCENTAGE constant (#34054)
This commit is contained in:
parent
4f50b858d0
commit
9f713dac7f
6 changed files with 27 additions and 19 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue