diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5797fe16565..d7ffd010108 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: hooks: - id: codespell args: - - --ignore-words-list=additionals,alle,alot,astroid,bund,caf,checkin,convencional,currenty,datas,farenheit,falsy,fo,frequence,haa,hass,iif,incomfort,ines,ist,lookin,nam,nd,NotIn,pres,pullrequests,resset,rime,ser,serie,te,technik,ue,unsecure,vor,withing,zar + - --ignore-words-list=astroid,checkin,currenty,hass,iif,incomfort,lookin,nam,NotIn,pres,ser,ue - --skip="./.*,*.csv,*.json,*.ambr" - --quiet-level=2 exclude_types: [csv, json, html] diff --git a/homeassistant/components/amazon_polly/const.py b/homeassistant/components/amazon_polly/const.py index 66084735c39..bb196544fc3 100644 --- a/homeassistant/components/amazon_polly/const.py +++ b/homeassistant/components/amazon_polly/const.py @@ -66,7 +66,7 @@ SUPPORTED_VOICES: Final[list[str]] = [ "Hans", # German "Hiujin", # Chinese (Cantonese), Neural "Ida", # Norwegian, Neural - "Ines", # Portuguese, European + "Ines", # Portuguese, European # codespell:ignore ines "Ivy", # English "Jacek", # Polish "Jan", # Polish diff --git a/homeassistant/components/coinbase/const.py b/homeassistant/components/coinbase/const.py index 193913e4b6f..f5c75e3f926 100644 --- a/homeassistant/components/coinbase/const.py +++ b/homeassistant/components/coinbase/const.py @@ -268,7 +268,7 @@ WALLETS = { "XTZ": "XTZ", "YER": "YER", "YFI": "YFI", - "ZAR": "ZAR", + "ZAR": "ZAR", # codespell:ignore zar "ZEC": "ZEC", "ZMW": "ZMW", "ZRX": "ZRX", @@ -590,7 +590,7 @@ RATES = { "YER": "YER", "YFI": "YFI", "YFII": "YFII", - "ZAR": "ZAR", + "ZAR": "ZAR", # codespell:ignore zar "ZEC": "ZEC", "ZEN": "ZEN", "ZMW": "ZMW", diff --git a/homeassistant/components/dwd_weather_warnings/sensor.py b/homeassistant/components/dwd_weather_warnings/sensor.py index cef665ffb10..4f1b64a5b44 100644 --- a/homeassistant/components/dwd_weather_warnings/sensor.py +++ b/homeassistant/components/dwd_weather_warnings/sensor.py @@ -3,9 +3,9 @@ Data is fetched from DWD: https://rcccm.dwd.de/DE/wetter/warnungen_aktuell/objekt_einbindung/objekteinbindung.html -Warnungen vor extremem Unwetter (Stufe 4) +Warnungen vor extremem Unwetter (Stufe 4) # codespell:ignore vor Unwetterwarnungen (Stufe 3) -Warnungen vor markantem Wetter (Stufe 2) +Warnungen vor markantem Wetter (Stufe 2) # codespell:ignore vor Wetterwarnungen (Stufe 1) """ diff --git a/homeassistant/components/ecowitt/diagnostics.py b/homeassistant/components/ecowitt/diagnostics.py index db7d2e0989d..a21d11e8126 100644 --- a/homeassistant/components/ecowitt/diagnostics.py +++ b/homeassistant/components/ecowitt/diagnostics.py @@ -26,7 +26,7 @@ async def async_get_device_diagnostics( "device": { "name": station.station, "model": station.model, - "frequency": station.frequence, + "frequency": station.frequence, # codespell:ignore frequence "version": station.version, }, "raw": ecowitt.last_values[station_id], diff --git a/homeassistant/components/fibaro/lock.py b/homeassistant/components/fibaro/lock.py index 271e3981b71..faa82815b8d 100644 --- a/homeassistant/components/fibaro/lock.py +++ b/homeassistant/components/fibaro/lock.py @@ -44,7 +44,7 @@ class FibaroLock(FibaroDevice, LockEntity): def unlock(self, **kwargs: Any) -> None: """Unlock the device.""" - self.action("unsecure") + self.action("unsecure") # codespell:ignore unsecure self._attr_is_locked = False def update(self) -> None: diff --git a/homeassistant/components/freebox/switch.py b/homeassistant/components/freebox/switch.py index 3ffa80429e8..96c3bcc2496 100644 --- a/homeassistant/components/freebox/switch.py +++ b/homeassistant/components/freebox/switch.py @@ -72,5 +72,5 @@ class FreeboxSwitch(SwitchEntity): async def async_update(self) -> None: """Get the state and update it.""" - datas = await self._router.wifi.get_global_config() - self._attr_is_on = bool(datas["enabled"]) + data = await self._router.wifi.get_global_config() + self._attr_is_on = bool(data["enabled"]) diff --git a/homeassistant/components/google_assistant_sdk/notify.py b/homeassistant/components/google_assistant_sdk/notify.py index 3f01cef2ebc..8ea3d37d5b6 100644 --- a/homeassistant/components/google_assistant_sdk/notify.py +++ b/homeassistant/components/google_assistant_sdk/notify.py @@ -15,7 +15,10 @@ from .helpers import async_send_text_commands, default_language_code # https://support.google.com/assistant/answer/9071582?hl=en LANG_TO_BROADCAST_COMMAND = { "en": ("broadcast {0}", "broadcast to {1} {0}"), - "de": ("Nachricht an alle {0}", "Nachricht an alle an {1} {0}"), + "de": ( + "Nachricht an alle {0}", # codespell:ignore alle + "Nachricht an alle an {1} {0}", # codespell:ignore alle + ), "es": ("Anuncia {0}", "Anuncia en {1} {0}"), "fr": ("Diffuse {0}", "Diffuse dans {1} {0}"), "it": ("Trasmetti {0}", "Trasmetti in {1} {0}"), diff --git a/homeassistant/components/google_translate/const.py b/homeassistant/components/google_translate/const.py index 68d8208f26b..ed9709d2811 100644 --- a/homeassistant/components/google_translate/const.py +++ b/homeassistant/components/google_translate/const.py @@ -81,7 +81,7 @@ SUPPORT_LANGUAGES = [ "sv", "sw", "ta", - "te", + "te", # codespell:ignore te "th", "tl", "tr", diff --git a/homeassistant/components/google_travel_time/const.py b/homeassistant/components/google_travel_time/const.py index 7e086640e2b..046e52095c0 100644 --- a/homeassistant/components/google_travel_time/const.py +++ b/homeassistant/components/google_travel_time/const.py @@ -67,7 +67,7 @@ ALL_LANGUAGES = [ "sr", "sv", "ta", - "te", + "te", # codespell:ignore te "th", "tl", "tr", diff --git a/homeassistant/components/homekit_controller/button.py b/homeassistant/components/homekit_controller/button.py index abd00f02aa0..ac2133f61ca 100644 --- a/homeassistant/components/homekit_controller/button.py +++ b/homeassistant/components/homekit_controller/button.py @@ -44,14 +44,14 @@ BUTTON_ENTITIES: dict[str, HomeKitButtonEntityDescription] = { name="Setup", translation_key="setup", entity_category=EntityCategory.CONFIG, - write_value="#HAA@trcmd", + write_value="#HAA@trcmd", # codespell:ignore haa ), CharacteristicsTypes.VENDOR_HAA_UPDATE: HomeKitButtonEntityDescription( key=CharacteristicsTypes.VENDOR_HAA_UPDATE, name="Update", device_class=ButtonDeviceClass.UPDATE, entity_category=EntityCategory.CONFIG, - write_value="#HAA@trcmd", + write_value="#HAA@trcmd", # codespell:ignore haa ), CharacteristicsTypes.IDENTIFY: HomeKitButtonEntityDescription( key=CharacteristicsTypes.IDENTIFY, diff --git a/homeassistant/components/huawei_lte/sensor.py b/homeassistant/components/huawei_lte/sensor.py index 5c5f7fc8b8e..d0df4c33906 100644 --- a/homeassistant/components/huawei_lte/sensor.py +++ b/homeassistant/components/huawei_lte/sensor.py @@ -303,7 +303,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = { key="rsrp", translation_key="rsrp", device_class=SensorDeviceClass.SIGNAL_STRENGTH, - # http://www.lte-anbieter.info/technik/rsrp.php + # http://www.lte-anbieter.info/technik/rsrp.php # codespell:ignore technik icon_fn=lambda x: signal_icon((-110, -95, -80), x), state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -313,7 +313,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = { key="rsrq", translation_key="rsrq", device_class=SensorDeviceClass.SIGNAL_STRENGTH, - # http://www.lte-anbieter.info/technik/rsrq.php + # http://www.lte-anbieter.info/technik/rsrq.php # codespell:ignore technik icon_fn=lambda x: signal_icon((-11, -8, -5), x), state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -333,7 +333,7 @@ SENSOR_META: dict[str, HuaweiSensorGroup] = { key="sinr", translation_key="sinr", device_class=SensorDeviceClass.SIGNAL_STRENGTH, - # http://www.lte-anbieter.info/technik/sinr.php + # http://www.lte-anbieter.info/technik/sinr.php # codespell:ignore technik icon_fn=lambda x: signal_icon((0, 5, 10), x), state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, diff --git a/homeassistant/components/isy994/switch.py b/homeassistant/components/isy994/switch.py index 391ad18e02f..c05bd2ddbbb 100644 --- a/homeassistant/components/isy994/switch.py +++ b/homeassistant/components/isy994/switch.py @@ -34,7 +34,7 @@ from .models import IsyData @dataclass(frozen=True) class ISYSwitchEntityDescription(SwitchEntityDescription): - """Describes IST switch.""" + """Describes ISY switch.""" # ISYEnableSwitchEntity does not support UNDEFINED or None, # restrict the type to str. diff --git a/homeassistant/components/jellyfin/media_source.py b/homeassistant/components/jellyfin/media_source.py index a9eba7dc3a4..8901e9e32c0 100644 --- a/homeassistant/components/jellyfin/media_source.py +++ b/homeassistant/components/jellyfin/media_source.py @@ -396,7 +396,7 @@ class JellyfinSource(MediaSource): k.get(ITEM_KEY_NAME), ), ) - return [await self._build_series(serie, False) for serie in series] + return [await self._build_series(s, False) for s in series] async def _build_series( self, series: dict[str, Any], include_children: bool diff --git a/homeassistant/components/jewish_calendar/sensor.py b/homeassistant/components/jewish_calendar/sensor.py index bdfee08aa08..edbc7bf0c22 100644 --- a/homeassistant/components/jewish_calendar/sensor.py +++ b/homeassistant/components/jewish_calendar/sensor.py @@ -56,7 +56,7 @@ INFO_SENSORS = ( TIME_SENSORS = ( SensorEntityDescription( key="first_light", - name="Alot Hashachar", + name="Alot Hashachar", # codespell:ignore alot icon="mdi:weather-sunset-up", ), SensorEntityDescription( diff --git a/homeassistant/components/open_meteo/const.py b/homeassistant/components/open_meteo/const.py index e83fad9d59f..09ceba06b62 100644 --- a/homeassistant/components/open_meteo/const.py +++ b/homeassistant/components/open_meteo/const.py @@ -31,7 +31,7 @@ WMO_TO_HA_CONDITION_MAP = { 2: ATTR_CONDITION_PARTLYCLOUDY, # Partly cloudy 3: ATTR_CONDITION_CLOUDY, # Overcast 45: ATTR_CONDITION_FOG, # Fog - 48: ATTR_CONDITION_FOG, # Depositing rime fog + 48: ATTR_CONDITION_FOG, # Depositing rime fog # codespell:ignore rime 51: ATTR_CONDITION_RAINY, # Drizzle: Light intensity 53: ATTR_CONDITION_RAINY, # Drizzle: Moderate intensity 55: ATTR_CONDITION_RAINY, # Drizzle: Dense intensity diff --git a/homeassistant/components/roomba/__init__.py b/homeassistant/components/roomba/__init__.py index d00010aa3e9..f811a2afe03 100644 --- a/homeassistant/components/roomba/__init__.py +++ b/homeassistant/components/roomba/__init__.py @@ -83,7 +83,7 @@ async def async_connect_or_timeout( _LOGGER.debug("Initialize connection to vacuum") await hass.async_add_executor_job(roomba.connect) while not roomba.roomba_connected or name is None: - # Waiting for connection and check datas ready + # Waiting for connection and check data is ready name = roomba_reported_state(roomba).get("name", None) if name: break diff --git a/homeassistant/components/solaredge_local/sensor.py b/homeassistant/components/solaredge_local/sensor.py index 2799d303a19..ae009410692 100644 --- a/homeassistant/components/solaredge_local/sensor.py +++ b/homeassistant/components/solaredge_local/sensor.py @@ -232,7 +232,9 @@ def setup_platform( # Changing inverter temperature unit. inverter_temp_description = SENSOR_TYPE_INVERTER_TEMPERATURE - if status.inverters.primary.temperature.units.farenheit: + if ( + status.inverters.primary.temperature.units.farenheit # codespell:ignore farenheit + ): inverter_temp_description = dataclasses.replace( inverter_temp_description, native_unit_of_measurement=UnitOfTemperature.FAHRENHEIT, diff --git a/homeassistant/components/voicerss/tts.py b/homeassistant/components/voicerss/tts.py index 581f4090657..84bbcc19409 100644 --- a/homeassistant/components/voicerss/tts.py +++ b/homeassistant/components/voicerss/tts.py @@ -80,7 +80,7 @@ SUPPORT_LANGUAGES = [ "vi-vn", ] -SUPPORT_CODECS = ["mp3", "wav", "aac", "ogg", "caf"] +SUPPORT_CODECS = ["mp3", "wav", "aac", "ogg", "caf"] # codespell:ignore caf SUPPORT_FORMATS = [ "8khz_8bit_mono", diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index d67e9b406c4..541626cf86d 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -2402,8 +2402,9 @@ def base64_decode(value): def ordinal(value): """Perform ordinal conversion.""" + suffixes = ["th", "st", "nd", "rd"] + ["th"] * 6 # codespell:ignore nd return str(value) + ( - list(["th", "st", "nd", "rd"] + ["th"] * 6)[(int(str(value)[-1])) % 10] + suffixes[(int(str(value)[-1])) % 10] if int(str(value)[-2:]) % 100 not in range(11, 14) else "th" ) diff --git a/tests/components/aemet/util.py b/tests/components/aemet/util.py index e6c468ec5fa..bb8885f7b4c 100644 --- a/tests/components/aemet/util.py +++ b/tests/components/aemet/util.py @@ -42,9 +42,12 @@ def mock_api_call(cmd: str, fetch_data: bool = False) -> dict[str, Any]: return TOWN_DATA_MOCK if cmd == "maestro/municipios": return TOWNS_DATA_MOCK - if cmd == "observacion/convencional/datos/estacion/3195": + if ( + cmd + == "observacion/convencional/datos/estacion/3195" # codespell:ignore convencional + ): return STATION_DATA_MOCK - if cmd == "observacion/convencional/todas": + if cmd == "observacion/convencional/todas": # codespell:ignore convencional return STATIONS_DATA_MOCK if cmd == "prediccion/especifica/municipio/diaria/28065": return FORECAST_DAILY_DATA_MOCK diff --git a/tests/components/assist_pipeline/__init__.py b/tests/components/assist_pipeline/__init__.py index 7400fe32d70..dd0f80e52ad 100644 --- a/tests/components/assist_pipeline/__init__.py +++ b/tests/components/assist_pipeline/__init__.py @@ -45,7 +45,7 @@ MANY_LANGUAGES = [ "sr", "sv", "sw", - "te", + "te", # codespell:ignore te "tr", "uk", "ur", diff --git a/tests/components/cloud/test_strict_connection.py b/tests/components/cloud/test_strict_connection.py index f275bc4d2dd..2205e785a7a 100644 --- a/tests/components/cloud/test_strict_connection.py +++ b/tests/components/cloud/test_strict_connection.py @@ -281,8 +281,8 @@ async def test_strict_connection_cloud_external_unauthenticated_requests( async def _modify_cookie_for_cloud(client: TestClient, token_type: str) -> str: """Modify cookie for cloud.""" - # Cloud cookie has set secure=true and will not set on unsecure connection - # As we test with unsecure connection, we need to set it manually + # Cloud cookie has set secure=true and will not set on insecure connection + # As we test with insecure connection, we need to set it manually # We get the session via http and modify the cookie name to the secure one session_id = await (await client.get(f"/test/cookie?token={token_type}")).text() cookie_jar = client.session.cookie_jar diff --git a/tests/components/homekit_controller/test_button.py b/tests/components/homekit_controller/test_button.py index 0d76ac98fbe..9f935569333 100644 --- a/tests/components/homekit_controller/test_button.py +++ b/tests/components/homekit_controller/test_button.py @@ -61,7 +61,7 @@ async def test_press_button(hass: HomeAssistant) -> None: button.async_assert_service_values( ServicesTypes.OUTLET, { - CharacteristicsTypes.VENDOR_HAA_SETUP: "#HAA@trcmd", + CharacteristicsTypes.VENDOR_HAA_SETUP: "#HAA@trcmd", # codespell:ignore haa }, ) diff --git a/tests/components/hvv_departures/test_config_flow.py b/tests/components/hvv_departures/test_config_flow.py index d9545b903c1..c85bfb7f6ee 100644 --- a/tests/components/hvv_departures/test_config_flow.py +++ b/tests/components/hvv_departures/test_config_flow.py @@ -144,7 +144,7 @@ async def test_user_flow_invalid_auth(hass: HomeAssistant) -> None: "homeassistant.components.hvv_departures.hub.GTI.init", side_effect=InvalidAuth( "ERROR_TEXT", - "Bei der Verarbeitung der Anfrage ist ein technisches Problem aufgetreten.", + "Bei der Verarbeitung der Anfrage ist ein technisches Problem aufgetreten.", # codespell:ignore ist "Authentication failed!", ), ): @@ -343,7 +343,7 @@ async def test_options_flow_invalid_auth(hass: HomeAssistant) -> None: "homeassistant.components.hvv_departures.hub.GTI.departureList", side_effect=InvalidAuth( "ERROR_TEXT", - "Bei der Verarbeitung der Anfrage ist ein technisches Problem aufgetreten.", + "Bei der Verarbeitung der Anfrage ist ein technisches Problem aufgetreten.", # codespell:ignore ist "Authentication failed!", ), ): diff --git a/tests/components/nina/__init__.py b/tests/components/nina/__init__.py index 923df6b6337..702bd78715b 100644 --- a/tests/components/nina/__init__.py +++ b/tests/components/nina/__init__.py @@ -24,20 +24,24 @@ def mocked_request_function(url: str) -> dict[str, Any]: load_fixture("sample_labels.json", "nina") ) - if "https://warnung.bund.de/api31/dashboard/" in url: + if "https://warnung.bund.de/api31/dashboard/" in url: # codespell:ignore bund return dummy_response - if "https://warnung.bund.de/api/appdata/gsb/labels/de_labels.json" in url: + if ( + "https://warnung.bund.de/api/appdata/gsb/labels/de_labels.json" # codespell:ignore bund + in url + ): return dummy_response_labels if ( url - == "https://www.xrepository.de/api/xrepository/urn:de:bund:destatis:bevoelkerungsstatistik:schluessel:rs_2021-07-31/download/Regionalschl_ssel_2021-07-31.json" + == "https://www.xrepository.de/api/xrepository/urn:de:bund:destatis:bevoelkerungsstatistik:schluessel:rs_2021-07-31/download/Regionalschl_ssel_2021-07-31.json" # codespell:ignore bund ): return dummy_response_regions - warning_id = url.replace("https://warnung.bund.de/api31/warnings/", "").replace( - ".json", "" - ) + warning_id = url.replace( + "https://warnung.bund.de/api31/warnings/", # codespell:ignore bund + "", + ).replace(".json", "") return dummy_response_details[warning_id] diff --git a/tests/components/simplisafe/test_diagnostics.py b/tests/components/simplisafe/test_diagnostics.py index e6a9d70b164..6948f98b159 100644 --- a/tests/components/simplisafe/test_diagnostics.py +++ b/tests/components/simplisafe/test_diagnostics.py @@ -246,7 +246,7 @@ async def test_entry_diagnostics( "battery": [], "dbm": 0, "vmUse": 161592, - "resSet": 10540, + "resSet": 10540, # codespell:ignore resset "uptime": 810043.74, "wifiDisconnects": 1, "wifiDriverReloads": 1,