From 8d173174e286b0451cbb2c0d4ae3087028d1ea23 Mon Sep 17 00:00:00 2001 From: RyanClark123 Date: Tue, 30 May 2023 13:46:48 +0100 Subject: [PATCH] Fixed binary sensors ### Fix * Fixed issue with binary sensors not loading, caused by change to way the coordinators are stored --- custom_components/owlet/binary_sensor.py | 10 ++++++---- custom_components/owlet/manifest.json | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/custom_components/owlet/binary_sensor.py b/custom_components/owlet/binary_sensor.py index f52abc7..46370f5 100644 --- a/custom_components/owlet/binary_sensor.py +++ b/custom_components/owlet/binary_sensor.py @@ -102,11 +102,13 @@ async def async_setup_entry( ) -> None: """Set up the owlet sensors from config entry.""" - coordinator: OwletCoordinator = hass.data[DOMAIN][config_entry.entry_id] + coordinators: OwletCoordinator = hass.data[DOMAIN][config_entry.entry_id] - entities = [OwletBinarySensor(coordinator, sensor) for sensor in SENSORS] - - async_add_entities(entities) + async_add_entities( + OwletBinarySensor(coordinator, sensor) + for coordinator in coordinators + for sensor in SENSORS + ) class OwletBinarySensor(OwletBaseEntity, BinarySensorEntity): diff --git a/custom_components/owlet/manifest.json b/custom_components/owlet/manifest.json index 84c705b..8702d18 100644 --- a/custom_components/owlet/manifest.json +++ b/custom_components/owlet/manifest.json @@ -6,5 +6,5 @@ "documentation": "https://www.home-assistant.io/integrations/owlet", "iot_class": "cloud_polling", "requirements": ["pyowletapi==2023.5.30"], - "version":"2023.5.6" + "version":"2023.5.7" }