mirror of
https://github.com/home-assistant/core.git
synced 2025-12-23 20:39:01 +00:00
Implement time tracking in templates (#41147)
Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user