From 11e897a5e84ccbf5ac9ed7da81761648ece4c808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Thu, 8 Sep 2022 10:50:14 +0200 Subject: [PATCH] Extract lametric device from coordinator in notify (#78027) --- homeassistant/components/lametric/notify.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/lametric/notify.py b/homeassistant/components/lametric/notify.py index 4b404840388..c9ae376c496 100644 --- a/homeassistant/components/lametric/notify.py +++ b/homeassistant/components/lametric/notify.py @@ -21,6 +21,7 @@ from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from .const import CONF_CYCLES, CONF_ICON_TYPE, CONF_PRIORITY, CONF_SOUND, DOMAIN +from .coordinator import LaMetricDataUpdateCoordinator async def async_get_service( @@ -31,8 +32,10 @@ async def async_get_service( """Get the LaMetric notification service.""" if discovery_info is None: return None - lametric: LaMetricDevice = hass.data[DOMAIN][discovery_info["entry_id"]] - return LaMetricNotificationService(lametric) + coordinator: LaMetricDataUpdateCoordinator = hass.data[DOMAIN][ + discovery_info["entry_id"] + ] + return LaMetricNotificationService(coordinator.lametric) class LaMetricNotificationService(BaseNotificationService):