Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panel id is serial number for alarm #238

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions custom_components/sector/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand Down
Loading