Add and use percentage constant (#32094)
* Add and use percentage constant * Fix pylint error and broken test
This commit is contained in:
1 parent
c7f128f286
commit
f1a0ca7cd3
155 files changed
+735
-459
No files matched your search
@@ -7,6 +7,7 @@ from homeassistant.const import (
|
||||
STATE_UNKNOWN,
|
||||
TEMP_CELSIUS,
|
||||
TEMP_FAHRENHEIT,
|
||||
UNIT_PERCENTAGE,
|
||||
)
|
||||
from homeassistant.setup import setup_component
|
||||
|
||||
@@ -233,7 +234,7 @@ class TestMinMaxSensor(unittest.TestCase):
|
||||
assert "ERR" == state.attributes.get("unit_of_measurement")
|
||||
|
||||
self.hass.states.set(
|
||||
entity_ids[2], self.values[2], {ATTR_UNIT_OF_MEASUREMENT: "%"}
|
||||
entity_ids[2], self.values[2], {ATTR_UNIT_OF_MEASUREMENT: UNIT_PERCENTAGE}
|
||||
)
|
||||
self.hass.block_till_done()
|
||||
|
||||
|
||||
Reference in new issue
Block a user