Implement time tracking in templates (#41147)
Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
This commit is contained in:
parent
8949eb2442
commit
31c21126a8
5 changed files with 374 additions and 32 deletions
|
@ -417,7 +417,12 @@ async def test_render_template_renders_template(hass, websocket_client):
|
|||
event = msg["event"]
|
||||
assert event == {
|
||||
"result": "State is: on",
|
||||
"listeners": {"all": False, "domains": [], "entities": ["light.test"]},
|
||||
"listeners": {
|
||||
"all": False,
|
||||
"domains": [],
|
||||
"entities": ["light.test"],
|
||||
"time": False,
|
||||
},
|
||||
}
|
||||
|
||||
hass.states.async_set("light.test", "off")
|
||||
|
@ -427,7 +432,12 @@ async def test_render_template_renders_template(hass, websocket_client):
|
|||
event = msg["event"]
|
||||
assert event == {
|
||||
"result": "State is: off",
|
||||
"listeners": {"all": False, "domains": [], "entities": ["light.test"]},
|
||||
"listeners": {
|
||||
"all": False,
|
||||
"domains": [],
|
||||
"entities": ["light.test"],
|
||||
"time": False,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
@ -456,7 +466,12 @@ async def test_render_template_manual_entity_ids_no_longer_needed(
|
|||
event = msg["event"]
|
||||
assert event == {
|
||||
"result": "State is: on",
|
||||
"listeners": {"all": False, "domains": [], "entities": ["light.test"]},
|
||||
"listeners": {
|
||||
"all": False,
|
||||
"domains": [],
|
||||
"entities": ["light.test"],
|
||||
"time": False,
|
||||
},
|
||||
}
|
||||
|
||||
hass.states.async_set("light.test", "off")
|
||||
|
@ -466,7 +481,12 @@ async def test_render_template_manual_entity_ids_no_longer_needed(
|
|||
event = msg["event"]
|
||||
assert event == {
|
||||
"result": "State is: off",
|
||||
"listeners": {"all": False, "domains": [], "entities": ["light.test"]},
|
||||
"listeners": {
|
||||
"all": False,
|
||||
"domains": [],
|
||||
"entities": ["light.test"],
|
||||
"time": False,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
@ -553,7 +573,12 @@ async def test_render_template_with_delayed_error(hass, websocket_client, caplog
|
|||
event = msg["event"]
|
||||
assert event == {
|
||||
"result": "on",
|
||||
"listeners": {"all": False, "domains": [], "entities": ["sensor.test"]},
|
||||
"listeners": {
|
||||
"all": False,
|
||||
"domains": [],
|
||||
"entities": ["sensor.test"],
|
||||
"time": False,
|
||||
},
|
||||
}
|
||||
|
||||
msg = await websocket_client.receive_json()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue