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:
@@ -167,6 +167,10 @@ class OasisDeviceCoordinator(DataUpdateCoordinator[list[OasisDevice]]):
|
|||||||
"Unexpected error talking to Oasis devices "
|
"Unexpected error talking to Oasis devices "
|
||||||
f"after {self.attempt} attempts"
|
f"after {self.attempt} attempts"
|
||||||
) from ex
|
) from ex
|
||||||
|
_LOGGER.warning(
|
||||||
|
"Error updating Oasis devices; reusing previous data", exc_info=ex
|
||||||
|
)
|
||||||
|
return self.data or devices
|
||||||
|
|
||||||
if devices != self.data:
|
if devices != self.data:
|
||||||
self.last_updated = dt_util.now()
|
self.last_updated = dt_util.now()
|
||||||
|
|||||||
@@ -60,8 +60,6 @@ class OasisCloudClient:
|
|||||||
self._playlists_next_refresh = {False: now_dt, True: now_dt}
|
self._playlists_next_refresh = {False: now_dt, True: now_dt}
|
||||||
self._playlists_lock = asyncio.Lock()
|
self._playlists_lock = asyncio.Lock()
|
||||||
|
|
||||||
self._playlist_details: dict[int, dict[str, str]] = {}
|
|
||||||
|
|
||||||
# software metadata cache
|
# software metadata cache
|
||||||
self._software_details: dict[str, int | str] | None = None
|
self._software_details: dict[str, int | str] | None = None
|
||||||
self._software_next_refresh = now()
|
self._software_next_refresh = now()
|
||||||
@@ -235,7 +233,7 @@ class OasisCloudClient:
|
|||||||
except UnauthenticatedError:
|
except UnauthenticatedError:
|
||||||
raise
|
raise
|
||||||
except Exception:
|
except Exception:
|
||||||
_LOGGER.exception("Error fetching track %s: %s", track_id)
|
_LOGGER.exception("Error fetching track %s", track_id)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
async def async_get_tracks(
|
async def async_get_tracks(
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ def _parse_int(val: str) -> int:
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return int(val)
|
return int(val)
|
||||||
except Exception: # noqa: BLE001
|
except (TypeError, ValueError):
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user