Elmax/alarm_control_panel (#75365)
This commit is contained in:
parent
f99d26231f
commit
ecdbddc1fa
4 changed files with 124 additions and 3 deletions
|
@ -14,6 +14,7 @@ from elmax_api.exceptions import (
|
|||
)
|
||||
from elmax_api.http import Elmax
|
||||
from elmax_api.model.actuator import Actuator
|
||||
from elmax_api.model.area import Area
|
||||
from elmax_api.model.endpoint import DeviceEndpoint
|
||||
from elmax_api.model.panel import PanelEntry, PanelStatus
|
||||
|
||||
|
@ -62,15 +63,21 @@ class ElmaxCoordinator(DataUpdateCoordinator[PanelStatus]):
|
|||
def get_actuator_state(self, actuator_id: str) -> Actuator:
|
||||
"""Return state of a specific actuator."""
|
||||
if self._state_by_endpoint is not None:
|
||||
return self._state_by_endpoint.get(actuator_id)
|
||||
return self._state_by_endpoint[actuator_id]
|
||||
raise HomeAssistantError("Unknown actuator")
|
||||
|
||||
def get_zone_state(self, zone_id: str) -> Actuator:
|
||||
"""Return state of a specific zone."""
|
||||
if self._state_by_endpoint is not None:
|
||||
return self._state_by_endpoint.get(zone_id)
|
||||
return self._state_by_endpoint[zone_id]
|
||||
raise HomeAssistantError("Unknown zone")
|
||||
|
||||
def get_area_state(self, area_id: str) -> Area:
|
||||
"""Return state of a specific area."""
|
||||
if self._state_by_endpoint is not None and area_id:
|
||||
return self._state_by_endpoint[area_id]
|
||||
raise HomeAssistantError("Unknown area")
|
||||
|
||||
@property
|
||||
def http_client(self):
|
||||
"""Return the current http client being used by this instance."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue