From 4ef859a9a967c1e918c6462b71ebf075fdcc79e3 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Wed, 4 Aug 2021 22:16:39 +0200 Subject: [PATCH] Fix coordinator not defined in yale_smart_alarm (#53973) * Bugfix coordinator not defined * Apply suggestions from code review Co-authored-by: Martin Hjelmare --- .../yale_smart_alarm/alarm_control_panel.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/yale_smart_alarm/alarm_control_panel.py b/homeassistant/components/yale_smart_alarm/alarm_control_panel.py index f450895f5c3..ae5596ee2e1 100644 --- a/homeassistant/components/yale_smart_alarm/alarm_control_panel.py +++ b/homeassistant/components/yale_smart_alarm/alarm_control_panel.py @@ -86,11 +86,12 @@ async def async_setup_entry( class YaleAlarmDevice(CoordinatorEntity, AlarmControlPanelEntity): """Represent a Yale Smart Alarm.""" - coordinator: YaleDataUpdateCoordinator - - _attr_name: str = coordinator.entry.data[CONF_NAME] - _attr_unique_id: str = coordinator.entry.entry_id - _identifier: str = coordinator.entry.data[CONF_USERNAME] + def __init__(self, coordinator: YaleDataUpdateCoordinator) -> None: + """Initialize the Yale Alarm Device.""" + super().__init__(coordinator) + self._attr_name: str = coordinator.entry.data[CONF_NAME] + self._attr_unique_id = coordinator.entry.entry_id + self._identifier: str = coordinator.entry.data[CONF_USERNAME] @property def device_info(self) -> DeviceInfo: