13 lines
490 B
Python
13 lines
490 B
Python
from __future__ import annotations
|
|
|
|
from app.core.ha_client import service_for_state
|
|
|
|
|
|
def test_service_for_state_maps_safe_domains() -> None:
|
|
assert service_for_state("light", "on") == ("light", "turn_on")
|
|
assert service_for_state("switch", "off") == ("switch", "turn_off")
|
|
assert service_for_state("cover", "open") == ("cover", "open_cover")
|
|
assert service_for_state("cover", "closed") == ("cover", "close_cover")
|
|
assert service_for_state("lock", "unlocked") is None
|
|
|