mirror of
https://github.com/natekspencer/hacs-oasis_mini.git
synced 2025-11-13 07:33:51 -05:00
Don't update image unless playing or image hasn't been cached yet
This commit is contained in:
@@ -42,9 +42,10 @@ class OasisMiniImageEntity(OasisMiniEntity, ImageEntity):
|
|||||||
@callback
|
@callback
|
||||||
def _handle_coordinator_update(self) -> None:
|
def _handle_coordinator_update(self) -> None:
|
||||||
"""Handle updated data from the coordinator."""
|
"""Handle updated data from the coordinator."""
|
||||||
if self._track_id != self.device.track_id or (
|
if (
|
||||||
self._progress != self.device.progress and self.device.access_token
|
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._attr_image_last_updated = self.coordinator.last_updated
|
||||||
self._track_id = self.device.track_id
|
self._track_id = self.device.track_id
|
||||||
self._progress = self.device.progress
|
self._progress = self.device.progress
|
||||||
|
|||||||
Reference in New Issue
Block a user