Fix callback and async (#31281)
* Fix callback and async * Fix a return * Fix test * Fix mqtt tests * Fix some more callbacks
This commit is contained in:
parent
ee602e40a6
commit
e9e44dbd97
90 changed files with 627 additions and 883 deletions
|
@ -18,7 +18,7 @@ from homeassistant.const import (
|
|||
STATE_OPEN,
|
||||
STATE_OPENING,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers import (
|
||||
condition,
|
||||
config_validation as cv,
|
||||
|
@ -163,6 +163,7 @@ async def async_get_condition_capabilities(hass: HomeAssistant, config: dict) ->
|
|||
}
|
||||
|
||||
|
||||
@callback
|
||||
def async_condition_from_config(
|
||||
config: ConfigType, config_validation: bool
|
||||
) -> condition.ConditionCheckerType:
|
||||
|
@ -196,6 +197,7 @@ def async_condition_from_config(
|
|||
f"{{{{ state.attributes.{position} }}}}"
|
||||
)
|
||||
|
||||
@callback
|
||||
def template_if(hass: HomeAssistant, variables: TemplateVarsType = None) -> bool:
|
||||
"""Validate template based if-condition."""
|
||||
value_template.hass = hass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue