Remove device from device action schema (#26536)
This commit is contained in:
1 parent
b14b14c3c9
commit
02ded7a4a8
6 files changed
+29
-30
No files matched your search
@@ -43,21 +43,18 @@ async def test_websocket_get_actions(hass, hass_ws_client, device_reg, entity_re
|
||||
entity_reg.async_get_or_create("light", "test", "5678", device_id=device_entry.id)
|
||||
expected_actions = [
|
||||
{
|
||||
"device": None,
|
||||
"domain": "light",
|
||||
"type": "turn_off",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": "light.test_5678",
|
||||
},
|
||||
{
|
||||
"device": None,
|
||||
"domain": "light",
|
||||
"type": "turn_on",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": "light.test_5678",
|
||||
},
|
||||
{
|
||||
"device": None,
|
||||
"domain": "light",
|
||||
"type": "toggle",
|
||||
"device_id": device_entry.id,
|
||||
|
||||
@@ -57,21 +57,18 @@ async def test_get_actions(hass, device_reg, entity_reg):
|
||||
entity_reg.async_get_or_create(DOMAIN, "test", "5678", device_id=device_entry.id)
|
||||
expected_actions = [
|
||||
{
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"type": "turn_off",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": f"{DOMAIN}.test_5678",
|
||||
},
|
||||
{
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"type": "turn_on",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": f"{DOMAIN}.test_5678",
|
||||
},
|
||||
{
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"type": "toggle",
|
||||
"device_id": device_entry.id,
|
||||
@@ -164,6 +161,7 @@ async def test_if_fires_on_state_change(hass, calls):
|
||||
"trigger": {
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "turn_on",
|
||||
},
|
||||
@@ -187,6 +185,7 @@ async def test_if_fires_on_state_change(hass, calls):
|
||||
"trigger": {
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "turn_off",
|
||||
},
|
||||
@@ -248,6 +247,7 @@ async def test_if_state(hass, calls):
|
||||
{
|
||||
"condition": "device",
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "is_on",
|
||||
}
|
||||
@@ -266,6 +266,7 @@ async def test_if_state(hass, calls):
|
||||
{
|
||||
"condition": "device",
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "is_off",
|
||||
}
|
||||
@@ -316,8 +317,8 @@ async def test_action(hass, calls):
|
||||
{
|
||||
"trigger": {"platform": "event", "event_type": "test_event1"},
|
||||
"action": {
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "turn_off",
|
||||
},
|
||||
@@ -325,8 +326,8 @@ async def test_action(hass, calls):
|
||||
{
|
||||
"trigger": {"platform": "event", "event_type": "test_event2"},
|
||||
"action": {
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "turn_on",
|
||||
},
|
||||
@@ -334,8 +335,8 @@ async def test_action(hass, calls):
|
||||
{
|
||||
"trigger": {"platform": "event", "event_type": "test_event3"},
|
||||
"action": {
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "toggle",
|
||||
},
|
||||
|
||||
@@ -57,21 +57,18 @@ async def test_get_actions(hass, device_reg, entity_reg):
|
||||
entity_reg.async_get_or_create(DOMAIN, "test", "5678", device_id=device_entry.id)
|
||||
expected_actions = [
|
||||
{
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"type": "turn_off",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": f"{DOMAIN}.test_5678",
|
||||
},
|
||||
{
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"type": "turn_on",
|
||||
"device_id": device_entry.id,
|
||||
"entity_id": f"{DOMAIN}.test_5678",
|
||||
},
|
||||
{
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"type": "toggle",
|
||||
"device_id": device_entry.id,
|
||||
@@ -164,6 +161,7 @@ async def test_if_fires_on_state_change(hass, calls):
|
||||
"trigger": {
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "turn_on",
|
||||
},
|
||||
@@ -187,6 +185,7 @@ async def test_if_fires_on_state_change(hass, calls):
|
||||
"trigger": {
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "turn_off",
|
||||
},
|
||||
@@ -248,6 +247,7 @@ async def test_if_state(hass, calls):
|
||||
{
|
||||
"condition": "device",
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "is_on",
|
||||
}
|
||||
@@ -266,6 +266,7 @@ async def test_if_state(hass, calls):
|
||||
{
|
||||
"condition": "device",
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "is_off",
|
||||
}
|
||||
@@ -316,8 +317,8 @@ async def test_action(hass, calls):
|
||||
{
|
||||
"trigger": {"platform": "event", "event_type": "test_event1"},
|
||||
"action": {
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "turn_off",
|
||||
},
|
||||
@@ -325,8 +326,8 @@ async def test_action(hass, calls):
|
||||
{
|
||||
"trigger": {"platform": "event", "event_type": "test_event2"},
|
||||
"action": {
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "turn_on",
|
||||
},
|
||||
@@ -334,8 +335,8 @@ async def test_action(hass, calls):
|
||||
{
|
||||
"trigger": {"platform": "event", "event_type": "test_event3"},
|
||||
"action": {
|
||||
"device": None,
|
||||
"domain": DOMAIN,
|
||||
"device_id": "",
|
||||
"entity_id": dev1.entity_id,
|
||||
"type": "toggle",
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user