mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Change value of device_automation constant (#64296)
* Change value of constant CONF_CHANGED_STATES * Adjust tests
This commit is contained in:
parent
ab73d7c347
commit
513d6cc467
@ -1,5 +1,5 @@
|
||||
"""Constants for device automations."""
|
||||
CONF_CHANGED_STATES = "toggled"
|
||||
CONF_CHANGED_STATES = "changed_states"
|
||||
CONF_IS_OFF = "is_off"
|
||||
CONF_IS_ON = "is_on"
|
||||
CONF_TOGGLE = "toggle"
|
||||
|
@ -6,7 +6,7 @@
|
||||
"is_off": "{entity_name} is off"
|
||||
},
|
||||
"trigger_type": {
|
||||
"toggled": "{entity_name} turned on or off",
|
||||
"changed_states": "{entity_name} turned on or off",
|
||||
"turned_on": "{entity_name} turned on",
|
||||
"turned_off": "{entity_name} turned off"
|
||||
},
|
||||
|
@ -3,7 +3,7 @@
|
||||
"device_automation": {
|
||||
"trigger_type": {
|
||||
"target_humidity_changed": "{entity_name} target humidity changed",
|
||||
"toggled": "{entity_name} turned on or off",
|
||||
"changed_states": "{entity_name} turned on or off",
|
||||
"turned_on": "{entity_name} turned on",
|
||||
"turned_off": "{entity_name} turned off"
|
||||
},
|
||||
|
@ -14,7 +14,7 @@
|
||||
"is_off": "{entity_name} is off"
|
||||
},
|
||||
"trigger_type": {
|
||||
"toggled": "{entity_name} turned on or off",
|
||||
"changed_states": "{entity_name} turned on or off",
|
||||
"turned_on": "{entity_name} turned on",
|
||||
"turned_off": "{entity_name} turned off"
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
"is_off": "{entity_name} is off"
|
||||
},
|
||||
"trigger_type": {
|
||||
"toggled": "{entity_name} turned on or off",
|
||||
"changed_states": "{entity_name} turned on or off",
|
||||
"turned_on": "{entity_name} turned on",
|
||||
"turned_off": "{entity_name} turned off"
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
"is_off": "{entity_name} is off"
|
||||
},
|
||||
"trigger_type": {
|
||||
"toggled": "{entity_name} turned on or off",
|
||||
"changed_states": "{entity_name} turned on or off",
|
||||
"turned_on": "{entity_name} turned on",
|
||||
"turned_off": "{entity_name} turned off"
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ async def test_websocket_get_triggers(hass, hass_ws_client, device_reg, entity_r
|
||||
{
|
||||
"platform": "device",
|
||||
"domain": "light",
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": "light.test_5678",
|
||||
},
|
||||
|
@ -93,7 +93,7 @@ async def test_if_fires_on_state_change(hass, calls, enable_custom_integrations)
|
||||
"domain": "switch",
|
||||
"device_id": "",
|
||||
"entity_id": ent1.entity_id,
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
},
|
||||
"action": {
|
||||
"service": "test.automation",
|
||||
@ -135,7 +135,7 @@ async def test_if_fires_on_state_change(hass, calls, enable_custom_integrations)
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("trigger", ["turned_off", "toggled"])
|
||||
@pytest.mark.parametrize("trigger", ["turned_off", "changed_states"])
|
||||
async def test_if_fires_on_state_change_with_for(
|
||||
hass, calls, enable_custom_integrations, trigger
|
||||
):
|
||||
|
@ -69,7 +69,7 @@ async def test_get_triggers(hass, device_reg, entity_reg):
|
||||
{
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": f"{DOMAIN}.test_5678",
|
||||
},
|
||||
@ -157,7 +157,7 @@ async def test_if_fires_on_state_change(hass, calls):
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": "fan.entity",
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
},
|
||||
"action": {
|
||||
"service": "test.automation",
|
||||
|
@ -87,7 +87,7 @@ async def test_get_triggers(hass, device_reg, entity_reg):
|
||||
{
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": f"{DOMAIN}.test_5678",
|
||||
},
|
||||
@ -213,7 +213,7 @@ async def test_if_fires_on_state_change(hass, calls):
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": "humidifier.entity",
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
},
|
||||
"action": {
|
||||
"service": "test.automation",
|
||||
|
@ -54,7 +54,7 @@ async def test_get_triggers(hass, device_reg, entity_reg):
|
||||
{
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": f"{DOMAIN}.test_5678",
|
||||
},
|
||||
@ -174,7 +174,7 @@ async def test_if_fires_on_state_change(hass, calls, enable_custom_integrations)
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": ent1.entity_id,
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
},
|
||||
"action": {
|
||||
"service": "test.automation",
|
||||
|
@ -54,7 +54,7 @@ async def test_get_triggers(hass, device_reg, entity_reg):
|
||||
{
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": f"{DOMAIN}.test_5678",
|
||||
},
|
||||
@ -172,7 +172,7 @@ async def test_if_fires_on_state_change(hass, calls, enable_custom_integrations)
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": ent1.entity_id,
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
},
|
||||
"action": {
|
||||
"service": "test.automation",
|
||||
|
@ -54,7 +54,7 @@ async def test_get_triggers(hass, device_reg, entity_reg):
|
||||
{
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": f"{DOMAIN}.test_5678",
|
||||
},
|
||||
@ -172,7 +172,7 @@ async def test_if_fires_on_state_change(hass, calls, enable_custom_integrations)
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": ent1.entity_id,
|
||||
"type": "toggled",
|
||||
"type": "changed_states",
|
||||
},
|
||||
"action": {
|
||||
"service": "test.automation",
|
||||
|
@ -71,7 +71,7 @@ async def test_get_triggers(hass, wemo_entity):
|
||||
CONF_DOMAIN: Platform.SWITCH,
|
||||
CONF_ENTITY_ID: wemo_entity.entity_id,
|
||||
CONF_PLATFORM: "device",
|
||||
CONF_TYPE: "toggled",
|
||||
CONF_TYPE: "changed_states",
|
||||
},
|
||||
{
|
||||
CONF_DEVICE_ID: wemo_entity.device_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user