From 769e382420b040ed0be532ad7cdce6115f06f7e6 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Wed, 13 Nov 2024 22:03:58 +0100 Subject: [PATCH] Panel id is serial number for alarm --- custom_components/sector/alarm_control_panel.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/custom_components/sector/alarm_control_panel.py b/custom_components/sector/alarm_control_panel.py index 3cdf20c..f97faf9 100644 --- a/custom_components/sector/alarm_control_panel.py +++ b/custom_components/sector/alarm_control_panel.py @@ -14,7 +14,7 @@ from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers.entity_platform import AddEntitiesCallback -from .const import CONF_CODE_FORMAT +from .const import CONF_CODE_FORMAT, CONF_PANEL_ID from .coordinator import SectorAlarmConfigEntry, SectorDataUpdateCoordinator from .entity import SectorAlarmBaseEntity @@ -51,11 +51,7 @@ class SectorAlarmControlPanel(SectorAlarmBaseEntity, AlarmControlPanelEntity): def __init__(self, coordinator: SectorDataUpdateCoordinator) -> None: """Initialize the control panel.""" - panel_status = coordinator.data.get("panel_status", {}) - serial_no = ( - panel_status.get("SerialNo") or coordinator.config_entry.data["panel_id"] - ) - super().__init__(coordinator, serial_no, "Sector Alarm Panel", "Alarm panel") + super().__init__(coordinator, coordinator.config_entry.data[CONF_PANEL_ID], "Sector Alarm Panel", "Alarm panel") self._attr_unique_id = f"{self._serial_no}_alarm_panel" _LOGGER.debug(