diff --git a/custom_components/oasis_mini/__init__.py b/custom_components/oasis_mini/__init__.py index 79b9bb0..7caeb10 100644 --- a/custom_components/oasis_mini/__init__.py +++ b/custom_components/oasis_mini/__init__.py @@ -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). diff --git a/custom_components/oasis_mini/coordinator.py b/custom_components/oasis_mini/coordinator.py index 702cd0e..5bbec8e 100644 --- a/custom_components/oasis_mini/coordinator.py +++ b/custom_components/oasis_mini/coordinator.py @@ -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 " diff --git a/pyproject.toml b/pyproject.toml index a033f8b..6349121 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,6 @@ +[tool.ruff.flake8-unused-arguments] +ignore-variadic-names = true + [tool.ruff.lint.isort] force-sort-within-sections = true known-first-party = ["homeassistant", "tests"] @@ -7,7 +10,4 @@ split-on-trailing-comma = false [tool.pylint."MESSAGES CONTROL"] # abstract-method - with intro of async there are always methods missing -disable = [ - "abstract-method", - "unexpected-keyword-arg", -] \ No newline at end of file +disable = ["abstract-method", "unexpected-keyword-arg"]