From 73f96d830271c34e3da4fb24782de06a5b97b889 Mon Sep 17 00:00:00 2001 From: Nathan Spencer Date: Fri, 10 Jan 2025 22:17:52 +0000 Subject: [PATCH] Don't update image unless playing or image hasn't been cached yet --- custom_components/oasis_mini/image.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/custom_components/oasis_mini/image.py b/custom_components/oasis_mini/image.py index 3f4b69b..4f495ea 100644 --- a/custom_components/oasis_mini/image.py +++ b/custom_components/oasis_mini/image.py @@ -42,9 +42,10 @@ class OasisMiniImageEntity(OasisMiniEntity, ImageEntity): @callback def _handle_coordinator_update(self) -> None: """Handle updated data from the coordinator.""" - if self._track_id != self.device.track_id or ( - self._progress != self.device.progress and self.device.access_token - ): + if ( + self._track_id != self.device.track_id + or (self._progress != self.device.progress and self.device.access_token) + ) and (self.device.status == "playing" or self._cached_image is None): self._attr_image_last_updated = self.coordinator.last_updated self._track_id = self.device.track_id self._progress = self.device.progress