From 406a29912d8a35a3b222fe2718b4bddbf2dc0a7d Mon Sep 17 00:00:00 2001 From: rikroe <42204099+rikroe@users.noreply.github.com> Date: Mon, 6 Feb 2023 17:15:28 +0100 Subject: [PATCH] Fix notify targets for bmw_connected_drive (#87503) Co-authored-by: rikroe --- homeassistant/components/bmw_connected_drive/notify.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/bmw_connected_drive/notify.py b/homeassistant/components/bmw_connected_drive/notify.py index b48441ae5fe..036d5147c4f 100644 --- a/homeassistant/components/bmw_connected_drive/notify.py +++ b/homeassistant/components/bmw_connected_drive/notify.py @@ -52,9 +52,16 @@ def get_service( class BMWNotificationService(BaseNotificationService): """Send Notifications to BMW.""" + vehicle_targets: dict[str, MyBMWVehicle] + def __init__(self, targets: dict[str, MyBMWVehicle]) -> None: """Set up the notification service.""" - self.targets: dict[str, MyBMWVehicle] = targets + self.vehicle_targets = targets + + @property + def targets(self) -> dict[str, Any] | None: + """Return a dictionary of registered targets.""" + return self.vehicle_targets async def async_send_message(self, message: str = "", **kwargs: Any) -> None: """Send a message or POI to the car."""