Change value of device_automation constant (#64296)

* Change value of constant CONF_CHANGED_STATES

* Adjust tests
This commit is contained in:
Erik Montnemery 2022-01-17 16:34:40 +01:00 committed by GitHub
parent ab73d7c347
commit 513d6cc467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 20 additions and 20 deletions

View File

@ -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"

View File

@ -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"
},

View File

@ -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"
},

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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",
},

View File

@ -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
):

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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,