mirror of
https://github.com/natekspencer/hacs-oasis_mini.git
synced 2025-12-06 18:44:14 -05:00
Adjust exceptions
This commit is contained in:
@@ -32,7 +32,7 @@ class OasisDeviceCoordinator(DataUpdateCoordinator[list[OasisDevice]]):
|
||||
) -> None:
|
||||
"""
|
||||
Create an OasisDeviceCoordinator that manages OasisDevice discovery and updates using cloud and MQTT clients.
|
||||
|
||||
|
||||
Parameters:
|
||||
cloud_client (OasisCloudClient): Client for communicating with the Oasis cloud API and fetching device data.
|
||||
mqtt_client (OasisMqttClient): Client for registering devices and coordinating MQTT-based readiness/status.
|
||||
@@ -50,10 +50,10 @@ class OasisDeviceCoordinator(DataUpdateCoordinator[list[OasisDevice]]):
|
||||
async def _async_update_data(self) -> list[OasisDevice]:
|
||||
"""
|
||||
Fetch and assemble the current list of OasisDevice objects, reconcile removed devices in Home Assistant, register discovered devices with MQTT, and verify per-device readiness.
|
||||
|
||||
|
||||
Returns:
|
||||
A list of OasisDevice instances representing devices currently available for the account.
|
||||
|
||||
|
||||
Raises:
|
||||
UpdateFailed: If no devices can be read after repeated attempts or an unexpected error persists past retry limits.
|
||||
"""
|
||||
@@ -117,7 +117,7 @@ class OasisDeviceCoordinator(DataUpdateCoordinator[list[OasisDevice]]):
|
||||
# Best-effort playlists
|
||||
try:
|
||||
await self.cloud_client.async_get_playlists()
|
||||
except Exception: # noqa: BLE001
|
||||
except Exception:
|
||||
_LOGGER.exception("Error fetching playlists from cloud")
|
||||
|
||||
any_success = False
|
||||
@@ -145,7 +145,7 @@ class OasisDeviceCoordinator(DataUpdateCoordinator[list[OasisDevice]]):
|
||||
any_success = True
|
||||
device.schedule_track_refresh()
|
||||
|
||||
except Exception: # noqa: BLE001
|
||||
except Exception:
|
||||
_LOGGER.exception(
|
||||
"Error preparing Oasis device %s", device.serial_number
|
||||
)
|
||||
@@ -171,4 +171,4 @@ class OasisDeviceCoordinator(DataUpdateCoordinator[list[OasisDevice]]):
|
||||
if devices != self.data:
|
||||
self.last_updated = dt_util.now()
|
||||
|
||||
return devices
|
||||
return devices
|
||||
|
||||
Reference in New Issue
Block a user