Add climate device triggers (#28544)

* Add climate device triggers

* Test capabilities
This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2019-11-07 16:28:45 +01:00
1 parent af73e54aee
commit 48660585f1
10 files changed
+470 -28

No files matched your search

@@ -28,7 +28,9 @@ TRIGGER_SCHEMA = IF_ACTION_SCHEMA = vol.Schema(
)
async def async_attach_trigger(hass, config, action, automation_info):
async def async_attach_trigger(
hass, config, action, automation_info, *, platform_type="numeric_state"
):
"""Listen for state changes based on configuration."""
value_template = config.get(CONF_VALUE_TEMPLATE)
value_template.hass = hass
@@ -65,7 +67,7 @@ async def async_attach_trigger(hass, config, action, automation_info):
variables = {
"trigger": {
"platform": "template",
"platform": platform_type,
"entity_id": entity_id,
"from_state": from_s,
"to_state": to_s,