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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
183 changed files with 639 additions and 661 deletions

View file

@ -12,7 +12,7 @@ from homeassistant.components.rflink import (
EVENT_KEY_SENSOR,
TMP_ENTITY,
)
from homeassistant.const import STATE_UNKNOWN, TEMP_CELSIUS, UNIT_PERCENTAGE
from homeassistant.const import PERCENTAGE, STATE_UNKNOWN, TEMP_CELSIUS
from tests.components.rflink.test_init import mock_rflink
@ -151,7 +151,7 @@ async def test_aliases(hass, monkeypatch):
"id": "test_alias_02_0",
"sensor": "humidity",
"value": 65,
"unit": UNIT_PERCENTAGE,
"unit": PERCENTAGE,
}
)
await hass.async_block_till_done()
@ -160,7 +160,7 @@ async def test_aliases(hass, monkeypatch):
updated_sensor = hass.states.get("sensor.test_02")
assert updated_sensor
assert updated_sensor.state == "65"
assert updated_sensor.attributes["unit_of_measurement"] == UNIT_PERCENTAGE
assert updated_sensor.attributes["unit_of_measurement"] == PERCENTAGE
async def test_race_condition(hass, monkeypatch):