Support datetime sensor in time trigger (#42899)
This commit is contained in:
parent
03653f5d2c
commit
aec191b558
4 changed files with 165 additions and 20 deletions
|
@ -179,15 +179,21 @@ def test_entity_domain():
|
|||
"""Test entity domain validation."""
|
||||
schema = vol.Schema(cv.entity_domain("sensor"))
|
||||
|
||||
options = ("invalid_entity", "cover.demo")
|
||||
|
||||
for value in options:
|
||||
for value in ("invalid_entity", "cover.demo"):
|
||||
with pytest.raises(vol.MultipleInvalid):
|
||||
print(value)
|
||||
schema(value)
|
||||
|
||||
assert schema("sensor.LIGHT") == "sensor.light"
|
||||
|
||||
schema = vol.Schema(cv.entity_domain(("sensor", "binary_sensor")))
|
||||
|
||||
for value in ("invalid_entity", "cover.demo"):
|
||||
with pytest.raises(vol.MultipleInvalid):
|
||||
schema(value)
|
||||
|
||||
assert schema("sensor.LIGHT") == "sensor.light"
|
||||
assert schema("binary_sensor.LIGHT") == "binary_sensor.light"
|
||||
|
||||
|
||||
def test_entities_domain():
|
||||
"""Test entities domain validation."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue