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

pull/92019/head
Alberto Geniola 2023-04-25 17:56:01 +02:00 committed by GitHub
parent 792ea92e55
commit dae05a0c93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

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,