Drop UNIT_ prefix for percentage constant (#39383)
This commit is contained in:
1 parent
cdc93d7110
commit
d2b1918e9c
183 files changed
+639
-661
No files matched your search
@@ -8,11 +8,11 @@ from libpurecool.dyson_pure_cool_link import DysonPureCoolLink
|
||||
from homeassistant.components import dyson as dyson_parent
|
||||
from homeassistant.components.dyson import sensor as dyson
|
||||
from homeassistant.const import (
|
||||
PERCENTAGE,
|
||||
STATE_OFF,
|
||||
TEMP_CELSIUS,
|
||||
TEMP_FAHRENHEIT,
|
||||
TIME_HOURS,
|
||||
UNIT_PERCENTAGE,
|
||||
)
|
||||
from homeassistant.helpers import discovery
|
||||
from homeassistant.setup import async_setup_component
|
||||
@@ -166,7 +166,7 @@ class DysonTest(unittest.TestCase):
|
||||
sensor.entity_id = "sensor.dyson_1"
|
||||
assert not sensor.should_poll
|
||||
assert sensor.state is None
|
||||
assert sensor.unit_of_measurement == UNIT_PERCENTAGE
|
||||
assert sensor.unit_of_measurement == PERCENTAGE
|
||||
assert sensor.name == "Device_name Humidity"
|
||||
assert sensor.entity_id == "sensor.dyson_1"
|
||||
|
||||
@@ -177,7 +177,7 @@ class DysonTest(unittest.TestCase):
|
||||
sensor.entity_id = "sensor.dyson_1"
|
||||
assert not sensor.should_poll
|
||||
assert sensor.state == 45
|
||||
assert sensor.unit_of_measurement == UNIT_PERCENTAGE
|
||||
assert sensor.unit_of_measurement == PERCENTAGE
|
||||
assert sensor.name == "Device_name Humidity"
|
||||
assert sensor.entity_id == "sensor.dyson_1"
|
||||
|
||||
@@ -188,7 +188,7 @@ class DysonTest(unittest.TestCase):
|
||||
sensor.entity_id = "sensor.dyson_1"
|
||||
assert not sensor.should_poll
|
||||
assert sensor.state == STATE_OFF
|
||||
assert sensor.unit_of_measurement == UNIT_PERCENTAGE
|
||||
assert sensor.unit_of_measurement == PERCENTAGE
|
||||
assert sensor.name == "Device_name Humidity"
|
||||
assert sensor.entity_id == "sensor.dyson_1"
|
||||
|
||||
|
||||
Reference in new issue
Block a user