diff --git a/custom_components/oasis_mini/coordinator.py b/custom_components/oasis_mini/coordinator.py index 4261d42..ef4e500 100644 --- a/custom_components/oasis_mini/coordinator.py +++ b/custom_components/oasis_mini/coordinator.py @@ -167,6 +167,10 @@ class OasisDeviceCoordinator(DataUpdateCoordinator[list[OasisDevice]]): "Unexpected error talking to Oasis devices " f"after {self.attempt} attempts" ) from ex + _LOGGER.warning( + "Error updating Oasis devices; reusing previous data", exc_info=ex + ) + return self.data or devices if devices != self.data: self.last_updated = dt_util.now() diff --git a/custom_components/oasis_mini/pyoasiscontrol/clients/cloud_client.py b/custom_components/oasis_mini/pyoasiscontrol/clients/cloud_client.py index e45992d..aa95dbd 100644 --- a/custom_components/oasis_mini/pyoasiscontrol/clients/cloud_client.py +++ b/custom_components/oasis_mini/pyoasiscontrol/clients/cloud_client.py @@ -60,8 +60,6 @@ class OasisCloudClient: self._playlists_next_refresh = {False: now_dt, True: now_dt} self._playlists_lock = asyncio.Lock() - self._playlist_details: dict[int, dict[str, str]] = {} - # software metadata cache self._software_details: dict[str, int | str] | None = None self._software_next_refresh = now() @@ -235,7 +233,7 @@ class OasisCloudClient: except UnauthenticatedError: raise except Exception: - _LOGGER.exception("Error fetching track %s: %s", track_id) + _LOGGER.exception("Error fetching track %s", track_id) return None async def async_get_tracks( diff --git a/custom_components/oasis_mini/pyoasiscontrol/utils.py b/custom_components/oasis_mini/pyoasiscontrol/utils.py index a77ebec..d9e13d0 100644 --- a/custom_components/oasis_mini/pyoasiscontrol/utils.py +++ b/custom_components/oasis_mini/pyoasiscontrol/utils.py @@ -39,7 +39,7 @@ def _parse_int(val: str) -> int: """ try: return int(val) - except Exception: # noqa: BLE001 + except (TypeError, ValueError): return 0