Add native HA integration and dashboard
This commit is contained in:
12
tests/test_ha_client.py
Normal file
12
tests/test_ha_client.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user