Add check on disarm code for Alarm Control Panel - Elmax (#91158)

This commit is contained in:
Alberto Geniola
2023-04-25 17:56:01 +02:00
committed by GitHub
parent 792ea92e55
commit dae05a0c93

View File

@@ -83,6 +83,9 @@ class ElmaxArea(ElmaxEntity, AlarmControlPanelEntity):
async def async_alarm_disarm(self, code: str | None = None) -> None:
"""Send disarm command."""
# Elmax alarm panels do always require a code to be passed for disarm operations
if code is None or code == "":
raise ValueError("Please input the disarm code.")
await self.coordinator.http_client.execute_command(
endpoint_id=self._device.endpoint_id,
command=AreaCommand.DISARM,