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
@@ -18,6 +18,7 @@ from homeassistant.const import (
|
||||
CONF_FOR,
|
||||
CONF_PLATFORM,
|
||||
CONF_TYPE,
|
||||
UNIT_PERCENTAGE,
|
||||
)
|
||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant
|
||||
from homeassistant.helpers import config_validation as cv, entity_registry
|
||||
@@ -177,7 +178,7 @@ async def async_get_trigger_capabilities(hass: HomeAssistant, config):
|
||||
if trigger_type == "current_temperature_changed":
|
||||
unit_of_measurement = hass.config.units.temperature_unit
|
||||
else:
|
||||
unit_of_measurement = "%"
|
||||
unit_of_measurement = UNIT_PERCENTAGE
|
||||
|
||||
return {
|
||||
"extra_fields": vol.Schema(
|
||||
|
||||
Reference in new issue
Block a user