1 """Z-Wave JS trigger dispatcher."""
3 from __future__
import annotations
14 from .triggers
import event, value_updated
17 "value_updated": value_updated,
23 """Return trigger platform."""
24 platform_split = config[CONF_PLATFORM].split(
".", maxsplit=1)
25 if len(platform_split) < 2
or platform_split[1]
not in TRIGGERS:
26 raise ValueError(f
"Unknown Z-Wave JS trigger platform {config[CONF_PLATFORM]}")
27 return TRIGGERS[platform_split[1]]
31 hass: HomeAssistant, config: ConfigType
33 """Validate config."""
35 return await platform.async_validate_trigger_config(hass, config)
41 action: TriggerActionType,
42 trigger_info: TriggerInfo,
44 """Attach trigger of specified platform."""
46 return await platform.async_attach_trigger(hass, config, action, trigger_info)
TriggerProtocol _get_trigger_platform(ConfigType config)
CALLBACK_TYPE async_attach_trigger(HomeAssistant hass, ConfigType config, TriggerActionType action, TriggerInfo trigger_info)
ConfigType async_validate_trigger_config(HomeAssistant hass, ConfigType config)