From c59881de7fa41bd1cc2ef581795b5457c9c07518 Mon Sep 17 00:00:00 2001 From: Patrick762 Date: Sun, 18 Feb 2024 16:52:23 +0100 Subject: [PATCH] fix switch coordinator references --- custom_components/bluetti_bt/switch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/bluetti_bt/switch.py b/custom_components/bluetti_bt/switch.py index c1231f1..4481fdf 100644 --- a/custom_components/bluetti_bt/switch.py +++ b/custom_components/bluetti_bt/switch.py @@ -93,8 +93,8 @@ class BluettiSwitch(CoordinatorEntity, SwitchEntity): self._bluetti_device = bluetti_device self._coordinator = coordinator - self._client = coordinator.client - self._polling_lock = coordinator.polling_lock + self._client = coordinator.reader.client + self._polling_lock = coordinator.reader.polling_lock e_name = f"{device_info.get('name')} {name}" self._address = address self._response_key = response_key @@ -178,7 +178,7 @@ class BluettiSwitch(CoordinatorEntity, SwitchEntity): return None finally: # Disconnect if connection not persistant - if not self._coordinator.persistent_conn: + if not self._coordinator.reader.persistent_conn: await self._client.disconnect() await self.coordinator.async_request_refresh()