From bcd9f23cfdf3eb9b9841863dee29ada57abc5155 Mon Sep 17 00:00:00 2001 From: Erwin Douna Date: Fri, 9 Oct 2026 15:11:30 +0200 Subject: [PATCH] Remove duplicate error logs (batch 1) (#185443) --- homeassistant/components/airos/coordinator.py | 6 ----- .../components/ambient_station/__init__.py | 2 -- .../components/aprilaire/__init__.py | 9 +------ homeassistant/components/awair/coordinator.py | 2 -- homeassistant/components/balboa/__init__.py | 8 ++---- homeassistant/components/canary/__init__.py | 5 ---- .../components/cielo_home/climate.py | 6 ----- homeassistant/components/control4/__init__.py | 23 +++------------- .../components/crownstone/entry_manager.py | 6 ++--- .../components/crownstone/strings.json | 3 +++ homeassistant/components/deako/__init__.py | 6 ----- .../components/denon_rs232/__init__.py | 10 ++++--- .../components/denon_rs232/strings.json | 3 +++ homeassistant/components/duco/fan.py | 5 ---- homeassistant/components/duco/number.py | 8 ------ homeassistant/components/duco/select.py | 5 ---- homeassistant/components/duco/switch.py | 5 ---- homeassistant/components/dynalite/__init__.py | 4 +-- .../components/ecoforest/__init__.py | 8 +++--- .../components/ecoforest/strings.json | 3 +++ homeassistant/components/econet/__init__.py | 5 ---- homeassistant/components/elevenlabs/tts.py | 8 ------ tests/components/duco/test_fan.py | 26 ------------------- 23 files changed, 30 insertions(+), 136 deletions(-) diff --git a/homeassistant/components/airos/coordinator.py b/homeassistant/components/airos/coordinator.py index a90427338991..c601ddb8a09f 100644 --- a/homeassistant/components/airos/coordinator.py +++ b/homeassistant/components/airos/coordinator.py @@ -53,8 +53,6 @@ async def async_fetch_airos_data( await airos_device.login() return await update_method() except AirOSConnectionAuthenticationError as err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.exception("Error authenticating with airOS device") raise ConfigEntryAuthFailed( translation_domain=DOMAIN, translation_key="invalid_auth" ) from err @@ -63,15 +61,11 @@ async def async_fetch_airos_data( AirOSDeviceConnectionError, TimeoutError, ) as err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error("Error connecting to airOS device: %s", err) raise UpdateFailed( translation_domain=DOMAIN, translation_key="cannot_connect", ) from err except AirOSDataMissingError as err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error("Expected data not returned by airOS device: %s", err) raise UpdateFailed( translation_domain=DOMAIN, translation_key="error_data_missing", diff --git a/homeassistant/components/ambient_station/__init__.py b/homeassistant/components/ambient_station/__init__.py index 78d022d9b8b8..b8a004dcf2ad 100644 --- a/homeassistant/components/ambient_station/__init__.py +++ b/homeassistant/components/ambient_station/__init__.py @@ -69,8 +69,6 @@ async def async_setup_entry( try: await ambient.ws_connect() except WebsocketError as err: - # pylint: disable-next=home-assistant-log-and-raise - LOGGER.error("Config entry failed: %s", err) raise ConfigEntryNotReady from err entry.runtime_data = ambient diff --git a/homeassistant/components/aprilaire/__init__.py b/homeassistant/components/aprilaire/__init__.py index 8f84c709b549..490163b52c1e 100644 --- a/homeassistant/components/aprilaire/__init__.py +++ b/homeassistant/components/aprilaire/__init__.py @@ -1,7 +1,5 @@ """The Aprilaire integration.""" -import logging - from pyaprilaire.const import Attribute from homeassistant.const import CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP, Platform @@ -18,8 +16,6 @@ PLATFORMS: list[Platform] = [ Platform.SENSOR, ] -_LOGGER = logging.getLogger(__name__) - async def async_setup_entry(hass: HomeAssistant, entry: AprilaireConfigEntry) -> bool: """Set up a config entry for Aprilaire.""" @@ -49,12 +45,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: AprilaireConfigEntry) -> hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_close) ) else: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error("Failed to wait for ready") - coordinator.stop_listen() - raise ConfigEntryNotReady + raise ConfigEntryNotReady("Failed to wait for ready") await coordinator.wait_for_ready(ready_callback) diff --git a/homeassistant/components/awair/coordinator.py b/homeassistant/components/awair/coordinator.py index 8b4418a75efd..398faf2ef2a8 100644 --- a/homeassistant/components/awair/coordinator.py +++ b/homeassistant/components/awair/coordinator.py @@ -128,7 +128,5 @@ class AwairLocalDataUpdateCoordinator(AwairDataUpdateCoordinator): self._device = devices[0] result = await self._fetch_air_data(self._device) except AwairError as err: - # pylint: disable-next=home-assistant-log-and-raise - LOGGER.error("Unexpected API error: %s", err) raise UpdateFailed(err) from err return {result.device.uuid: result} diff --git a/homeassistant/components/balboa/__init__.py b/homeassistant/components/balboa/__init__.py index c35dea4b9098..5b9574650c78 100644 --- a/homeassistant/components/balboa/__init__.py +++ b/homeassistant/components/balboa/__init__.py @@ -40,13 +40,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: BalboaConfigEntry) -> bo _LOGGER.debug("Attempting to connect to %s", host) spa = SpaClient(host) if not await spa.connect(): - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error("Failed to connect to spa at %s", host) - raise ConfigEntryNotReady("Unable to connect") + raise ConfigEntryNotReady(f"Failed to connect to spa at {host}") if not await spa.async_configuration_loaded(): - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error("Failed to get spa info at %s", host) - raise ConfigEntryNotReady("Unable to configure") + raise ConfigEntryNotReady(f"Failed to get spa info at {host}") entry.runtime_data = spa diff --git a/homeassistant/components/canary/__init__.py b/homeassistant/components/canary/__init__.py index e25a4cb25eeb..d384171d2e57 100644 --- a/homeassistant/components/canary/__init__.py +++ b/homeassistant/components/canary/__init__.py @@ -1,7 +1,6 @@ """Support for Canary devices.""" from datetime import timedelta -import logging from typing import Final from canary.api import Api @@ -14,8 +13,6 @@ from homeassistant.exceptions import ConfigEntryNotReady from .const import CONF_FFMPEG_ARGUMENTS, DEFAULT_FFMPEG_ARGUMENTS, DEFAULT_TIMEOUT from .coordinator import CanaryConfigEntry, CanaryDataUpdateCoordinator -_LOGGER: Final = logging.getLogger(__name__) - MIN_TIME_BETWEEN_UPDATES: Final = timedelta(seconds=30) PLATFORMS: Final[list[Platform]] = [ @@ -39,8 +36,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: CanaryConfigEntry) -> bo try: canary_api = await hass.async_add_executor_job(_get_canary_api_instance, entry) except (ConnectTimeout, HTTPError) as error: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error("Unable to connect to Canary service: %s", str(error)) raise ConfigEntryNotReady from error coordinator = CanaryDataUpdateCoordinator(hass, entry, api=canary_api) diff --git a/homeassistant/components/cielo_home/climate.py b/homeassistant/components/cielo_home/climate.py index b22c3f5d8283..526929161c7f 100644 --- a/homeassistant/components/cielo_home/climate.py +++ b/homeassistant/components/cielo_home/climate.py @@ -75,12 +75,6 @@ def async_handle_api_call[_T: CieloDeviceEntity, **_P]( ) if not isinstance(res, dict): - # pylint: disable-next=home-assistant-log-and-raise - LOGGER.error( - "API function did not return a dictionary for entity %s, got %s", - entity.entity_id, - type(res), - ) raise HomeAssistantError("Invalid API response format") data: dict[str, Any] | None = res.get("data") diff --git a/homeassistant/components/control4/__init__.py b/homeassistant/components/control4/__init__.py index ad0c801f60a2..fd559d410ed3 100644 --- a/homeassistant/components/control4/__init__.py +++ b/homeassistant/components/control4/__init__.py @@ -66,14 +66,9 @@ async def call_c4_api_retry(func, *func_args): ) exc = exception - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error( - "Failed to connect to Control4 account API after %d attempts: %s", - API_RETRY_TIMES, - exc, - ) raise ConfigEntryNotReady( - f"Failed to connect to Control4 account API after {API_RETRY_TIMES} attempts" + "Failed to connect to Control4 account API after" + f" {API_RETRY_TIMES} attempts: {exc}" ) from exc @@ -86,10 +81,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: Control4ConfigEntry) -> try: await account.get_account_bearer_token() except client_exceptions.ClientError as exception: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error("Error connecting to Control4 account API: %s", exception) raise ConfigEntryNotReady( - "Error connecting to Control4 account API to get bearer token" + f"Error connecting to Control4 account API to get bearer token: {exception}" ) from exception except BadCredentials as exception: raise ConfigEntryError( @@ -131,11 +124,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: Control4ConfigEntry) -> try: director_all_items: list[dict[str, Any]] = await director.get_all_item_info() except (TimeoutError, client_exceptions.ClientError) as err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error( - "Timeout connecting to Control4 controller at %s", - config[CONF_HOST], - ) raise ConfigEntryNotReady( f"Timeout connecting to Control4 controller at {config[CONF_HOST]}" ) from err @@ -146,11 +134,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: Control4ConfigEntry) -> try: ui_configuration = await director.get_ui_configuration() except (TimeoutError, client_exceptions.ClientError) as err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error( - "Timeout getting UI configuration from Control4 controller at %s", - config[CONF_HOST], - ) raise ConfigEntryNotReady( "Timeout getting UI configuration from" f" Control4 controller at {config[CONF_HOST]}" diff --git a/homeassistant/components/crownstone/entry_manager.py b/homeassistant/components/crownstone/entry_manager.py index ec830e406ec0..4a3d3267901e 100644 --- a/homeassistant/components/crownstone/entry_manager.py +++ b/homeassistant/components/crownstone/entry_manager.py @@ -76,9 +76,9 @@ class CrownstoneEntryManager: ) return False except CrownstoneUnknownError as unknown_err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error("Unknown error during login") - raise ConfigEntryNotReady from unknown_err + raise ConfigEntryNotReady( + translation_domain=DOMAIN, translation_key="unknown_login_error" + ) from unknown_err # A new clientsession is created because the default # one does not cleanup on unload diff --git a/homeassistant/components/crownstone/strings.json b/homeassistant/components/crownstone/strings.json index a005149424ef..3d96bee34b47 100644 --- a/homeassistant/components/crownstone/strings.json +++ b/homeassistant/components/crownstone/strings.json @@ -44,6 +44,9 @@ "exceptions": { "authentication_failed": { "message": "Authentication with the Crownstone cloud failed" + }, + "unknown_login_error": { + "message": "Unknown error during login with the Crownstone cloud" } }, "options": { diff --git a/homeassistant/components/deako/__init__.py b/homeassistant/components/deako/__init__.py index 6868e51280ae..35542722d207 100644 --- a/homeassistant/components/deako/__init__.py +++ b/homeassistant/components/deako/__init__.py @@ -1,7 +1,5 @@ """The deako integration.""" -import logging - from pydeako import Deako, DeakoDiscoverer, FindDevicesError from homeassistant.components import zeroconf @@ -10,8 +8,6 @@ from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady -_LOGGER: logging.Logger = logging.getLogger(__name__) - PLATFORMS: list[Platform] = [Platform.LIGHT] type DeakoConfigEntry = ConfigEntry[Deako] @@ -28,8 +24,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: DeakoConfigEntry) -> boo try: await connection.find_devices() except FindDevicesError as exc: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.warning("Error finding devices: %s", exc) await connection.disconnect() raise ConfigEntryNotReady(exc) from exc diff --git a/homeassistant/components/denon_rs232/__init__.py b/homeassistant/components/denon_rs232/__init__.py index f7241f58c3a9..7ffb38f59dcb 100644 --- a/homeassistant/components/denon_rs232/__init__.py +++ b/homeassistant/components/denon_rs232/__init__.py @@ -8,7 +8,7 @@ from homeassistant.const import CONF_DEVICE, CONF_MODEL, Platform from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import ConfigEntryNotReady -from .const import LOGGER, DenonRS232ConfigEntry +from .const import DOMAIN, LOGGER, DenonRS232ConfigEntry PLATFORMS = [Platform.MEDIA_PLAYER] @@ -23,11 +23,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: DenonRS232ConfigEntry) - await receiver.connect() await receiver.query_state() except (ConnectionError, OSError, TimeoutError) as err: - # pylint: disable-next=home-assistant-log-and-raise - LOGGER.error("Error connecting to Denon receiver at %s: %s", port, err) if receiver.connected: await receiver.disconnect() - raise ConfigEntryNotReady from err + raise ConfigEntryNotReady( + translation_domain=DOMAIN, + translation_key="cannot_connect", + translation_placeholders={"port": port}, + ) from err entry.runtime_data = receiver diff --git a/homeassistant/components/denon_rs232/strings.json b/homeassistant/components/denon_rs232/strings.json index af70480b75eb..2035325ba589 100644 --- a/homeassistant/components/denon_rs232/strings.json +++ b/homeassistant/components/denon_rs232/strings.json @@ -75,6 +75,9 @@ } }, "exceptions": { + "cannot_connect": { + "message": "Error connecting to Denon receiver at {port}" + }, "invalid_tuner_channel": { "message": "{media_id} is not a valid tuner preset (A1-G8) or FM frequency in hundredths of MHz (8750-10800; for example, 9930 for 99.30 MHz)." }, diff --git a/homeassistant/components/duco/fan.py b/homeassistant/components/duco/fan.py index a578229ce30b..ce477f5d4d43 100644 --- a/homeassistant/components/duco/fan.py +++ b/homeassistant/components/duco/fan.py @@ -1,6 +1,5 @@ """Fan platform for the Duco integration.""" -import logging from typing import override from duco_connectivity.exceptions import DucoError, DucoRateLimitError @@ -16,8 +15,6 @@ from .const import BOX_NODE_ID, DOMAIN from .coordinator import DucoConfigEntry, DucoCoordinator from .entity import DucoEntity -_LOGGER = logging.getLogger(__name__) - PARALLEL_UPDATES = 1 # Permanent speed states ordered low → high. @@ -132,8 +129,6 @@ class DucoVentilationFanEntity(DucoEntity, FanEntity): try: await self.coordinator.async_set_ventilation_state(self._node_id, state) except DucoRateLimitError as err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.warning("Duco write rate limit exceeded for node %s", self._node_id) raise HomeAssistantError( translation_domain=DOMAIN, translation_key="rate_limit_exceeded", diff --git a/homeassistant/components/duco/number.py b/homeassistant/components/duco/number.py index e947e7441919..131791520405 100644 --- a/homeassistant/components/duco/number.py +++ b/homeassistant/components/duco/number.py @@ -1,7 +1,6 @@ """Number platform for the Duco integration.""" from dataclasses import replace -import logging from typing import override from duco_connectivity import DucoError, DucoRateLimitError @@ -21,8 +20,6 @@ from .const import BOX_NODE_ID, DOMAIN from .coordinator import DucoConfigEntry, DucoCoordinator from .entity import DucoEntity -_LOGGER = logging.getLogger(__name__) - PARALLEL_UPDATES = 1 @@ -147,11 +144,6 @@ class DucoBypassSupplyTemperatureTargetNumber(DucoEntity, NumberEntity): }, ) from err except DucoRateLimitError as err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.warning( - "Duco write rate limit exceeded for bypass target zone %s", - self._zone_id, - ) raise HomeAssistantError( translation_domain=DOMAIN, translation_key="rate_limit_exceeded", diff --git a/homeassistant/components/duco/select.py b/homeassistant/components/duco/select.py index e416459e7342..022feff099a1 100644 --- a/homeassistant/components/duco/select.py +++ b/homeassistant/components/duco/select.py @@ -1,6 +1,5 @@ """Select platform for the Duco integration.""" -import logging from typing import override from duco_connectivity import ( @@ -23,8 +22,6 @@ from .coordinator import DucoConfigEntry, DucoCoordinator from .entity import DucoEntity from .helpers import remove_stale_node_ids -_LOGGER = logging.getLogger(__name__) - PARALLEL_UPDATES = 1 @@ -133,8 +130,6 @@ class DucoVentilationStateSelect(DucoEntity, SelectEntity): # through keeps newly added Duco states forward-compatible. await self.coordinator.async_set_ventilation_state(self._node_id, option) except DucoRateLimitError as err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.warning("Duco write rate limit exceeded for node %s", self._node_id) raise HomeAssistantError( translation_domain=DOMAIN, translation_key="rate_limit_exceeded", diff --git a/homeassistant/components/duco/switch.py b/homeassistant/components/duco/switch.py index 417b28d06b29..2e68758795b9 100644 --- a/homeassistant/components/duco/switch.py +++ b/homeassistant/components/duco/switch.py @@ -1,6 +1,5 @@ """Switch platform for the Duco integration.""" -import logging from typing import Any, override from duco_connectivity import ( @@ -23,8 +22,6 @@ from .coordinator import DucoConfigEntry, DucoCoordinator from .entity import DucoEntity from .helpers import remove_stale_node_ids -_LOGGER = logging.getLogger(__name__) - PARALLEL_UPDATES = 1 @@ -103,8 +100,6 @@ class DucoIdentifySwitch(DucoEntity, SwitchEntity): try: await self.coordinator.async_set_node_identify(self._node_id, identify) except DucoRateLimitError as err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.warning("Duco write rate limit exceeded for node %s", self._node_id) raise HomeAssistantError( translation_domain=DOMAIN, translation_key="rate_limit_exceeded", diff --git a/homeassistant/components/dynalite/__init__.py b/homeassistant/components/dynalite/__init__.py index 86d30ec409c1..e9e6a2f7fbd9 100644 --- a/homeassistant/components/dynalite/__init__.py +++ b/homeassistant/components/dynalite/__init__.py @@ -40,9 +40,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: DynaliteConfigEntry) -> bridge = DynaliteBridge(hass, convert_config(entry.data)) if not await bridge.async_setup(): - # pylint: disable-next=home-assistant-log-and-raise - LOGGER.error("Could not set up bridge for entry %s", entry.data) - raise ConfigEntryNotReady + raise ConfigEntryNotReady(f"Could not set up bridge at {bridge.host}") entry.runtime_data = bridge entry.async_on_unload(entry.add_update_listener(async_entry_changed)) diff --git a/homeassistant/components/ecoforest/__init__.py b/homeassistant/components/ecoforest/__init__.py index b49a7d88282c..9eceea764aee 100644 --- a/homeassistant/components/ecoforest/__init__.py +++ b/homeassistant/components/ecoforest/__init__.py @@ -38,9 +38,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: EcoforestConfigEntry) -> translation_placeholders={"host": host}, ) from err except EcoforestConnectionError as err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error("Error communicating with device %s", host) - raise ConfigEntryNotReady from err + raise ConfigEntryNotReady( + translation_domain=DOMAIN, + translation_key="cannot_connect", + translation_placeholders={"host": host}, + ) from err coordinator = EcoforestCoordinator(hass, entry, api) diff --git a/homeassistant/components/ecoforest/strings.json b/homeassistant/components/ecoforest/strings.json index 6d79b45e3934..49f300300348 100644 --- a/homeassistant/components/ecoforest/strings.json +++ b/homeassistant/components/ecoforest/strings.json @@ -91,6 +91,9 @@ "exceptions": { "authentication_failed": { "message": "Authentication on device {host} failed" + }, + "cannot_connect": { + "message": "Error communicating with device {host}" } } } diff --git a/homeassistant/components/econet/__init__.py b/homeassistant/components/econet/__init__.py index bd6f593196e8..8966c25213fa 100644 --- a/homeassistant/components/econet/__init__.py +++ b/homeassistant/components/econet/__init__.py @@ -2,7 +2,6 @@ import asyncio from datetime import timedelta -import logging from aiohttp.client_exceptions import ClientError from pyeconet import EcoNetApiInterface @@ -23,8 +22,6 @@ from homeassistant.helpers.event import async_track_time_interval from .const import DOMAIN, PUSH_UPDATE -_LOGGER = logging.getLogger(__name__) - PLATFORMS = [ Platform.BINARY_SENSOR, Platform.CLIMATE, @@ -56,8 +53,6 @@ async def async_setup_entry( translation_key="invalid_credentials", ) from err except (ClientError, PyeconetError) as err: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.error("Config entry failed: %s", err) raise ConfigEntryNotReady from err try: diff --git a/homeassistant/components/elevenlabs/tts.py b/homeassistant/components/elevenlabs/tts.py index 17b67135cd5f..0340e420f5c5 100644 --- a/homeassistant/components/elevenlabs/tts.py +++ b/homeassistant/components/elevenlabs/tts.py @@ -158,10 +158,6 @@ class ElevenLabsTTSEntity(TextToSpeechEntity): bytes_combined = b"".join([byte_seg async for byte_seg in audio]) except ApiError as exc: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.warning( - "Error during processing of TTS request %s", exc, exc_info=True - ) raise HomeAssistantError(exc) from exc return "mp3", bytes_combined @@ -303,10 +299,6 @@ class ElevenLabsTTSEntity(TextToSpeechEntity): ) previous_request_ids.clear() except ApiError as exc: - # pylint: disable-next=home-assistant-log-and-raise - _LOGGER.warning( - "Error during processing of TTS request %s", exc, exc_info=True - ) _add_sentences_task.cancel() with contextlib.suppress(asyncio.CancelledError): await _add_sentences_task diff --git a/tests/components/duco/test_fan.py b/tests/components/duco/test_fan.py index 8a6f3561eee9..a8f15fa525eb 100644 --- a/tests/components/duco/test_fan.py +++ b/tests/components/duco/test_fan.py @@ -1,6 +1,5 @@ """Tests for the Duco fan platform.""" -import logging from unittest.mock import AsyncMock from duco_connectivity import DucoConnectionError, DucoError, DucoRateLimitError @@ -108,31 +107,6 @@ async def test_fan_set_state_error( ) -@pytest.mark.usefixtures("init_integration") -async def test_fan_set_state_rate_limit_logs_warning( - hass: HomeAssistant, - mock_duco_client: AsyncMock, - caplog: pytest.LogCaptureFixture, -) -> None: - """Test that a warning is logged when the write rate limit is exceeded.""" - mock_duco_client.async_set_ventilation_state = AsyncMock( - side_effect=DucoRateLimitError() - ) - - with ( - pytest.raises(HomeAssistantError), - caplog.at_level(logging.WARNING, logger="homeassistant.components.duco.fan"), - ): - await hass.services.async_call( - FAN_DOMAIN, - SERVICE_SET_PERCENTAGE, - {ATTR_ENTITY_ID: _FAN_ENTITY, ATTR_PERCENTAGE: 100}, - blocking=True, - ) - - assert "write rate limit exceeded" in caplog.text - - @pytest.mark.usefixtures("init_integration") async def test_coordinator_update_marks_unavailable( hass: HomeAssistant,