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

@ -5,7 +5,7 @@ import logging
import pytest
from homeassistant.const import UNIT_PERCENTAGE
from homeassistant.const import PERCENTAGE
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError, PlatformNotReady
from homeassistant.helpers import entity_platform, entity_registry
@ -838,7 +838,7 @@ async def test_entity_info_added_to_entity_registry(hass):
capability_attributes={"max": 100},
supported_features=5,
device_class="mock-device-class",
unit_of_measurement=UNIT_PERCENTAGE,
unit_of_measurement=PERCENTAGE,
)
await component.async_add_entities([entity_default])
@ -850,7 +850,7 @@ async def test_entity_info_added_to_entity_registry(hass):
assert entry_default.capabilities == {"max": 100}
assert entry_default.supported_features == 5
assert entry_default.device_class == "mock-device-class"
assert entry_default.unit_of_measurement == UNIT_PERCENTAGE
assert entry_default.unit_of_measurement == PERCENTAGE
async def test_override_restored_entities(hass):