1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Drop UNIT_ prefix for percentage constant (#39383)

This commit is contained in:
springstan
2020-09-05 21:09:14 +02:00
committed by GitHub
parent cdc93d7110
commit d2b1918e9c
183 changed files with 639 additions and 661 deletions

View File

@@ -12,8 +12,8 @@ from homeassistant.components.smartthings.const import DOMAIN, SIGNAL_SMARTTHING
from homeassistant.const import (
ATTR_FRIENDLY_NAME,
ATTR_UNIT_OF_MEASUREMENT,
PERCENTAGE,
STATE_UNKNOWN,
UNIT_PERCENTAGE,
)
from homeassistant.helpers.dispatcher import async_dispatcher_send
@@ -38,7 +38,7 @@ async def test_entity_state(hass, device_factory):
await setup_platform(hass, SENSOR_DOMAIN, devices=[device])
state = hass.states.get("sensor.sensor_1_battery")
assert state.state == "100"
assert state.attributes[ATTR_UNIT_OF_MEASUREMENT] == UNIT_PERCENTAGE
assert state.attributes[ATTR_UNIT_OF_MEASUREMENT] == PERCENTAGE
assert state.attributes[ATTR_FRIENDLY_NAME] == f"{device.label} Battery"