Clean up constants (#46948)
* Clean up constants * clean up humidifier constants * fix tests * fix prometheus tests Co-authored-by: Tobias Sauerwein <cgtobi@users.noreply.github.com>
This commit is contained in:
parent
dc880118a4
commit
ab53b49d3f
31 changed files with 69 additions and 68 deletions
|
@ -6,6 +6,7 @@ import voluptuous as vol
|
|||
from homeassistant.components.device_automation import toggle_entity
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID,
|
||||
ATTR_MODE,
|
||||
ATTR_SUPPORTED_FEATURES,
|
||||
CONF_CONDITION,
|
||||
CONF_DEVICE_ID,
|
||||
|
@ -28,7 +29,7 @@ MODE_CONDITION = DEVICE_CONDITION_BASE_SCHEMA.extend(
|
|||
{
|
||||
vol.Required(CONF_ENTITY_ID): cv.entity_id,
|
||||
vol.Required(CONF_TYPE): "is_mode",
|
||||
vol.Required(const.ATTR_MODE): str,
|
||||
vol.Required(ATTR_MODE): str,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -72,7 +73,7 @@ def async_condition_from_config(
|
|||
config = CONDITION_SCHEMA(config)
|
||||
|
||||
if config[CONF_TYPE] == "is_mode":
|
||||
attribute = const.ATTR_MODE
|
||||
attribute = ATTR_MODE
|
||||
else:
|
||||
return toggle_entity.async_condition_from_config(config)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue