def test_entity_id():
"""Test entity ID validation."""
schema = vol.Schema(cv.entity_id)
with pytest.raises(vol.MultipleInvalid):
schema('invalid_entity')
assert 'sensor.light' == schema('sensor.LIGHT')
评论列表
文章目录