Fix coordinator not defined in yale_smart_alarm (#53973)

* Bugfix coordinator not defined

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
G Johansson 2021-08-04 22:16:39 +02:00 committed by GitHub
parent 6eae5231f1
commit 4ef859a9a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: