Classes | |
| class | ConditionProtocol |
Functions | |
| ConditionProtocol|None | _async_get_condition_platform (HomeAssistant hass, ConfigType config) |
| ConditionCheckerType | async_and_from_config (HomeAssistant hass, ConfigType config) |
| Callable[[TemplateVarsType], bool] | async_conditions_from_config (HomeAssistant hass, list[ConfigType] condition_configs, logging.Logger logger, str name) |
| set[str] | async_extract_devices (ConfigType|Template config) |
| set[str] | async_extract_entities (ConfigType|Template config) |
| ConditionCheckerType | async_from_config (HomeAssistant hass, ConfigType config) |
| ConditionCheckerType | async_not_from_config (HomeAssistant hass, ConfigType config) |
| bool | async_numeric_state (HomeAssistant hass, str|State|None entity, float|str|None below=None, float|str|None above=None, Template|None value_template=None, TemplateVarsType variables=None, str|None attribute=None) |
| ConditionCheckerType | async_numeric_state_from_config (ConfigType config) |
| ConditionCheckerType | async_or_from_config (HomeAssistant hass, ConfigType config) |
| bool | async_template (HomeAssistant hass, Template value_template, TemplateVarsType variables=None, bool trace_result=True) |
| ConditionCheckerType | async_template_from_config (ConfigType config) |
| ConditionCheckerType | async_trigger_from_config (HomeAssistant hass, ConfigType config) |
| ConfigType | async_validate_condition_config (HomeAssistant hass, ConfigType config) |
| list[ConfigType|Template] | async_validate_conditions_config (HomeAssistant hass, list[ConfigType] conditions) |
| TraceElement | condition_trace_append (TemplateVarsType variables, str path) |
| None | condition_trace_set_result (bool result, **Any kwargs) |
| None | condition_trace_update_result (**Any kwargs) |
| bool | numeric_state (HomeAssistant hass, str|State|None entity, float|str|None below=None, float|str|None above=None, Template|None value_template=None, TemplateVarsType variables=None) |
| ConfigType | numeric_state_validate_config (HomeAssistant hass, ConfigType config) |
| bool | state (HomeAssistant hass, str|State|None entity, Any req_state, timedelta|None for_period=None, str|None attribute=None, TemplateVarsType variables=None) |
| ConditionCheckerType | state_from_config (ConfigType config) |
| ConfigType | state_validate_config (HomeAssistant hass, ConfigType config) |
| bool | sun (HomeAssistant hass, str|None before=None, str|None after=None, timedelta|None before_offset=None, timedelta|None after_offset=None) |
| ConditionCheckerType | sun_from_config (ConfigType config) |
| bool | template (HomeAssistant hass, Template value_template, TemplateVarsType variables=None) |
| bool | time (HomeAssistant hass, dt_time|str|None before=None, dt_time|str|None after=None, str|Container[str]|None weekday=None) |
| ConditionCheckerType | time_from_config (ConfigType config) |
| Generator[TraceElement] | trace_condition (TemplateVarsType variables) |
| ConditionCheckerType | trace_condition_function (ConditionCheckerType condition) |
| bool | zone (HomeAssistant hass, str|State|None zone_ent, str|State|None entity) |
| ConditionCheckerType | zone_from_config (ConfigType config) |
Variables | |
| dictionary | _PLATFORM_ALIASES |
| string | ASYNC_FROM_CONFIG_FORMAT = "async_{}_from_config" |
| ConditionCheckerType | |
| string | FROM_CONFIG_FORMAT = "{}_from_config" |
| INPUT_ENTITY_ID | |
| string | VALIDATE_CONFIG_FORMAT = "{}_validate_config" |
Offer reusable conditions.
|
private |
Definition at line 188 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.async_and_from_config | ( | HomeAssistant | hass, |
| ConfigType | config | ||
| ) |
Create multi condition matcher using 'AND'.
Definition at line 261 of file condition.py.
| Callable[[TemplateVarsType], bool] homeassistant.helpers.condition.async_conditions_from_config | ( | HomeAssistant | hass, |
| list[ConfigType] | condition_configs, | ||
| logging.Logger | logger, | ||
| str | name | ||
| ) |
AND all conditions.
Definition at line 1080 of file condition.py.
| set[str] homeassistant.helpers.condition.async_extract_devices | ( | ConfigType | Template | config | ) |
Extract devices from a condition.
Definition at line 1149 of file condition.py.
| set[str] homeassistant.helpers.condition.async_extract_entities | ( | ConfigType | Template | config | ) |
Extract entities from a condition.
Definition at line 1121 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.async_from_config | ( | HomeAssistant | hass, |
| ConfigType | config | ||
| ) |
Turn a condition configuration into a method. Should be run on the event loop.
Definition at line 209 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.async_not_from_config | ( | HomeAssistant | hass, |
| ConfigType | config | ||
| ) |
Create multi condition matcher using 'NOT'.
Definition at line 323 of file condition.py.
| bool homeassistant.helpers.condition.async_numeric_state | ( | HomeAssistant | hass, |
| str | State | None | entity, | ||
| float | str | None | below = None, |
||
| float | str | None | above = None, |
||
| Template | None | value_template = None, |
||
| TemplateVarsType | variables = None, |
||
| str | None | attribute = None |
||
| ) |
Test a numeric state condition.
Definition at line 375 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.async_numeric_state_from_config | ( | ConfigType | config | ) |
Wrap action method with state based condition.
Definition at line 501 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.async_or_from_config | ( | HomeAssistant | hass, |
| ConfigType | config | ||
| ) |
Create multi condition matcher using 'OR'.
Definition at line 292 of file condition.py.
| bool homeassistant.helpers.condition.async_template | ( | HomeAssistant | hass, |
| Template | value_template, | ||
| TemplateVarsType | variables = None, |
||
| bool | trace_result = True |
||
| ) |
Test if template condition matches.
Definition at line 766 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.async_template_from_config | ( | ConfigType | config | ) |
Wrap action method with state based condition.
Definition at line 785 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.async_trigger_from_config | ( | HomeAssistant | hass, |
| ConfigType | config | ||
| ) |
Test a trigger condition.
Definition at line 1003 of file condition.py.
| ConfigType homeassistant.helpers.condition.async_validate_condition_config | ( | HomeAssistant | hass, |
| ConfigType | config | ||
| ) |
Validate config.
Definition at line 1045 of file condition.py.
| list[ConfigType | Template] homeassistant.helpers.condition.async_validate_conditions_config | ( | HomeAssistant | hass, |
| list[ConfigType] | conditions | ||
| ) |
Validate config.
Definition at line 1071 of file condition.py.
| TraceElement homeassistant.helpers.condition.condition_trace_append | ( | TemplateVarsType | variables, |
| str | path | ||
| ) |
Append a TraceElement to trace[path].
Definition at line 122 of file condition.py.
| None homeassistant.helpers.condition.condition_trace_set_result | ( | bool | result, |
| **Any | kwargs | ||
| ) |
Set the result of TraceElement at the top of the stack.
Definition at line 129 of file condition.py.
| None homeassistant.helpers.condition.condition_trace_update_result | ( | **Any | kwargs | ) |
Update the result of TraceElement at the top of the stack.
Definition at line 141 of file condition.py.
| bool homeassistant.helpers.condition.numeric_state | ( | HomeAssistant | hass, |
| str | State | None | entity, | ||
| float | str | None | below = None, |
||
| float | str | None | above = None, |
||
| Template | None | value_template = None, |
||
| TemplateVarsType | variables = None |
||
| ) |
Test a numeric state condition.
Definition at line 354 of file condition.py.
| ConfigType homeassistant.helpers.condition.numeric_state_validate_config | ( | HomeAssistant | hass, |
| ConfigType | config | ||
| ) |
Validate numeric_state condition config.
Definition at line 1021 of file condition.py.
| bool homeassistant.helpers.condition.state | ( | HomeAssistant | hass, |
| str | State | None | entity, | ||
| Any | req_state, | ||
| timedelta | None | for_period = None, |
||
| str | None | attribute = None, |
||
| TemplateVarsType | variables = None |
||
| ) |
Test if state matches requirements. Async friendly.
Definition at line 544 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.state_from_config | ( | ConfigType | config | ) |
Wrap action method with state based condition.
Definition at line 617 of file condition.py.
| ConfigType homeassistant.helpers.condition.state_validate_config | ( | HomeAssistant | hass, |
| ConfigType | config | ||
| ) |
Validate state condition config.
Definition at line 1034 of file condition.py.
| bool homeassistant.helpers.condition.sun | ( | HomeAssistant | hass, |
| str | None | before = None, |
||
| str | None | after = None, |
||
| timedelta | None | before_offset = None, |
||
| timedelta | None | after_offset = None |
||
| ) |
Test if current time matches sun requirements.
Definition at line 658 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.sun_from_config | ( | ConfigType | config | ) |
Wrap action method with sun based condition.
Definition at line 742 of file condition.py.
| bool homeassistant.helpers.condition.template | ( | HomeAssistant | hass, |
| Template | value_template, | ||
| TemplateVarsType | variables = None |
||
| ) |
Test if template condition matches.
Definition at line 757 of file condition.py.
| bool homeassistant.helpers.condition.time | ( | HomeAssistant | hass, |
| dt_time | str | None | before = None, |
||
| dt_time | str | None | after = None, |
||
| str | Container[str] | None | weekday = None |
||
| ) |
Test if local time condition matches. Handle the fact that time is continuous and we may be testing for a period that crosses midnight. In that case it is easier to test for the opposite. "(23:59 <= now < 00:01)" would be the same as "not (00:01 <= now < 23:59)".
Definition at line 797 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.time_from_config | ( | ConfigType | config | ) |
Wrap action method with time based condition.
Definition at line 896 of file condition.py.
| Generator[TraceElement] homeassistant.helpers.condition.trace_condition | ( | TemplateVarsType | variables | ) |
Trace condition evaluation.
Definition at line 154 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.trace_condition_function | ( | ConditionCheckerType | condition | ) |
Wrap a condition function to enable basic tracing.
Definition at line 174 of file condition.py.
| bool homeassistant.helpers.condition.zone | ( | HomeAssistant | hass, |
| str | State | None | zone_ent, | ||
| str | State | None | entity | ||
| ) |
Test if zone-condition matches. Async friendly.
Definition at line 910 of file condition.py.
| ConditionCheckerType homeassistant.helpers.condition.zone_from_config | ( | ConfigType | config | ) |
Wrap action method with zone based condition.
Definition at line 963 of file condition.py.
|
private |
Definition at line 81 of file condition.py.
| string homeassistant.helpers.condition.ASYNC_FROM_CONFIG_FORMAT = "async_{}_from_config" |
Definition at line 77 of file condition.py.
| homeassistant.helpers.condition.ConditionCheckerType |
Definition at line 119 of file condition.py.
| string homeassistant.helpers.condition.FROM_CONFIG_FORMAT = "{}_from_config" |
Definition at line 78 of file condition.py.
| homeassistant.helpers.condition.INPUT_ENTITY_ID |
Definition at line 95 of file condition.py.
| string homeassistant.helpers.condition.VALIDATE_CONFIG_FORMAT = "{}_validate_config" |
Definition at line 79 of file condition.py.