Teach state and numeric_state conditions about entity registry ids (#60841)
This commit is contained in:
parent
a07f75c6b0
commit
0e3bc21d54
23 changed files with 236 additions and 31 deletions
|
@ -127,7 +127,9 @@ async def async_call_action_from_config(
|
|||
|
||||
|
||||
@callback
|
||||
def async_condition_from_config(config: ConfigType) -> condition.ConditionCheckerType:
|
||||
def async_condition_from_config(
|
||||
hass: HomeAssistant, config: ConfigType
|
||||
) -> condition.ConditionCheckerType:
|
||||
"""Evaluate state based on configuration."""
|
||||
if config[CONF_TYPE] == CONF_IS_ON:
|
||||
stat = "on"
|
||||
|
@ -142,6 +144,7 @@ def async_condition_from_config(config: ConfigType) -> condition.ConditionChecke
|
|||
state_config[CONF_FOR] = config[CONF_FOR]
|
||||
|
||||
state_config = cv.STATE_CONDITION_SCHEMA(state_config)
|
||||
state_config = condition.state_validate_config(hass, state_config)
|
||||
return condition.state_from_config(state_config)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue