Support datetime sensor in time trigger (#42899)

This commit is contained in:
Paulus Schoutsen 2020-11-09 14:50:54 +01:00 committed by GitHub
parent 03653f5d2c
commit aec191b558
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 165 additions and 20 deletions

View file

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