mirror of
https://github.com/natekspencer/hacs-oasis_mini.git
synced 2025-12-06 18:44:14 -05:00
PR fixes
This commit is contained in:
@@ -41,7 +41,7 @@ PLATFORMS = [
|
|||||||
def setup_platform_from_coordinator(
|
def setup_platform_from_coordinator(
|
||||||
entry: OasisDeviceConfigEntry,
|
entry: OasisDeviceConfigEntry,
|
||||||
async_add_entities: AddEntitiesCallback,
|
async_add_entities: AddEntitiesCallback,
|
||||||
make_entities: Callable[[list[OasisDevice]], Iterable[OasisDeviceEntity]],
|
make_entities: Callable[[Iterable[OasisDevice]], Iterable[OasisDeviceEntity]],
|
||||||
update_before_add: bool = False,
|
update_before_add: bool = False,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
@@ -110,11 +110,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: OasisDeviceConfigEntry)
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
mqtt_client = OasisMqttClient()
|
mqtt_client = OasisMqttClient()
|
||||||
mqtt_client.start()
|
|
||||||
|
|
||||||
coordinator = OasisDeviceCoordinator(hass, cloud_client, mqtt_client)
|
coordinator = OasisDeviceCoordinator(hass, cloud_client, mqtt_client)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
mqtt_client.start()
|
||||||
await coordinator.async_config_entry_first_refresh()
|
await coordinator.async_config_entry_first_refresh()
|
||||||
except Exception:
|
except Exception:
|
||||||
await mqtt_client.async_close()
|
await mqtt_client.async_close()
|
||||||
@@ -182,7 +181,9 @@ async def async_remove_entry(
|
|||||||
await cloud_client.async_close()
|
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).
|
Migrate an Oasis config entry to the current schema (minor version 3).
|
||||||
|
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ class OasisDeviceCoordinator(DataUpdateCoordinator[list[OasisDevice]]):
|
|||||||
|
|
||||||
except UpdateFailed:
|
except UpdateFailed:
|
||||||
raise
|
raise
|
||||||
except Exception as ex: # noqa: BLE001
|
except Exception as ex:
|
||||||
if self.attempt > 2 or not (devices or self.data):
|
if self.attempt > 2 or not (devices or self.data):
|
||||||
raise UpdateFailed(
|
raise UpdateFailed(
|
||||||
"Unexpected error talking to Oasis devices "
|
"Unexpected error talking to Oasis devices "
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
[tool.ruff.flake8-unused-arguments]
|
||||||
|
ignore-variadic-names = true
|
||||||
|
|
||||||
[tool.ruff.lint.isort]
|
[tool.ruff.lint.isort]
|
||||||
force-sort-within-sections = true
|
force-sort-within-sections = true
|
||||||
known-first-party = ["homeassistant", "tests"]
|
known-first-party = ["homeassistant", "tests"]
|
||||||
@@ -7,7 +10,4 @@ split-on-trailing-comma = false
|
|||||||
|
|
||||||
[tool.pylint."MESSAGES CONTROL"]
|
[tool.pylint."MESSAGES CONTROL"]
|
||||||
# abstract-method - with intro of async there are always methods missing
|
# abstract-method - with intro of async there are always methods missing
|
||||||
disable = [
|
disable = ["abstract-method", "unexpected-keyword-arg"]
|
||||||
"abstract-method",
|
|
||||||
"unexpected-keyword-arg",
|
|
||||||
]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user