1
0
mirror of https://github.com/natekspencer/hacs-oasis_mini.git synced 2025-11-08 05:03:52 -05:00

Don't update image unless playing or image hasn't been cached yet

This commit is contained in:
Nathan Spencer
2025-01-10 22:17:52 +00:00
parent 9cc1d6d314
commit 73f96d8302

View File

@@ -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