1
0
mirror of https://github.com/natekspencer/hacs-oasis_mini.git synced 2025-12-06 18:44:14 -05:00

Address PR comments

This commit is contained in:
Nathan Spencer
2025-11-24 04:31:52 +00:00
parent 1d521bcc18
commit 14223bd1c9
3 changed files with 6 additions and 4 deletions

View File

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

View File

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

View File

@@ -39,7 +39,7 @@ def _parse_int(val: str) -> int:
"""
try:
return int(val)
except Exception: # noqa: BLE001
except (TypeError, ValueError):
return 0