1
0
mirror of https://github.com/natekspencer/hacs-oasis_mini.git synced 2025-12-06 18:44:14 -05:00
This commit is contained in:
Nathan Spencer
2025-11-24 05:51:55 +00:00
parent fbb3012379
commit 5c49119ae5
3 changed files with 10 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ PLATFORMS = [
def setup_platform_from_coordinator(
entry: OasisDeviceConfigEntry,
async_add_entities: AddEntitiesCallback,
make_entities: Callable[[list[OasisDevice]], Iterable[OasisDeviceEntity]],
make_entities: Callable[[Iterable[OasisDevice]], Iterable[OasisDeviceEntity]],
update_before_add: bool = False,
) -> None:
"""
@@ -110,11 +110,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: OasisDeviceConfigEntry)
raise
mqtt_client = OasisMqttClient()
mqtt_client.start()
coordinator = OasisDeviceCoordinator(hass, cloud_client, mqtt_client)
try:
mqtt_client.start()
await coordinator.async_config_entry_first_refresh()
except Exception:
await mqtt_client.async_close()
@@ -182,7 +181,9 @@ async def async_remove_entry(
await cloud_client.async_close()
async def async_migrate_entry(hass: HomeAssistant, entry: OasisDeviceConfigEntry):
async def async_migrate_entry(
hass: HomeAssistant, entry: OasisDeviceConfigEntry
) -> bool:
"""
Migrate an Oasis config entry to the current schema (minor version 3).

View File

@@ -161,7 +161,7 @@ class OasisDeviceCoordinator(DataUpdateCoordinator[list[OasisDevice]]):
except UpdateFailed:
raise
except Exception as ex: # noqa: BLE001
except Exception as ex:
if self.attempt > 2 or not (devices or self.data):
raise UpdateFailed(
"Unexpected error talking to Oasis devices "