From 7d03b02192f3e004673d1deed6c92cdc581fb4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 11 Jun 2021 14:35:03 +0300 Subject: [PATCH] Spelling fixes (#51642) --- .../components/fireservicerota/switch.py | 2 +- .../components/fritz/binary_sensor.py | 2 +- .../components/fritzbox_callmonitor/base.py | 6 +- .../components/fritzbox_callmonitor/const.py | 2 +- .../components/fritzbox_callmonitor/sensor.py | 4 +- .../google_assistant/report_state.py | 4 +- homeassistant/components/hive/sensor.py | 2 +- .../components/home_plus_control/helpers.py | 2 +- homeassistant/components/homekit/__init__.py | 6 +- .../components/homekit/accessories.py | 6 +- homeassistant/components/homekit/const.py | 2 +- .../hunterdouglas_powerview/cover.py | 4 +- homeassistant/components/isy994/entity.py | 6 +- homeassistant/components/ps4/const.py | 2 +- homeassistant/components/unifi/sensor.py | 4 +- homeassistant/components/zeroconf/models.py | 2 +- tests/components/fritz/test_config_flow.py | 2 +- .../here_travel_time/test_sensor.py | 4 +- tests/components/homekit/test_accessories.py | 4 +- tests/components/homekit/test_aidmanager.py | 2 +- .../homekit/test_get_accessories.py | 4 +- tests/components/hyperion/test_light.py | 2 +- tests/components/influxdb/test_sensor.py | 6 +- tests/components/kraken/test_init.py | 2 +- tests/components/mikrotik/test_hub.py | 2 +- tests/components/sentry/test_config_flow.py | 2 +- tests/components/ssdp/test_init.py | 78 +++++++++---------- .../components/syncthing/test_config_flow.py | 2 +- .../transmission/test_config_flow.py | 2 +- tests/components/vera/common.py | 2 +- tests/components/wilight/__init__.py | 4 +- tests/components/wilight/test_config_flow.py | 8 +- .../xiaomi_aqara/test_config_flow.py | 4 +- tests/components/xiaomi_miio/test_vacuum.py | 12 +-- tests/components/zha/test_device.py | 2 +- tests/helpers/test_condition.py | 4 +- tests/helpers/test_frame.py | 2 +- tests/helpers/test_script.py | 18 ++--- tests/helpers/test_template.py | 2 +- tests/test_config_entries.py | 4 +- 40 files changed, 115 insertions(+), 115 deletions(-) diff --git a/homeassistant/components/fireservicerota/switch.py b/homeassistant/components/fireservicerota/switch.py index f54e3bc1fa2..454048a3737 100644 --- a/homeassistant/components/fireservicerota/switch.py +++ b/homeassistant/components/fireservicerota/switch.py @@ -98,7 +98,7 @@ class ResponseSwitch(SwitchEntity): return attr async def async_turn_on(self, **kwargs) -> None: - """Send Acknowlegde response status.""" + """Send Acknowledge response status.""" await self.async_set_response(True) async def async_turn_off(self, **kwargs) -> None: diff --git a/homeassistant/components/fritz/binary_sensor.py b/homeassistant/components/fritz/binary_sensor.py index 65780fffaa9..bc8fa204ee5 100644 --- a/homeassistant/components/fritz/binary_sensor.py +++ b/homeassistant/components/fritz/binary_sensor.py @@ -1,4 +1,4 @@ -"""AVM FRITZ!Box connectivitiy sensor.""" +"""AVM FRITZ!Box connectivity sensor.""" import logging from fritzconnection.core.exceptions import FritzConnectionException diff --git a/homeassistant/components/fritzbox_callmonitor/base.py b/homeassistant/components/fritzbox_callmonitor/base.py index af0612d7632..0db40e2098f 100644 --- a/homeassistant/components/fritzbox_callmonitor/base.py +++ b/homeassistant/components/fritzbox_callmonitor/base.py @@ -8,7 +8,7 @@ from fritzconnection.lib.fritzphonebook import FritzPhonebook from homeassistant.util import Throttle -from .const import REGEX_NUMBER, UNKOWN_NAME +from .const import REGEX_NUMBER, UNKNOWN_NAME _LOGGER = logging.getLogger(__name__) @@ -61,13 +61,13 @@ class FritzBoxPhonebook: """Return a name for a given phone number.""" number = re.sub(REGEX_NUMBER, "", str(number)) if self.number_dict is None: - return UNKOWN_NAME + return UNKNOWN_NAME if number in self.number_dict: return self.number_dict[number] if not self.prefixes: - return UNKOWN_NAME + return UNKNOWN_NAME for prefix in self.prefixes: with suppress(KeyError): diff --git a/homeassistant/components/fritzbox_callmonitor/const.py b/homeassistant/components/fritzbox_callmonitor/const.py index a71f14401b3..ba0f8d1d973 100644 --- a/homeassistant/components/fritzbox_callmonitor/const.py +++ b/homeassistant/components/fritzbox_callmonitor/const.py @@ -19,7 +19,7 @@ FRITZ_ATTR_NAME = "name" FRITZ_ATTR_SERIAL_NUMBER = "NewSerialNumber" FRITZ_SERVICE_DEVICE_INFO = "DeviceInfo" -UNKOWN_NAME = "unknown" +UNKNOWN_NAME = "unknown" SERIAL_NUMBER = "serial_number" REGEX_NUMBER = r"[^\d\+]" diff --git a/homeassistant/components/fritzbox_callmonitor/sensor.py b/homeassistant/components/fritzbox_callmonitor/sensor.py index a325c0ca71d..63b3cd81aa5 100644 --- a/homeassistant/components/fritzbox_callmonitor/sensor.py +++ b/homeassistant/components/fritzbox_callmonitor/sensor.py @@ -42,7 +42,7 @@ from .const import ( STATE_IDLE, STATE_RINGING, STATE_TALKING, - UNKOWN_NAME, + UNKNOWN_NAME, ) _LOGGER = logging.getLogger(__name__) @@ -193,7 +193,7 @@ class FritzBoxCallSensor(SensorEntity): def number_to_name(self, number): """Return a name for a given phone number.""" if self._fritzbox_phonebook is None: - return UNKOWN_NAME + return UNKNOWN_NAME return self._fritzbox_phonebook.get_name(number) def update(self): diff --git a/homeassistant/components/google_assistant/report_state.py b/homeassistant/components/google_assistant/report_state.py index f7c57732876..c3f8ba3bffd 100644 --- a/homeassistant/components/google_assistant/report_state.py +++ b/homeassistant/components/google_assistant/report_state.py @@ -106,7 +106,7 @@ def async_enable_report_state(hass: HomeAssistant, google_config: AbstractConfig """Check if the serialized data has changed.""" return old_extra_arg != new_extra_arg - async def inital_report(_now): + async def initial_report(_now): """Report initially all states.""" nonlocal unsub, checker entities = {} @@ -140,7 +140,7 @@ def async_enable_report_state(hass: HomeAssistant, google_config: AbstractConfig MATCH_ALL, async_entity_state_listener ) - unsub = async_call_later(hass, INITIAL_REPORT_DELAY, inital_report) + unsub = async_call_later(hass, INITIAL_REPORT_DELAY, initial_report) @callback def unsub_all(): diff --git a/homeassistant/components/hive/sensor.py b/homeassistant/components/hive/sensor.py index 518f3286231..f21afc51801 100644 --- a/homeassistant/components/hive/sensor.py +++ b/homeassistant/components/hive/sensor.py @@ -1,4 +1,4 @@ -"""Support for the Hive sesnors.""" +"""Support for the Hive sensors.""" from datetime import timedelta diff --git a/homeassistant/components/home_plus_control/helpers.py b/homeassistant/components/home_plus_control/helpers.py index 773732b1a50..f5687a23c66 100644 --- a/homeassistant/components/home_plus_control/helpers.py +++ b/homeassistant/components/home_plus_control/helpers.py @@ -20,7 +20,7 @@ class HomePlusControlOAuth2Implementation( subscription_key (str): Subscription key obtained from the API provider. authorize_url (str): Authorization URL initiate authentication flow. token_url (str): URL to retrieve access/refresh tokens. - name (str): Name of the implementation (appears in the HomeAssitant GUI). + name (str): Name of the implementation (appears in the HomeAssistant GUI). """ def __init__( diff --git a/homeassistant/components/homekit/__init__.py b/homeassistant/components/homekit/__init__.py index 3f297892446..46fd3e5e522 100644 --- a/homeassistant/components/homekit/__init__.py +++ b/homeassistant/components/homekit/__init__.py @@ -59,7 +59,7 @@ from . import ( # noqa: F401 from .accessories import HomeBridge, HomeDriver, get_accessory from .aidmanager import AccessoryAidStorage from .const import ( - ATTR_INTERGRATION, + ATTR_INTEGRATION, ATTR_MANUFACTURER, ATTR_MODEL, ATTR_SOFTWARE_VERSION, @@ -767,9 +767,9 @@ class HomeKit: integration = await async_get_integration( self.hass, ent_reg_ent.platform ) - ent_cfg[ATTR_INTERGRATION] = integration.name + ent_cfg[ATTR_INTEGRATION] = integration.name except IntegrationNotFound: - ent_cfg[ATTR_INTERGRATION] = ent_reg_ent.platform + ent_cfg[ATTR_INTEGRATION] = ent_reg_ent.platform class HomeKitPairingQRView(HomeAssistantView): diff --git a/homeassistant/components/homekit/accessories.py b/homeassistant/components/homekit/accessories.py index 3aeaa31faed..b9bd62246cf 100644 --- a/homeassistant/components/homekit/accessories.py +++ b/homeassistant/components/homekit/accessories.py @@ -42,7 +42,7 @@ from homeassistant.util.decorator import Registry from .const import ( ATTR_DISPLAY_NAME, - ATTR_INTERGRATION, + ATTR_INTEGRATION, ATTR_MANUFACTURER, ATTR_MODEL, ATTR_SOFTWARE_VERSION, @@ -221,8 +221,8 @@ class HomeAccessory(Accessory): if ATTR_MANUFACTURER in self.config: manufacturer = self.config[ATTR_MANUFACTURER] - elif ATTR_INTERGRATION in self.config: - manufacturer = self.config[ATTR_INTERGRATION].replace("_", " ").title() + elif ATTR_INTEGRATION in self.config: + manufacturer = self.config[ATTR_INTEGRATION].replace("_", " ").title() else: manufacturer = f"{MANUFACTURER} {domain}".title() if ATTR_MODEL in self.config: diff --git a/homeassistant/components/homekit/const.py b/homeassistant/components/homekit/const.py index 073650aba40..37788f9dca7 100644 --- a/homeassistant/components/homekit/const.py +++ b/homeassistant/components/homekit/const.py @@ -21,7 +21,7 @@ AUDIO_CODEC_COPY = "copy" # #### Attributes #### ATTR_DISPLAY_NAME = "display_name" ATTR_VALUE = "value" -ATTR_INTERGRATION = "platform" +ATTR_INTEGRATION = "platform" ATTR_MANUFACTURER = "manufacturer" ATTR_MODEL = "model" ATTR_SOFTWARE_VERSION = "sw_version" diff --git a/homeassistant/components/hunterdouglas_powerview/cover.py b/homeassistant/components/hunterdouglas_powerview/cover.py index 58c7e90994c..901a048fc7f 100644 --- a/homeassistant/components/hunterdouglas_powerview/cover.py +++ b/homeassistant/components/hunterdouglas_powerview/cover.py @@ -91,9 +91,9 @@ def hd_position_to_hass(hd_position): return round((hd_position / MAX_POSITION) * 100) -def hass_position_to_hd(hass_positon): +def hass_position_to_hd(hass_position): """Convert hass position to hunter douglas position.""" - return int(hass_positon / 100 * MAX_POSITION) + return int(hass_position / 100 * MAX_POSITION) class PowerViewShade(ShadeEntity, CoverEntity): diff --git a/homeassistant/components/isy994/entity.py b/homeassistant/components/isy994/entity.py index 69714dd9f4b..0406fc45cba 100644 --- a/homeassistant/components/isy994/entity.py +++ b/homeassistant/components/isy994/entity.py @@ -180,7 +180,7 @@ class ISYNodeEntity(ISYEntity): await self._node.send_cmd(command, value, unit_of_measurement, parameters) async def async_get_zwave_parameter(self, parameter): - """Repsond to an entity service command to request a Z-Wave device parameter from the ISY.""" + """Respond to an entity service command to request a Z-Wave device parameter from the ISY.""" if not hasattr(self._node, "protocol") or self._node.protocol != PROTO_ZWAVE: raise HomeAssistantError( f"Invalid service call: cannot request Z-Wave Parameter for non-Z-Wave device {self.entity_id}" @@ -188,7 +188,7 @@ class ISYNodeEntity(ISYEntity): await self._node.get_zwave_parameter(parameter) async def async_set_zwave_parameter(self, parameter, value, size): - """Repsond to an entity service command to set a Z-Wave device parameter via the ISY.""" + """Respond to an entity service command to set a Z-Wave device parameter via the ISY.""" if not hasattr(self._node, "protocol") or self._node.protocol != PROTO_ZWAVE: raise HomeAssistantError( f"Invalid service call: cannot set Z-Wave Parameter for non-Z-Wave device {self.entity_id}" @@ -197,7 +197,7 @@ class ISYNodeEntity(ISYEntity): await self._node.get_zwave_parameter(parameter) async def async_rename_node(self, name): - """Repsond to an entity service command to rename a node on the ISY.""" + """Respond to an entity service command to rename a node on the ISY.""" await self._node.rename(name) diff --git a/homeassistant/components/ps4/const.py b/homeassistant/components/ps4/const.py index f2d284daa79..c5236f7dffe 100644 --- a/homeassistant/components/ps4/const.py +++ b/homeassistant/components/ps4/const.py @@ -54,7 +54,7 @@ COUNTRYCODE_NAMES = { "LU": "Luxembourg", "MT": "Malta", "MX": "Mexico", - "MY": "Maylasia", + "MY": "Maylasia", # spelling error compatibility with pyps4_2ndscreen.media_art.COUNTRIES "NI": "Nicaragua", "NL": "Nederland", "NO": "Norway", diff --git a/homeassistant/components/unifi/sensor.py b/homeassistant/components/unifi/sensor.py index 14456bb8c06..8d34d3cabd7 100644 --- a/homeassistant/components/unifi/sensor.py +++ b/homeassistant/components/unifi/sensor.py @@ -35,7 +35,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): ) -> None: """Update the values of the controller.""" if controller.option_allow_bandwidth_sensors: - add_bandwith_entities(controller, async_add_entities, clients) + add_bandwidth_entities(controller, async_add_entities, clients) if controller.option_allow_uptime_sensors: add_uptime_entities(controller, async_add_entities, clients) @@ -49,7 +49,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): @callback -def add_bandwith_entities(controller, async_add_entities, clients): +def add_bandwidth_entities(controller, async_add_entities, clients): """Add new sensor entities from the controller.""" sensors = [] diff --git a/homeassistant/components/zeroconf/models.py b/homeassistant/components/zeroconf/models.py index c09e6428f2a..5a59ba52e3f 100644 --- a/homeassistant/components/zeroconf/models.py +++ b/homeassistant/components/zeroconf/models.py @@ -43,7 +43,7 @@ class HaServiceBrowser(ServiceBrowser): # As the list of zeroconf names we watch for grows, each additional # ServiceBrowser would process all the A and AAAA updates on the network. # - # To avoid overwhemling the system we pre-filter here and only process + # To avoid overwhelming the system we pre-filter here and only process # DNSPointers for the configured record name (type) # if record.name not in self.types or not isinstance(record, DNSPointer): diff --git a/tests/components/fritz/test_config_flow.py b/tests/components/fritz/test_config_flow.py index 6e051ef1bdd..a68aee2edff 100644 --- a/tests/components/fritz/test_config_flow.py +++ b/tests/components/fritz/test_config_flow.py @@ -305,7 +305,7 @@ async def test_ssdp_already_configured_host(hass: HomeAssistant, fc_class_mock): async def test_ssdp_already_configured_host_uuid(hass: HomeAssistant, fc_class_mock): - """Test starting a flow from discovery with a laready configured uuid.""" + """Test starting a flow from discovery with an already configured uuid.""" mock_config = MockConfigEntry( domain=DOMAIN, diff --git a/tests/components/here_travel_time/test_sensor.py b/tests/components/here_travel_time/test_sensor.py index 2f69dc97a84..3e5b2aeaaed 100644 --- a/tests/components/here_travel_time/test_sensor.py +++ b/tests/components/here_travel_time/test_sensor.py @@ -132,7 +132,7 @@ def requests_mock_credentials_check(requests_mock): @pytest.fixture def requests_mock_truck_response(requests_mock_credentials_check): - """Return a requests_mock for truck respones.""" + """Return a requests_mock for truck response.""" modes = [ROUTE_MODE_FASTEST, TRAVEL_MODE_TRUCK, TRAFFIC_MODE_DISABLED] response_url = _build_mock_url( ",".join([TRUCK_ORIGIN_LATITUDE, TRUCK_ORIGIN_LONGITUDE]), @@ -147,7 +147,7 @@ def requests_mock_truck_response(requests_mock_credentials_check): @pytest.fixture def requests_mock_car_disabled_response(requests_mock_credentials_check): - """Return a requests_mock for truck respones.""" + """Return a requests_mock for truck response.""" modes = [ROUTE_MODE_FASTEST, TRAVEL_MODE_CAR, TRAFFIC_MODE_DISABLED] response_url = _build_mock_url( ",".join([CAR_ORIGIN_LATITUDE, CAR_ORIGIN_LONGITUDE]), diff --git a/tests/components/homekit/test_accessories.py b/tests/components/homekit/test_accessories.py index afaa9ea0892..84ed61322a2 100644 --- a/tests/components/homekit/test_accessories.py +++ b/tests/components/homekit/test_accessories.py @@ -13,7 +13,7 @@ from homeassistant.components.homekit.accessories import ( ) from homeassistant.components.homekit.const import ( ATTR_DISPLAY_NAME, - ATTR_INTERGRATION, + ATTR_INTEGRATION, ATTR_MANUFACTURER, ATTR_MODEL, ATTR_SOFTWARE_VERSION, @@ -106,7 +106,7 @@ async def test_home_accessory(hass, hk_driver): ATTR_MODEL: "Awesome", ATTR_MANUFACTURER: "Lux Brands", ATTR_SOFTWARE_VERSION: "0.4.3", - ATTR_INTERGRATION: "luxe", + ATTR_INTEGRATION: "luxe", }, ) assert acc3.available is False diff --git a/tests/components/homekit/test_aidmanager.py b/tests/components/homekit/test_aidmanager.py index df1bb14dd9e..dd9daaac43d 100644 --- a/tests/components/homekit/test_aidmanager.py +++ b/tests/components/homekit/test_aidmanager.py @@ -77,7 +77,7 @@ async def test_aid_generation(hass, device_reg, entity_reg): aid_storage.delete_aid(get_system_unique_id(light_ent)) aid_storage.delete_aid(get_system_unique_id(light_ent2)) aid_storage.delete_aid(get_system_unique_id(remote_ent)) - aid_storage.delete_aid("non-existant-one") + aid_storage.delete_aid("non-existent-one") for _ in range(0, 2): assert ( diff --git a/tests/components/homekit/test_get_accessories.py b/tests/components/homekit/test_get_accessories.py index 1c68ae7d001..491d686162d 100644 --- a/tests/components/homekit/test_get_accessories.py +++ b/tests/components/homekit/test_get_accessories.py @@ -7,7 +7,7 @@ import homeassistant.components.climate as climate import homeassistant.components.cover as cover from homeassistant.components.homekit.accessories import TYPES, get_accessory from homeassistant.components.homekit.const import ( - ATTR_INTERGRATION, + ATTR_INTEGRATION, CONF_FEATURE_LIST, FEATURE_ON_OFF, TYPE_FAUCET, @@ -66,7 +66,7 @@ def test_customize_options(config, name): """Test with customized options.""" mock_type = Mock() conf = config.copy() - conf[ATTR_INTERGRATION] = "platform_name" + conf[ATTR_INTEGRATION] = "platform_name" with patch.dict(TYPES, {"Light": mock_type}): entity_state = State("light.demo", "on") get_accessory(None, None, entity_state, 2, conf) diff --git a/tests/components/hyperion/test_light.py b/tests/components/hyperion/test_light.py index 866b1b1b1a8..829a76f22d3 100644 --- a/tests/components/hyperion/test_light.py +++ b/tests/components/hyperion/test_light.py @@ -241,7 +241,7 @@ async def test_setup_config_entry_dynamic_instances(hass: HomeAssistant) -> None assert hass.states.get(TEST_ENTITY_ID_3) is not None -async def test_light_basic_properies(hass: HomeAssistant) -> None: +async def test_light_basic_properties(hass: HomeAssistant) -> None: """Test the basic properties.""" client = create_mock_client() await setup_test_config_entry(hass, hyperion_client=client) diff --git a/tests/components/influxdb/test_sensor.py b/tests/components/influxdb/test_sensor.py index 9a353f59e42..1df106473f9 100644 --- a/tests/components/influxdb/test_sensor.py +++ b/tests/components/influxdb/test_sensor.py @@ -313,7 +313,7 @@ async def test_config_failure(hass, config_ext): async def test_state_matches_query_result( hass, mock_client, config_ext, queries, set_query_mock, make_resultset ): - """Test state of sensor matches respone from query api.""" + """Test state of sensor matches response from query api.""" set_query_mock(mock_client, return_value=make_resultset(42)) sensors = await _setup(hass, config_ext, queries, ["sensor.test"]) @@ -344,7 +344,7 @@ async def test_state_matches_query_result( async def test_state_matches_first_query_result_for_multiple_return( hass, caplog, mock_client, config_ext, queries, set_query_mock, make_resultset ): - """Test state of sensor matches respone from query api.""" + """Test state of sensor matches response from query api.""" set_query_mock(mock_client, return_value=make_resultset(42, "not used")) sensors = await _setup(hass, config_ext, queries, ["sensor.test"]) @@ -370,7 +370,7 @@ async def test_state_matches_first_query_result_for_multiple_return( async def test_state_for_no_results( hass, caplog, mock_client, config_ext, queries, set_query_mock ): - """Test state of sensor matches respone from query api.""" + """Test state of sensor matches response from query api.""" set_query_mock(mock_client) sensors = await _setup(hass, config_ext, queries, ["sensor.test"]) diff --git a/tests/components/kraken/test_init.py b/tests/components/kraken/test_init.py index 742e48eb1c0..99af317154d 100644 --- a/tests/components/kraken/test_init.py +++ b/tests/components/kraken/test_init.py @@ -28,7 +28,7 @@ async def test_unload_entry(hass): assert DOMAIN not in hass.data -async def test_unkown_error(hass, caplog): +async def test_unknown_error(hass, caplog): """Test unload for Kraken.""" with patch( "pykrakenapi.KrakenAPI.get_tradable_asset_pairs", diff --git a/tests/components/mikrotik/test_hub.py b/tests/components/mikrotik/test_hub.py index 859c7d20d04..2159b58293b 100644 --- a/tests/components/mikrotik/test_hub.py +++ b/tests/components/mikrotik/test_hub.py @@ -12,7 +12,7 @@ from tests.common import MockConfigEntry async def setup_mikrotik_entry(hass, **kwargs): - """Set up Mikrotik intergation successfully.""" + """Set up Mikrotik integration successfully.""" support_wireless = kwargs.get("support_wireless", True) dhcp_data = kwargs.get("dhcp_data", DHCP_DATA) wireless_data = kwargs.get("wireless_data", WIRELESS_DATA) diff --git a/tests/components/sentry/test_config_flow.py b/tests/components/sentry/test_config_flow.py index 2246cabe33a..2876f6e3a17 100644 --- a/tests/components/sentry/test_config_flow.py +++ b/tests/components/sentry/test_config_flow.py @@ -87,7 +87,7 @@ async def test_user_flow_bad_dsn(hass: HomeAssistant) -> None: assert result2.get("errors") == {"base": "bad_dsn"} -async def test_user_flow_unkown_exception(hass: HomeAssistant) -> None: +async def test_user_flow_unknown_exception(hass: HomeAssistant) -> None: """Test we handle any unknown exception error.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": SOURCE_USER} diff --git a/tests/components/ssdp/test_init.py b/tests/components/ssdp/test_init.py index 2b527064ff8..6c019f1f311 100644 --- a/tests/components/ssdp/test_init.py +++ b/tests/components/ssdp/test_init.py @@ -119,7 +119,7 @@ async def test_scan_match_upnp_devicedesc(hass, aioclient_mock, key): "location": "http://1.1.1.1", } mock_init = await _async_run_mocked_scan(hass, mock_ssdp_response, mock_get_ssdp) - # If we get duplicate respones, ensure we only look it up once + # If we get duplicate response, ensure we only look it up once assert len(aioclient_mock.mock_calls) == 1 assert len(mock_init.mock_calls) == 1 assert mock_init.mock_calls[0][1][0] == "mock-domain" @@ -363,11 +363,11 @@ async def test_scan_with_registered_callback(hass, aioclient_mock, caplog): "x-rincon-bootseq": "55", "ext": "", } - not_matching_intergration_callbacks = [] - intergration_match_all_callbacks = [] - intergration_match_all_not_present_callbacks = [] - intergration_callbacks = [] - intergration_callbacks_from_cache = [] + not_matching_integration_callbacks = [] + integration_match_all_callbacks = [] + integration_match_all_not_present_callbacks = [] + integration_callbacks = [] + integration_callbacks_from_cache = [] match_any_callbacks = [] @callback @@ -375,24 +375,24 @@ async def test_scan_with_registered_callback(hass, aioclient_mock, caplog): raise ValueError @callback - def _async_intergration_callbacks(info): - intergration_callbacks.append(info) + def _async_integration_callbacks(info): + integration_callbacks.append(info) @callback - def _async_intergration_match_all_callbacks(info): - intergration_match_all_callbacks.append(info) + def _async_integration_match_all_callbacks(info): + integration_match_all_callbacks.append(info) @callback - def _async_intergration_match_all_not_present_callbacks(info): - intergration_match_all_not_present_callbacks.append(info) + def _async_integration_match_all_not_present_callbacks(info): + integration_match_all_not_present_callbacks.append(info) @callback - def _async_intergration_callbacks_from_cache(info): - intergration_callbacks_from_cache.append(info) + def _async_integration_callbacks_from_cache(info): + integration_callbacks_from_cache.append(info) @callback - def _async_not_matching_intergration_callbacks(info): - not_matching_intergration_callbacks.append(info) + def _async_not_matching_integration_callbacks(info): + not_matching_integration_callbacks.append(info) @callback def _async_match_any_callbacks(info): @@ -422,22 +422,22 @@ async def test_scan_with_registered_callback(hass, aioclient_mock, caplog): ssdp.async_register_callback(hass, _async_exception_callbacks, {}) ssdp.async_register_callback( hass, - _async_intergration_callbacks, + _async_integration_callbacks, {"st": "mock-st"}, ) ssdp.async_register_callback( hass, - _async_intergration_match_all_callbacks, + _async_integration_match_all_callbacks, {"x-rincon-bootseq": MATCH_ALL}, ) ssdp.async_register_callback( hass, - _async_intergration_match_all_not_present_callbacks, + _async_integration_match_all_not_present_callbacks, {"x-not-there": MATCH_ALL}, ) ssdp.async_register_callback( hass, - _async_not_matching_intergration_callbacks, + _async_not_matching_integration_callbacks, {"st": "not-match-mock-st"}, ) ssdp.async_register_callback( @@ -448,7 +448,7 @@ async def test_scan_with_registered_callback(hass, aioclient_mock, caplog): async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=200)) ssdp.async_register_callback( hass, - _async_intergration_callbacks_from_cache, + _async_integration_callbacks_from_cache, {"st": "mock-st"}, ) await hass.async_block_till_done() @@ -459,13 +459,13 @@ async def test_scan_with_registered_callback(hass, aioclient_mock, caplog): await hass.async_block_till_done() assert hass.state == CoreState.running - assert len(intergration_callbacks) == 3 - assert len(intergration_callbacks_from_cache) == 3 - assert len(intergration_match_all_callbacks) == 3 - assert len(intergration_match_all_not_present_callbacks) == 0 + assert len(integration_callbacks) == 3 + assert len(integration_callbacks_from_cache) == 3 + assert len(integration_match_all_callbacks) == 3 + assert len(integration_match_all_not_present_callbacks) == 0 assert len(match_any_callbacks) == 3 - assert len(not_matching_intergration_callbacks) == 0 - assert intergration_callbacks[0] == { + assert len(not_matching_integration_callbacks) == 0 + assert integration_callbacks[0] == { ssdp.ATTR_UPNP_DEVICE_TYPE: "Paulus", ssdp.ATTR_SSDP_EXT: "", ssdp.ATTR_SSDP_LOCATION: "http://1.1.1.1", @@ -503,11 +503,11 @@ async def test_unsolicited_ssdp_registered_callback(hass, aioclient_mock, caplog "x-rincon-variant": "1", "household.smartspeaker.audio": "Sonos_v3294823948542543534", } - intergration_callbacks = [] + integration_callbacks = [] @callback - def _async_intergration_callbacks(info): - intergration_callbacks.append(info) + def _async_integration_callbacks(info): + integration_callbacks.append(info) def _generate_fake_ssdp_listener(*args, **kwargs): listener = SSDPListener(*args, **kwargs) @@ -532,7 +532,7 @@ async def test_unsolicited_ssdp_registered_callback(hass, aioclient_mock, caplog await hass.async_block_till_done() ssdp.async_register_callback( hass, - _async_intergration_callbacks, + _async_integration_callbacks, {"nts": "ssdp:alive", "x-rincon-bootseq": MATCH_ALL}, ) await hass.async_block_till_done() @@ -546,9 +546,9 @@ async def test_unsolicited_ssdp_registered_callback(hass, aioclient_mock, caplog assert hass.state == CoreState.running assert ( - len(intergration_callbacks) == 2 + len(integration_callbacks) == 2 ) # unsolicited callbacks without st are not cached - assert intergration_callbacks[0] == { + assert integration_callbacks[0] == { "UDN": "uuid:RINCON_1111BB963FD801400", "bootid.upnp.org": "250", "deviceType": "Paulus", @@ -589,11 +589,11 @@ async def test_scan_second_hit(hass, aioclient_mock, caplog): } ) mock_get_ssdp = {"mock-domain": [{"st": "mock-st"}]} - intergration_callbacks = [] + integration_callbacks = [] @callback - def _async_intergration_callbacks(info): - intergration_callbacks.append(info) + def _async_integration_callbacks(info): + integration_callbacks.append(info) def _generate_fake_ssdp_listener(*args, **kwargs): listener = SSDPListener(*args, **kwargs) @@ -622,7 +622,7 @@ async def test_scan_second_hit(hass, aioclient_mock, caplog): await hass.async_block_till_done() remove = ssdp.async_register_callback( hass, - _async_intergration_callbacks, + _async_integration_callbacks, {"st": "mock-st"}, ) hass.bus.async_fire(EVENT_HOMEASSISTANT_STARTED) @@ -635,8 +635,8 @@ async def test_scan_second_hit(hass, aioclient_mock, caplog): async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=200)) await hass.async_block_till_done() - assert len(intergration_callbacks) == 2 - assert intergration_callbacks[0] == { + assert len(integration_callbacks) == 2 + assert integration_callbacks[0] == { ssdp.ATTR_UPNP_DEVICE_TYPE: "Paulus", ssdp.ATTR_SSDP_EXT: "", ssdp.ATTR_SSDP_LOCATION: "http://1.1.1.1", diff --git a/tests/components/syncthing/test_config_flow.py b/tests/components/syncthing/test_config_flow.py index 30f8bc0386b..7cdf728c07f 100644 --- a/tests/components/syncthing/test_config_flow.py +++ b/tests/components/syncthing/test_config_flow.py @@ -34,7 +34,7 @@ async def test_show_setup_form(hass): assert result["step_id"] == "user" -async def test_flow_successfull(hass): +async def test_flow_successful(hass): """Test with required fields only.""" with patch( "aiosyncthing.system.System.status", return_value={"myID": "server-id"} diff --git a/tests/components/transmission/test_config_flow.py b/tests/components/transmission/test_config_flow.py index 79b341e4504..91dfa25fd35 100644 --- a/tests/components/transmission/test_config_flow.py +++ b/tests/components/transmission/test_config_flow.py @@ -296,7 +296,7 @@ async def test_error_on_connection_failure(hass, conn_error): assert result["errors"] == {"base": "cannot_connect"} -async def test_error_on_unknwon_error(hass, unknown_error): +async def test_error_on_unknown_error(hass, unknown_error): """Test when connection to host fails.""" flow = init_config_flow(hass) diff --git a/tests/components/vera/common.py b/tests/components/vera/common.py index ae3c0a1a1de..1ce55ac9e8f 100644 --- a/tests/components/vera/common.py +++ b/tests/components/vera/common.py @@ -65,7 +65,7 @@ def new_simple_controller_config( setup_callback: SetupCallback = None, legacy_entity_unique_id=False, ) -> ControllerConfig: - """Create simple contorller config.""" + """Create simple controller config.""" return ControllerConfig( config=config or {CONF_CONTROLLER: "http://127.0.0.1:123"}, options=options, diff --git a/tests/components/wilight/__init__.py b/tests/components/wilight/__init__.py index d16b4d083e8..dd7d83876f8 100644 --- a/tests/components/wilight/__init__.py +++ b/tests/components/wilight/__init__.py @@ -41,7 +41,7 @@ MOCK_SSDP_DISCOVERY_INFO_P_B = { ATTR_UPNP_SERIAL: UPNP_SERIAL, } -MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTORER = { +MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTURER = { ATTR_SSDP_LOCATION: SSDP_LOCATION, ATTR_UPNP_MANUFACTURER: UPNP_MANUFACTURER_NOT_WILIGHT, ATTR_UPNP_MODEL_NAME: UPNP_MODEL_NAME_P_B, @@ -49,7 +49,7 @@ MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTORER = { ATTR_UPNP_SERIAL: ATTR_UPNP_SERIAL, } -MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTORER = { +MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTURER = { ATTR_SSDP_LOCATION: SSDP_LOCATION, ATTR_UPNP_MODEL_NAME: UPNP_MODEL_NAME_P_B, ATTR_UPNP_MODEL_NUMBER: UPNP_MODEL_NUMBER, diff --git a/tests/components/wilight/test_config_flow.py b/tests/components/wilight/test_config_flow.py index 42f6aa592b0..4835167715d 100644 --- a/tests/components/wilight/test_config_flow.py +++ b/tests/components/wilight/test_config_flow.py @@ -21,9 +21,9 @@ from tests.common import MockConfigEntry from tests.components.wilight import ( CONF_COMPONENTS, HOST, - MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTORER, + MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTURER, MOCK_SSDP_DISCOVERY_INFO_P_B, - MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTORER, + MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTURER, UPNP_MODEL_NAME_P_B, UPNP_SERIAL, WILIGHT_ID, @@ -71,7 +71,7 @@ async def test_show_ssdp_form(hass: HomeAssistant) -> None: async def test_ssdp_not_wilight_abort_1(hass: HomeAssistant) -> None: """Test that the ssdp aborts not_wilight.""" - discovery_info = MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTORER.copy() + discovery_info = MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTURER.copy() result = await hass.config_entries.flow.async_init( DOMAIN, context={CONF_SOURCE: SOURCE_SSDP}, data=discovery_info ) @@ -83,7 +83,7 @@ async def test_ssdp_not_wilight_abort_1(hass: HomeAssistant) -> None: async def test_ssdp_not_wilight_abort_2(hass: HomeAssistant) -> None: """Test that the ssdp aborts not_wilight.""" - discovery_info = MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTORER.copy() + discovery_info = MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTURER.copy() result = await hass.config_entries.flow.async_init( DOMAIN, context={CONF_SOURCE: SOURCE_SSDP}, data=discovery_info ) diff --git a/tests/components/xiaomi_aqara/test_config_flow.py b/tests/components/xiaomi_aqara/test_config_flow.py index 859338b82d3..3f445a1fdec 100644 --- a/tests/components/xiaomi_aqara/test_config_flow.py +++ b/tests/components/xiaomi_aqara/test_config_flow.py @@ -113,7 +113,7 @@ async def test_config_flow_user_success(hass): async def test_config_flow_user_multiple_success(hass): - """Test a successful config flow initialized by the user with multiple gateways discoverd.""" + """Test a successful config flow initialized by the user with multiple gateways discovered.""" result = await hass.config_entries.flow.async_init( const.DOMAIN, context={"source": config_entries.SOURCE_USER} ) @@ -249,7 +249,7 @@ async def test_config_flow_user_host_mac_success(hass): async def test_config_flow_user_discovery_error(hass): - """Test a failed config flow initialized by the user with no gateways discoverd.""" + """Test a failed config flow initialized by the user with no gateways discovered.""" result = await hass.config_entries.flow.async_init( const.DOMAIN, context={"source": config_entries.SOURCE_USER} ) diff --git a/tests/components/xiaomi_miio/test_vacuum.py b/tests/components/xiaomi_miio/test_vacuum.py index fe0466472fa..0eb806c0a64 100644 --- a/tests/components/xiaomi_miio/test_vacuum.py +++ b/tests/components/xiaomi_miio/test_vacuum.py @@ -115,8 +115,8 @@ def mirobo_is_got_error_fixture(): mock_vacuum.timer.return_value = [mock_timer_1, mock_timer_2] - with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vaccum_cls: - mock_vaccum_cls.return_value = mock_vacuum + with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vacuum_cls: + mock_vacuum_cls.return_value = mock_vacuum yield mock_vacuum @@ -143,8 +143,8 @@ def mirobo_old_speeds_fixture(request): mock_vacuum.fan_speed_presets.return_value = request.param mock_vacuum.status().fanspeed = list(request.param.values())[0] - with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vaccum_cls: - mock_vaccum_cls.return_value = mock_vacuum + with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vacuum_cls: + mock_vacuum_cls.return_value = mock_vacuum yield mock_vacuum @@ -189,8 +189,8 @@ def mirobo_is_on_fixture(): mock_vacuum.timer.return_value = [mock_timer_1, mock_timer_2] - with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vaccum_cls: - mock_vaccum_cls.return_value = mock_vacuum + with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vacuum_cls: + mock_vacuum_cls.return_value = mock_vacuum yield mock_vacuum diff --git a/tests/components/zha/test_device.py b/tests/components/zha/test_device.py index d5ed0152b8b..0f696f21572 100644 --- a/tests/components/zha/test_device.py +++ b/tests/components/zha/test_device.py @@ -192,7 +192,7 @@ async def test_check_available_unsuccessful( assert basic_ch.read_attributes.await_args[0][0] == ["manufacturer"] assert zha_device.available is True - # not even trying to update, device is unavailble + # not even trying to update, device is unavailable _send_time_changed(hass, 91) await hass.async_block_till_done() assert basic_ch.read_attributes.await_count == 2 diff --git a/tests/helpers/test_condition.py b/tests/helpers/test_condition.py index d75dd53bbf2..bd5e15ad11f 100644 --- a/tests/helpers/test_condition.py +++ b/tests/helpers/test_condition.py @@ -1034,7 +1034,7 @@ async def test_state_attribute(hass): }, ) - hass.states.async_set("sensor.temperature", 100, {"unkown_attr": 200}) + hass.states.async_set("sensor.temperature", 100, {"unknown_attr": 200}) with pytest.raises(ConditionError): test(hass) @@ -1330,7 +1330,7 @@ async def test_numeric_state_attribute(hass): }, ) - hass.states.async_set("sensor.temperature", 100, {"unkown_attr": 10}) + hass.states.async_set("sensor.temperature", 100, {"unknown_attr": 10}) with pytest.raises(ConditionError): assert test(hass) diff --git a/tests/helpers/test_frame.py b/tests/helpers/test_frame.py index b198a16adb1..5e48b2aec5f 100644 --- a/tests/helpers/test_frame.py +++ b/tests/helpers/test_frame.py @@ -15,7 +15,7 @@ async def test_extract_frame_integration(caplog, mock_integration_frame): assert found_frame == mock_integration_frame -async def test_extract_frame_integration_with_excluded_intergration(caplog): +async def test_extract_frame_integration_with_excluded_integration(caplog): """Test extracting the current frame from integration context.""" correct_frame = Mock( filename="/home/dev/homeassistant/components/mdns/light.py", diff --git a/tests/helpers/test_script.py b/tests/helpers/test_script.py index 546f494735e..0af8ff7d431 100644 --- a/tests/helpers/test_script.py +++ b/tests/helpers/test_script.py @@ -477,7 +477,7 @@ async def test_stop_no_wait(hass, count): # Can't assert just yet because we haven't verified stopping works yet. # If assert fails we can hang test if async_stop doesn't work. - script_was_runing = script_obj.is_running + script_was_running = script_obj.is_running were_no_events = len(events) == 0 # Begin the process of stopping the script (which should stop all runs), and then @@ -487,7 +487,7 @@ async def test_stop_no_wait(hass, count): await hass.async_block_till_done() - assert script_was_runing + assert script_was_running assert were_no_events assert not script_obj.is_running assert len(events) == 0 @@ -1189,8 +1189,8 @@ async def test_wait_template_with_utcnow(hass): start_time = dt_util.utcnow().replace(minute=1) + timedelta(hours=48) try: - non_maching_time = start_time.replace(hour=3) - with patch("homeassistant.util.dt.utcnow", return_value=non_maching_time): + non_matching_time = start_time.replace(hour=3) + with patch("homeassistant.util.dt.utcnow", return_value=non_matching_time): hass.async_create_task(script_obj.async_run(context=Context())) await asyncio.wait_for(wait_started_flag.wait(), 1) assert script_obj.is_running @@ -1221,17 +1221,17 @@ async def test_wait_template_with_utcnow_no_match(hass): timed_out = False try: - non_maching_time = start_time.replace(hour=3) - with patch("homeassistant.util.dt.utcnow", return_value=non_maching_time): + non_matching_time = start_time.replace(hour=3) + with patch("homeassistant.util.dt.utcnow", return_value=non_matching_time): hass.async_create_task(script_obj.async_run(context=Context())) await asyncio.wait_for(wait_started_flag.wait(), 1) assert script_obj.is_running - second_non_maching_time = start_time.replace(hour=4) + second_non_matching_time = start_time.replace(hour=4) with patch( - "homeassistant.util.dt.utcnow", return_value=second_non_maching_time + "homeassistant.util.dt.utcnow", return_value=second_non_matching_time ): - async_fire_time_changed(hass, second_non_maching_time) + async_fire_time_changed(hass, second_non_matching_time) with timeout(0.1): await hass.async_block_till_done() diff --git a/tests/helpers/test_template.py b/tests/helpers/test_template.py index 1818d8c4876..2547537bff9 100644 --- a/tests/helpers/test_template.py +++ b/tests/helpers/test_template.py @@ -2499,7 +2499,7 @@ async def test_no_result_parsing(hass): async def test_is_static_still_ast_evals(hass): - """Test is_static still convers to native type.""" + """Test is_static still converts to native type.""" tpl = template.Template("[1, 2]", hass) assert tpl.is_static assert tpl.async_render() == [1, 2] diff --git a/tests/test_config_entries.py b/tests/test_config_entries.py index 1fca4b061cc..615b97fb990 100644 --- a/tests/test_config_entries.py +++ b/tests/test_config_entries.py @@ -1971,7 +1971,7 @@ async def test__async_current_entries_does_not_skip_ignore_non_user(hass, manage assert len(mock_setup_entry.mock_calls) == 0 -async def test__async_current_entries_explict_skip_ignore(hass, manager): +async def test__async_current_entries_explicit_skip_ignore(hass, manager): """Test that _async_current_entries can explicitly include ignore.""" hass.config.components.add("comp") entry = MockConfigEntry( @@ -2010,7 +2010,7 @@ async def test__async_current_entries_explict_skip_ignore(hass, manager): assert p_entry.data == {"token": "supersecret"} -async def test__async_current_entries_explict_include_ignore(hass, manager): +async def test__async_current_entries_explicit_include_ignore(hass, manager): """Test that _async_current_entries can explicitly include ignore.""" hass.config.components.add("comp") entry = MockConfigEntry(