diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f27e82b6d9..05601865691 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,6 +14,15 @@ repos: - --safe - --quiet files: ^((homeassistant|script|tests)/.+)?[^/]+\.py$ +- repo: https://github.com/codespell-project/codespell + rev: v1.16.0 + hooks: + - id: codespell + args: + - --ignore-words-list=hass,alot,datas,dof,dur,farenheit,hist,iff,ines,ist,lightsensor,mut,nd,pres,referer,ser,serie,te,technik,ue,uint,visability,wan,wanna,withing + - --skip="./.*,*.json" + - --quiet-level=2 + exclude_types: [json] - repo: https://gitlab.com/pycqa/flake8 rev: 3.7.9 hooks: diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml index 546b63950fe..0474bf77489 100644 --- a/azure-pipelines-ci.yml +++ b/azure-pipelines-ci.yml @@ -44,6 +44,10 @@ stages: . venv/bin/activate pip install -r requirements_test.txt -c homeassistant/package_constraints.txt pre-commit install-hooks --config .pre-commit-config-all.yaml + - script: | + . venv/bin/activate + pre-commit run codespell --all-files + displayName: 'Run codespell' - script: | . venv/bin/activate pre-commit run flake8 --all-files diff --git a/azure-pipelines-release.yml b/azure-pipelines-release.yml index 135057f2ae4..c98f12dfac6 100644 --- a/azure-pipelines-release.yml +++ b/azure-pipelines-release.yml @@ -163,7 +163,7 @@ stages: git commit -am "Bump Home Assistant $version" git push - displayName: 'Update version files' + displayName: "Update version files" - job: 'ReleaseDocker' pool: vmImage: 'ubuntu-latest' diff --git a/homeassistant/auth/__init__.py b/homeassistant/auth/__init__.py index 9b3cf49fa22..710b4af1cd8 100644 --- a/homeassistant/auth/__init__.py +++ b/homeassistant/auth/__init__.py @@ -301,7 +301,7 @@ class AuthManager: async def async_deactivate_user(self, user: models.User) -> None: """Deactivate a user.""" if user.is_owner: - raise ValueError("Unable to deactive the owner") + raise ValueError("Unable to deactivate the owner") await self._store.async_deactivate_user(user) async def async_remove_credentials(self, credentials: models.Credentials) -> None: diff --git a/homeassistant/auth/mfa_modules/__init__.py b/homeassistant/auth/mfa_modules/__init__.py index fd9e61b9d17..c2ec2260cf2 100644 --- a/homeassistant/auth/mfa_modules/__init__.py +++ b/homeassistant/auth/mfa_modules/__init__.py @@ -1,4 +1,4 @@ -"""Plugable auth modules for Home Assistant.""" +"""Pluggable auth modules for Home Assistant.""" import importlib import logging import types diff --git a/homeassistant/auth/mfa_modules/notify.py b/homeassistant/auth/mfa_modules/notify.py index 46cc634bcae..8da81a44a61 100644 --- a/homeassistant/auth/mfa_modules/notify.py +++ b/homeassistant/auth/mfa_modules/notify.py @@ -317,7 +317,7 @@ class NotifySetupFlow(SetupFlow): async def async_step_setup( self, user_input: Optional[Dict[str, str]] = None ) -> Dict[str, Any]: - """Verify user can recevie one-time password.""" + """Verify user can receive one-time password.""" errors: Dict[str, str] = {} hass = self._auth_module.hass diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index 3d8523bf9ac..0b7dbe370be 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -193,7 +193,7 @@ def async_enable_logging( pass # If the above initialization failed for any reason, setup the default - # formatting. If the above succeeds, this wil result in a no-op. + # formatting. If the above succeeds, this will result in a no-op. logging.basicConfig(format=fmt, datefmt=datefmt, level=logging.INFO) # Suppress overly verbose logs from libraries that aren't helpful diff --git a/homeassistant/components/alexa/messages.py b/homeassistant/components/alexa/messages.py index cb78f269f8f..4dd154ea11f 100644 --- a/homeassistant/components/alexa/messages.py +++ b/homeassistant/components/alexa/messages.py @@ -43,7 +43,7 @@ class AlexaDirective: Behavior when self.has_endpoint is False is undefined. Will raise AlexaInvalidEndpointError if the endpoint in the request is - malformed or nonexistant. + malformed or nonexistent. """ _endpoint_id = self._directive[API_ENDPOINT]["endpointId"] self.entity_id = _endpoint_id.replace("#", ".") diff --git a/homeassistant/components/amcrest/binary_sensor.py b/homeassistant/components/amcrest/binary_sensor.py index ac16f0664aa..a99901f54a3 100644 --- a/homeassistant/components/amcrest/binary_sensor.py +++ b/homeassistant/components/amcrest/binary_sensor.py @@ -1,4 +1,4 @@ -"""Suppoort for Amcrest IP camera binary sensors.""" +"""Support for Amcrest IP camera binary sensors.""" from datetime import timedelta import logging diff --git a/homeassistant/components/amcrest/camera.py b/homeassistant/components/amcrest/camera.py index e9e1e2b5f84..8ff6403c566 100644 --- a/homeassistant/components/amcrest/camera.py +++ b/homeassistant/components/amcrest/camera.py @@ -121,7 +121,7 @@ class AmcrestCam(Camera): available = self.available if not available or not self.is_on: _LOGGER.warning( - "Attempt to take snaphot when %s camera is %s", + "Attempt to take snapshot when %s camera is %s", self.name, "offline" if not available else "off", ) diff --git a/homeassistant/components/amcrest/sensor.py b/homeassistant/components/amcrest/sensor.py index be03b3bedff..04436cd95ab 100644 --- a/homeassistant/components/amcrest/sensor.py +++ b/homeassistant/components/amcrest/sensor.py @@ -1,4 +1,4 @@ -"""Suppoort for Amcrest IP camera sensors.""" +"""Support for Amcrest IP camera sensors.""" from datetime import timedelta import logging diff --git a/homeassistant/components/apns/notify.py b/homeassistant/components/apns/notify.py index febe344a9c4..3cd43ee36ae 100644 --- a/homeassistant/components/apns/notify.py +++ b/homeassistant/components/apns/notify.py @@ -177,7 +177,7 @@ class ApnsNotificationService(BaseNotificationService): def device_state_changed_listener(self, entity_id, from_s, to_s): """ - Listen for sate change. + Listen for state change. Track device state change if a device has a tracking id specified. """ diff --git a/homeassistant/components/binary_sensor/device_condition.py b/homeassistant/components/binary_sensor/device_condition.py index 63f84b657c1..cb98ec90b5d 100644 --- a/homeassistant/components/binary_sensor/device_condition.py +++ b/homeassistant/components/binary_sensor/device_condition.py @@ -1,4 +1,4 @@ -"""Implemenet device conditions for binary sensor.""" +"""Implement device conditions for binary sensor.""" from typing import Dict, List import voluptuous as vol diff --git a/homeassistant/components/bluesound/media_player.py b/homeassistant/components/bluesound/media_player.py index 04ba21555d4..db5c65eab8b 100644 --- a/homeassistant/components/bluesound/media_player.py +++ b/homeassistant/components/bluesound/media_player.py @@ -421,7 +421,7 @@ class BluesoundPlayer(MediaPlayerDevice): # sync_status. We will force an update if the player is # grouped this isn't a foolproof solution. A better # solution would be to fetch sync_status more often when - # the device is playing. This would solve alot of + # the device is playing. This would solve a lot of # problems. This change will be done when the # communication is moved to a separate library await self.force_update_sync_status() diff --git a/homeassistant/components/bom/sensor.py b/homeassistant/components/bom/sensor.py index 7d951968cb2..4728e22c877 100644 --- a/homeassistant/components/bom/sensor.py +++ b/homeassistant/components/bom/sensor.py @@ -281,7 +281,7 @@ def _get_bom_stations(): """Return {CONF_STATION: (lat, lon)} for all stations, for auto-config. This function does several MB of internet requests, so please use the - caching version to minimise latency and hit-count. + caching version to minimize latency and hit-count. """ latlon = {} with io.BytesIO() as file_obj: diff --git a/homeassistant/components/broadlink/remote.py b/homeassistant/components/broadlink/remote.py index 0b9d10b1e74..96698e5b02f 100644 --- a/homeassistant/components/broadlink/remote.py +++ b/homeassistant/components/broadlink/remote.py @@ -270,7 +270,7 @@ class BroadlinkRemote(RemoteDevice): async def _async_learn_code(self, command, device, toggle, timeout): """Learn a code from a remote. - Capture an aditional code for toggle commands. + Capture an additional code for toggle commands. """ try: if not toggle: diff --git a/homeassistant/components/camera/__init__.py b/homeassistant/components/camera/__init__.py index b02874780e5..647e54556c4 100644 --- a/homeassistant/components/camera/__init__.py +++ b/homeassistant/components/camera/__init__.py @@ -377,7 +377,7 @@ class Camera(Entity): async def handle_async_mjpeg_stream(self, request): """Serve an HTTP MJPEG stream from the camera. - This method can be overridden by camera plaforms to proxy + This method can be overridden by camera platforms to proxy a direct stream from the camera. """ return await self.handle_async_still_stream(request, self.frame_interval) diff --git a/homeassistant/components/cert_expiry/config_flow.py b/homeassistant/components/cert_expiry/config_flow.py index 14532aea65f..f3bd2f07d63 100644 --- a/homeassistant/components/cert_expiry/config_flow.py +++ b/homeassistant/components/cert_expiry/config_flow.py @@ -69,7 +69,7 @@ class CertexpiryConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return False async def async_step_user(self, user_input=None): - """Step when user intializes a integration.""" + """Step when user initializes a integration.""" self._errors = {} if user_input is not None: # set some defaults in case we need to return to the form diff --git a/homeassistant/components/climate/services.yaml b/homeassistant/components/climate/services.yaml index 34e89d57346..815df57f342 100644 --- a/homeassistant/components/climate/services.yaml +++ b/homeassistant/components/climate/services.yaml @@ -30,7 +30,7 @@ set_temperature: description: New target temperature for HVAC. example: 25 target_temp_high: - description: New target high tempereature for HVAC. + description: New target high temperature for HVAC. example: 26 target_temp_low: description: New target low temperature for HVAC. diff --git a/homeassistant/components/configurator/__init__.py b/homeassistant/components/configurator/__init__.py index 78333d96355..4d79b13355c 100644 --- a/homeassistant/components/configurator/__init__.py +++ b/homeassistant/components/configurator/__init__.py @@ -209,7 +209,7 @@ class Configurator: entity_id = self._requests.pop(request_id)[0] # If we remove the state right away, it will not be included with - # the result fo the service call (current design limitation). + # the result of the service call (current design limitation). # Instead, we will set it to configured to give as feedback but delete # it shortly after so that it is deleted when the client updates. self.hass.states.async_set(entity_id, STATE_CONFIGURED) diff --git a/homeassistant/components/emulated_hue/hue_api.py b/homeassistant/components/emulated_hue/hue_api.py index 118bf7e3eaa..882fafe630c 100644 --- a/homeassistant/components/emulated_hue/hue_api.py +++ b/homeassistant/components/emulated_hue/hue_api.py @@ -720,7 +720,7 @@ def create_hue_success_response(entity_id, attr, value): def create_list_of_entities(config, request): - """Create a list of all entites.""" + """Create a list of all entities.""" hass = request.app["hass"] json_response = {} diff --git a/homeassistant/components/emulated_roku/binding.py b/homeassistant/components/emulated_roku/binding.py index a44effff55a..1d233c9ed81 100644 --- a/homeassistant/components/emulated_roku/binding.py +++ b/homeassistant/components/emulated_roku/binding.py @@ -109,7 +109,7 @@ class EmulatedRoku: ) LOGGER.debug( - "Intializing emulated_roku %s on %s:%s", + "Initializing emulated_roku %s on %s:%s", self.roku_usn, self.host_ip, self.listen_port, diff --git a/homeassistant/components/evohome/__init__.py b/homeassistant/components/evohome/__init__.py index 949471d64d0..1a408c0a660 100644 --- a/homeassistant/components/evohome/__init__.py +++ b/homeassistant/components/evohome/__init__.py @@ -148,7 +148,7 @@ def _handle_exception(err) -> bool: return False except aiohttp.ClientConnectionError: - # this appears to be a common occurance with the vendor's servers + # this appears to be a common occurrence with the vendor's servers _LOGGER.warning( "Unable to connect with the vendor's server. " "Check your network and the vendor's service status page. " @@ -184,7 +184,7 @@ async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool: tokens = dict(app_storage if app_storage else {}) if tokens.pop(CONF_USERNAME, None) != config[DOMAIN][CONF_USERNAME]: - # any tokens wont be valid, and store might be be corrupt + # any tokens won't be valid, and store might be be corrupt await store.async_save({}) return ({}, None) @@ -266,7 +266,7 @@ def setup_service_functions(hass: HomeAssistantType, broker): Not all Honeywell TCC-compatible systems support all operating modes. In addition, each mode will require any of four distinct service schemas. This has to be - enumerated before registering the approperiate handlers. + enumerated before registering the appropriate handlers. It appears that all TCC-compatible systems support the same three zones modes. """ diff --git a/homeassistant/components/fan/__init__.py b/homeassistant/components/fan/__init__.py index 38234a8f832..76bd16a6363 100644 --- a/homeassistant/components/fan/__init__.py +++ b/homeassistant/components/fan/__init__.py @@ -169,7 +169,7 @@ class FanEntity(ToggleEntity): @property def capability_attributes(self): - """Return capabilitiy attributes.""" + """Return capability attributes.""" return {ATTR_SPEED_LIST: self.speed_list} @property diff --git a/homeassistant/components/fibaro/light.py b/homeassistant/components/fibaro/light.py index ba77942a448..38779a05cb0 100644 --- a/homeassistant/components/fibaro/light.py +++ b/homeassistant/components/fibaro/light.py @@ -68,7 +68,7 @@ class FibaroLight(FibaroDevice, Light): supports_dimming = "levelChange" in fibaro_device.interfaces supports_white_v = "setW" in fibaro_device.actions - # Configuration can overrride default capability detection + # Configuration can override default capability detection if devconf.get(CONF_DIMMING, supports_dimming): self._supported_flags |= SUPPORT_BRIGHTNESS if devconf.get(CONF_COLOR, supports_color): diff --git a/homeassistant/components/filter/sensor.py b/homeassistant/components/filter/sensor.py index baa4f90af3f..77622f62b1d 100644 --- a/homeassistant/components/filter/sensor.py +++ b/homeassistant/components/filter/sensor.py @@ -377,7 +377,7 @@ class Filter: @property def skip_processing(self): - """Return wether the current filter_state should be skipped.""" + """Return whether the current filter_state should be skipped.""" return self._skip_processing def _filter_state(self, new_state): diff --git a/homeassistant/components/freebox/switch.py b/homeassistant/components/freebox/switch.py index b6655c9634f..062d6a699fe 100644 --- a/homeassistant/components/freebox/switch.py +++ b/homeassistant/components/freebox/switch.py @@ -18,7 +18,7 @@ class FbxWifiSwitch(SwitchDevice): """Representation of a freebox wifi switch.""" def __init__(self, fbx): - """Initilize the Wifi switch.""" + """Initialize the Wifi switch.""" self._name = "Freebox WiFi" self._state = None self._fbx = fbx diff --git a/homeassistant/components/garmin_connect/__init__.py b/homeassistant/components/garmin_connect/__init__.py index 5336394f671..d63d82d1284 100644 --- a/homeassistant/components/garmin_connect/__init__.py +++ b/homeassistant/components/garmin_connect/__init__.py @@ -43,13 +43,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): GarminConnectAuthenticationError, GarminConnectTooManyRequestsError, ) as err: - _LOGGER.error("Error occured during Garmin Connect login: %s", err) + _LOGGER.error("Error occurred during Garmin Connect login: %s", err) return False except (GarminConnectConnectionError) as err: - _LOGGER.error("Error occured during Garmin Connect login: %s", err) + _LOGGER.error("Error occurred during Garmin Connect login: %s", err) raise ConfigEntryNotReady except Exception: # pylint: disable=broad-except - _LOGGER.error("Unknown error occured during Garmin Connect login") + _LOGGER.error("Unknown error occurred during Garmin Connect login") return False garmin_data = GarminConnectData(hass, garmin_client) @@ -98,11 +98,11 @@ class GarminConnectData: GarminConnectAuthenticationError, GarminConnectTooManyRequestsError, ) as err: - _LOGGER.error("Error occured during Garmin Connect get stats: %s", err) + _LOGGER.error("Error occurred during Garmin Connect get stats: %s", err) return except (GarminConnectConnectionError) as err: - _LOGGER.error("Error occured during Garmin Connect get stats: %s", err) + _LOGGER.error("Error occurred during Garmin Connect get stats: %s", err) return except Exception: # pylint: disable=broad-except - _LOGGER.error("Unknown error occured during Garmin Connect get stats") + _LOGGER.error("Unknown error occurred during Garmin Connect get stats") return diff --git a/homeassistant/components/garmin_connect/sensor.py b/homeassistant/components/garmin_connect/sensor.py index 6a3128cae01..51ec421e02b 100644 --- a/homeassistant/components/garmin_connect/sensor.py +++ b/homeassistant/components/garmin_connect/sensor.py @@ -32,9 +32,9 @@ async def async_setup_entry( GarminConnectAuthenticationError, GarminConnectTooManyRequestsError, ) as err: - _LOGGER.error("Error occured during Garmin Connect Client update: %s", err) + _LOGGER.error("Error occurred during Garmin Connect Client update: %s", err) except Exception: # pylint: disable=broad-except - _LOGGER.error("Unknown error occured during Garmin Connect Client update.") + _LOGGER.error("Unknown error occurred during Garmin Connect Client update.") entities = [] for ( diff --git a/homeassistant/components/google_assistant/http.py b/homeassistant/components/google_assistant/http.py index 7bd3583e5c2..60e4cdae6a5 100644 --- a/homeassistant/components/google_assistant/http.py +++ b/homeassistant/components/google_assistant/http.py @@ -180,7 +180,7 @@ class GoogleConfig(AbstractConfig): return 500 async def async_call_homegraph_api(self, url, data): - """Call a homegraph api with authenticaiton.""" + """Call a homegraph api with authentication.""" session = async_get_clientsession(self.hass) async def _call(): diff --git a/homeassistant/components/hdmi_cec/services.yaml b/homeassistant/components/hdmi_cec/services.yaml index f2e5f0b837a..63aee668062 100644 --- a/homeassistant/components/hdmi_cec/services.yaml +++ b/homeassistant/components/hdmi_cec/services.yaml @@ -3,7 +3,7 @@ select_device: description: Select HDMI device. fields: device: {description: 'Address of device to select. Can be entity_id, physical - address or alias from confuguration.', example: '"switch.hdmi_1" or "1.1.0.0" + address or alias from configuration.', example: '"switch.hdmi_1" or "1.1.0.0" or "01:10"'} send_command: description: Sends CEC command into HDMI CEC capable adapter. diff --git a/homeassistant/components/homekit/type_lights.py b/homeassistant/components/homekit/type_lights.py index 3fc6a0628ff..734568606b2 100644 --- a/homeassistant/components/homekit/type_lights.py +++ b/homeassistant/components/homekit/type_lights.py @@ -201,7 +201,7 @@ class Light(HomeAccessory): # But if it is set to 0, HomeKit will update the brightness to 100 as # it thinks 0 is off. # - # Therefore, if the the brighness is 0 and the device is still on, + # Therefore, if the the brightness is 0 and the device is still on, # the brightness is mapped to 1 otherwise the update is ignored in # order to avoid this incorrect behavior. if brightness == 0: diff --git a/homeassistant/components/homekit_controller/__init__.py b/homeassistant/components/homekit_controller/__init__.py index dc65796a569..b2275282293 100644 --- a/homeassistant/components/homekit_controller/__init__.py +++ b/homeassistant/components/homekit_controller/__init__.py @@ -63,7 +63,7 @@ class HomeKitEntity(Entity): return False def setup(self): - """Configure an entity baed on its HomeKit characterstics metadata.""" + """Configure an entity baed on its HomeKit characteristics metadata.""" accessories = self._accessory.accessories get_uuid = CharacteristicsTypes.get_uuid @@ -124,7 +124,7 @@ class HomeKitEntity(Entity): """Collect new data from bridge and update the entity state in hass.""" accessory_state = self._accessory.current_state.get(self._aid, {}) for iid, result in accessory_state.items(): - # No value so dont process this result + # No value so don't process this result if "value" not in result: continue diff --git a/homeassistant/components/homekit_controller/connection.py b/homeassistant/components/homekit_controller/connection.py index 64581da45b1..11cb607842a 100644 --- a/homeassistant/components/homekit_controller/connection.py +++ b/homeassistant/components/homekit_controller/connection.py @@ -77,7 +77,7 @@ class HKDevice: # The platorms we have forwarded the config entry so far. If a new # accessory is added to a bridge we may have to load additional # platforms. We don't want to load all platforms up front if its just - # a lightbulb. And we dont want to forward a config entry twice + # a lightbulb. And we don't want to forward a config entry twice # (triggers a Config entry already set up error) self.platforms = set() @@ -331,7 +331,7 @@ class HKDevice: key = (row["aid"], row["iid"]) # If the key was returned by put_characteristics() then the - # change didnt work + # change didn't work if key in results: continue diff --git a/homeassistant/components/homematicip_cloud/sensor.py b/homeassistant/components/homematicip_cloud/sensor.py index ebbee1abc44..d1c3b987a73 100644 --- a/homeassistant/components/homematicip_cloud/sensor.py +++ b/homeassistant/components/homematicip_cloud/sensor.py @@ -305,7 +305,7 @@ class HomematicipPowerSensor(HomematicipGenericDevice): @property def state(self) -> float: - """Representation of the HomematicIP power comsumption value.""" + """Representation of the HomematicIP power consumption value.""" return self._device.currentPowerConsumption @property @@ -356,7 +356,7 @@ class HomematicipTodayRainSensor(HomematicipGenericDevice): @property def state(self) -> float: - """Representation of the HomematicIP todays rain value.""" + """Representation of the HomematicIP today's rain value.""" return round(self._device.todayRainCounter, 2) @property diff --git a/homeassistant/components/insteon/utils.py b/homeassistant/components/insteon/utils.py index 9a44566bb4a..f195a458477 100644 --- a/homeassistant/components/insteon/utils.py +++ b/homeassistant/components/insteon/utils.py @@ -139,7 +139,7 @@ def async_register_services(hass, config, insteon_modem): def print_aldb(service): """Print the All-Link Database for a device.""" # For now this sends logs to the log file. - # Furture direction is to create an INSTEON control panel. + # Future direction is to create an INSTEON control panel. entity_id = service.data[CONF_ENTITY_ID] signal = f"{entity_id}_{SIGNAL_PRINT_ALDB}" dispatcher_send(hass, signal) @@ -147,7 +147,7 @@ def async_register_services(hass, config, insteon_modem): def print_im_aldb(service): """Print the All-Link Database for a device.""" # For now this sends logs to the log file. - # Furture direction is to create an INSTEON control panel. + # Future direction is to create an INSTEON control panel. print_aldb_to_log(insteon_modem.aldb) def x10_all_units_off(service): diff --git a/homeassistant/components/ios/__init__.py b/homeassistant/components/ios/__init__.py index 75622c29b1c..3f193993c2b 100644 --- a/homeassistant/components/ios/__init__.py +++ b/homeassistant/components/ios/__init__.py @@ -279,7 +279,7 @@ class iOSIdentifyDeviceView(HomeAssistantView): name = "api:ios:identify" def __init__(self, config_path): - """Initiliaze the view.""" + """Initialize the view.""" self._config_path = config_path async def post(self, request): diff --git a/homeassistant/components/izone/discovery.py b/homeassistant/components/izone/discovery.py index c49144f1db9..7690600786e 100644 --- a/homeassistant/components/izone/discovery.py +++ b/homeassistant/components/izone/discovery.py @@ -44,11 +44,11 @@ class DiscoveryService(pizone.Listener): async_dispatcher_send(self.hass, DISPATCH_CONTROLLER_RECONNECTED, ctrl) def controller_update(self, ctrl: pizone.Controller) -> None: - """System update message is recieved from the controller.""" + """System update message is received from the controller.""" async_dispatcher_send(self.hass, DISPATCH_CONTROLLER_UPDATE, ctrl) def zone_update(self, ctrl: pizone.Controller, zone: pizone.Zone) -> None: - """Zone update message is recieved from the controller.""" + """Zone update message is received from the controller.""" async_dispatcher_send(self.hass, DISPATCH_ZONE_UPDATE, ctrl, zone) diff --git a/homeassistant/components/lcn/services.py b/homeassistant/components/lcn/services.py index c35a0cc00bf..ba9d52b7721 100644 --- a/homeassistant/components/lcn/services.py +++ b/homeassistant/components/lcn/services.py @@ -178,7 +178,7 @@ class VarAbs(LcnServiceCall): """Set absolute value of a variable or setpoint. Variable has to be set as counter! - Reguator setpoints can also be set using R1VARSETPOINT, R2VARSETPOINT. + Regulator setpoints can also be set using R1VARSETPOINT, R2VARSETPOINT. """ schema = LcnServiceCall.schema.extend( diff --git a/homeassistant/components/logger/__init__.py b/homeassistant/components/logger/__init__.py index 8043469d43b..961718a30ee 100644 --- a/homeassistant/components/logger/__init__.py +++ b/homeassistant/components/logger/__init__.py @@ -1,4 +1,4 @@ -"""Support for settting the level of logging for components.""" +"""Support for setting the level of logging for components.""" from collections import OrderedDict import logging diff --git a/homeassistant/components/media_player/__init__.py b/homeassistant/components/media_player/__init__.py index 28951df545a..9b4c3fc1198 100644 --- a/homeassistant/components/media_player/__init__.py +++ b/homeassistant/components/media_player/__init__.py @@ -737,7 +737,7 @@ class MediaPlayerDevice(Entity): @property def capability_attributes(self): - """Return capabilitiy attributes.""" + """Return capability attributes.""" supported_features = self.supported_features or 0 data = {} diff --git a/homeassistant/components/met/config_flow.py b/homeassistant/components/met/config_flow.py index 759f7f6fc89..683390429c3 100644 --- a/homeassistant/components/met/config_flow.py +++ b/homeassistant/components/met/config_flow.py @@ -12,15 +12,15 @@ from .const import CONF_TRACK_HOME, DOMAIN, HOME_LOCATION_NAME @callback def configured_instances(hass): """Return a set of configured SimpliSafe instances.""" - entites = [] + entries = [] for entry in hass.config_entries.async_entries(DOMAIN): if entry.data.get("track_home"): - entites.append("home") + entries.append("home") continue - entites.append( + entries.append( f"{entry.data.get(CONF_LATITUDE)}-{entry.data.get(CONF_LONGITUDE)}" ) - return set(entites) + return set(entries) class MetFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): diff --git a/homeassistant/components/mfi/switch.py b/homeassistant/components/mfi/switch.py index 18809f08d4f..b3d3e0ea285 100644 --- a/homeassistant/components/mfi/switch.py +++ b/homeassistant/components/mfi/switch.py @@ -113,7 +113,7 @@ class MfiSwitch(SwitchDevice): @property def device_state_attributes(self): - """Return the state attributes fof the device.""" + """Return the state attributes for the device.""" attr = {} attr["volts"] = round(self._port.data.get("v_rms", 0), 1) attr["amps"] = round(self._port.data.get("i_rms", 0), 1) diff --git a/homeassistant/components/mikrotik/hub.py b/homeassistant/components/mikrotik/hub.py index 2243b6cc5ce..2a503651d4b 100644 --- a/homeassistant/components/mikrotik/hub.py +++ b/homeassistant/components/mikrotik/hub.py @@ -299,7 +299,7 @@ class MikrotikHub: @property def firmware(self): - """Return the firware of the hub.""" + """Return the firmware of the hub.""" return self._mk_data.firmware @property diff --git a/homeassistant/components/pi_hole/__init__.py b/homeassistant/components/pi_hole/__init__.py index ed6144af47e..5791d17f6dd 100644 --- a/homeassistant/components/pi_hole/__init__.py +++ b/homeassistant/components/pi_hole/__init__.py @@ -91,7 +91,7 @@ async def async_setup(hass, config): """Set up the pi_hole integration.""" def get_data(): - """Retrive component data.""" + """Retrieve component data.""" return hass.data[DOMAIN] def ensure_api_token(call_data): diff --git a/homeassistant/components/pi_hole/const.py b/homeassistant/components/pi_hole/const.py index 0ae62b31865..ca4eea32bd6 100644 --- a/homeassistant/components/pi_hole/const.py +++ b/homeassistant/components/pi_hole/const.py @@ -1,4 +1,4 @@ -"""Constants for the pi_hole intergration.""" +"""Constants for the pi_hole integration.""" from datetime import timedelta DOMAIN = "pi_hole" diff --git a/homeassistant/components/prometheus/__init__.py b/homeassistant/components/prometheus/__init__.py index c20296a2c18..d77cb4f56da 100644 --- a/homeassistant/components/prometheus/__init__.py +++ b/homeassistant/components/prometheus/__init__.py @@ -334,7 +334,7 @@ class PrometheusMetrics: @staticmethod def _sensor_fallback_metric(state, unit): - """Get metric from fallback logic for compatability.""" + """Get metric from fallback logic for compatibility.""" if unit in (None, ""): _LOGGER.debug("Unsupported sensor: %s", state.entity_id) return None diff --git a/homeassistant/components/rmvtransport/sensor.py b/homeassistant/components/rmvtransport/sensor.py index 8df1191a420..507e3c133cc 100644 --- a/homeassistant/components/rmvtransport/sensor.py +++ b/homeassistant/components/rmvtransport/sensor.py @@ -233,7 +233,7 @@ class RMVDepartureData: ) except RMVtransportApiConnectionError: self.departures = [] - _LOGGER.warning("Could not retrive data from rmv.de") + _LOGGER.warning("Could not retrieve data from rmv.de") return self.station = _data.get("station") _deps = [] diff --git a/homeassistant/components/saj/sensor.py b/homeassistant/components/saj/sensor.py index 30399640088..797780d562a 100644 --- a/homeassistant/components/saj/sensor.py +++ b/homeassistant/components/saj/sensor.py @@ -217,7 +217,7 @@ class SAJsensor(Entity): @property def per_total_basis(self) -> bool: - """Return if the sensors value is cummulative or not.""" + """Return if the sensors value is cumulative or not.""" return self._sensor.per_total_basis @property diff --git a/homeassistant/components/sigfox/sensor.py b/homeassistant/components/sigfox/sensor.py index 27e2fe9b563..da07290f422 100644 --- a/homeassistant/components/sigfox/sensor.py +++ b/homeassistant/components/sigfox/sensor.py @@ -100,7 +100,7 @@ class SigfoxAPI: @property def auth(self): - """Return the API authentification.""" + """Return the API authentication.""" return self._auth @property diff --git a/homeassistant/components/smappee/__init__.py b/homeassistant/components/smappee/__init__.py index d34653e60e7..c31ab97cb95 100644 --- a/homeassistant/components/smappee/__init__.py +++ b/homeassistant/components/smappee/__init__.py @@ -199,7 +199,7 @@ class Smappee: try: return self._smappy.get_consumption(location_id, start, end, aggregation) except RequestException as error: - _LOGGER.error("Error getting comsumption from Smappee cloud. (%s)", error) + _LOGGER.error("Error getting consumption from Smappee cloud. (%s)", error) def get_sensor_consumption(self, location_id, sensor_id, aggregation, delta): """Update data from Smappee.""" @@ -221,7 +221,7 @@ class Smappee: location_id, sensor_id, start, end, aggregation ) except RequestException as error: - _LOGGER.error("Error getting comsumption from Smappee cloud. (%s)", error) + _LOGGER.error("Error getting consumption from Smappee cloud. (%s)", error) def actuator_on(self, location_id, actuator_id, is_remote_switch, duration=None): """Turn on actuator.""" diff --git a/homeassistant/components/solaredge/config_flow.py b/homeassistant/components/solaredge/config_flow.py index 7c8c9380522..62bf99ab383 100644 --- a/homeassistant/components/solaredge/config_flow.py +++ b/homeassistant/components/solaredge/config_flow.py @@ -54,7 +54,7 @@ class SolarEdgeConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return True async def async_step_user(self, user_input=None): - """Step when user intializes a integration.""" + """Step when user initializes a integration.""" self._errors = {} if user_input is not None: name = slugify(user_input.get(CONF_NAME, DEFAULT_NAME)) diff --git a/homeassistant/components/solarlog/config_flow.py b/homeassistant/components/solarlog/config_flow.py index 5cb2d5deec1..111155b27b6 100644 --- a/homeassistant/components/solarlog/config_flow.py +++ b/homeassistant/components/solarlog/config_flow.py @@ -54,7 +54,7 @@ class SolarLogConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return False async def async_step_user(self, user_input=None): - """Step when user intializes a integration.""" + """Step when user initializes a integration.""" self._errors = {} if user_input is not None: # set some defaults in case we need to return to the form diff --git a/homeassistant/components/stream/worker.py b/homeassistant/components/stream/worker.py index 99ffd833eb3..6cd07c7f926 100644 --- a/homeassistant/components/stream/worker.py +++ b/homeassistant/components/stream/worker.py @@ -95,7 +95,7 @@ def stream_worker(hass, stream, quit_event): if packet.is_keyframe: # Calculate the segment duration by multiplying the presentation # timestamp by the time base, which gets us total seconds. - # By then dividing by the seqence, we can calculate how long + # By then dividing by the sequence, we can calculate how long # each segment is, assuming the stream starts from 0. segment_duration = (packet.pts * packet.time_base) / sequence # Save segment to outputs diff --git a/homeassistant/components/tod/binary_sensor.py b/homeassistant/components/tod/binary_sensor.py index cab57c59ac8..72507b3d148 100644 --- a/homeassistant/components/tod/binary_sensor.py +++ b/homeassistant/components/tod/binary_sensor.py @@ -126,14 +126,14 @@ class TodSensor(BinarySensorDevice): current_local_date = self.current_datetime.astimezone( self.hass.config.time_zone ).date() - # calcuate utc datetime corecponding to local time + # calculate utc datetime corecponding to local time utc_datetime = self.hass.config.time_zone.localize( datetime.combine(current_local_date, naive_time) ).astimezone(tz=pytz.UTC) return utc_datetime def _calculate_initial_boudary_time(self): - """Calculate internal absolute time boudaries.""" + """Calculate internal absolute time boundaries.""" nowutc = self.current_datetime # If after value is a sun event instead of absolute time if is_sun_event(self._after): diff --git a/homeassistant/components/toon/__init__.py b/homeassistant/components/toon/__init__.py index 348826a1264..612561707b1 100644 --- a/homeassistant/components/toon/__init__.py +++ b/homeassistant/components/toon/__init__.py @@ -137,7 +137,7 @@ class ToonData: def update(self, now=None): """Update all Toon data and notify entities.""" - # Ignore the TTL meganism from client library + # Ignore the TTL mechanism from client library # It causes a lots of issues, hence we take control over caching self._toon._clear_cache() # pylint: disable=protected-access diff --git a/homeassistant/components/tradfri/light.py b/homeassistant/components/tradfri/light.py index 0fe826be9af..40fe7b01cb0 100644 --- a/homeassistant/components/tradfri/light.py +++ b/homeassistant/components/tradfri/light.py @@ -246,7 +246,7 @@ class TradfriLight(TradfriBaseDevice, Light): color_command = self._device_control.set_hsb(**color_data) transition_time = None - # HSB can always be set, but color temp + brightness is bulb dependant + # HSB can always be set, but color temp + brightness is bulb dependent command = dimmer_command if command is not None: command += color_command diff --git a/homeassistant/components/transmission/switch.py b/homeassistant/components/transmission/switch.py index 1756df7baee..3d85a76f2bd 100644 --- a/homeassistant/components/transmission/switch.py +++ b/homeassistant/components/transmission/switch.py @@ -80,7 +80,7 @@ class TransmissionSwitch(ToggleEntity): def turn_off(self, **kwargs): """Turn the device off.""" if self.type == "on_off": - _LOGGING.debug("Stoping all torrents") + _LOGGING.debug("Stopping all torrents") self._tm_client.api.stop_torrents() if self.type == "turtle_mode": _LOGGING.debug("Turning Turtle Mode of Transmission off") diff --git a/homeassistant/components/utility_meter/sensor.py b/homeassistant/components/utility_meter/sensor.py index 3dab92b89f8..8c47e716b80 100644 --- a/homeassistant/components/utility_meter/sensor.py +++ b/homeassistant/components/utility_meter/sensor.py @@ -140,7 +140,7 @@ class UtilityMeterSensor(RestoreEntity): diff = Decimal(new_state.state) - Decimal(old_state.state) if (not self._sensor_net_consumption) and diff < 0: - # Source sensor just rolled over for unknow reasons, + # Source sensor just rolled over for unknown reasons, return self._state += diff diff --git a/homeassistant/components/vacuum/__init__.py b/homeassistant/components/vacuum/__init__.py index 225a6ed72bc..3cd2de600e3 100644 --- a/homeassistant/components/vacuum/__init__.py +++ b/homeassistant/components/vacuum/__init__.py @@ -248,7 +248,7 @@ class VacuumDevice(_BaseVacuum, ToggleEntity): @property def capability_attributes(self): - """Return capabilitiy attributes.""" + """Return capability attributes.""" if self.fan_speed is not None: return {ATTR_FAN_SPEED_LIST: self.fan_speed_list} @@ -330,7 +330,7 @@ class StateVacuumDevice(_BaseVacuum): @property def capability_attributes(self): - """Return capabilitiy attributes.""" + """Return capability attributes.""" if self.fan_speed is not None: return {ATTR_FAN_SPEED_LIST: self.fan_speed_list} diff --git a/homeassistant/components/velbus/config_flow.py b/homeassistant/components/velbus/config_flow.py index 9325acf0608..1d081b711a8 100644 --- a/homeassistant/components/velbus/config_flow.py +++ b/homeassistant/components/velbus/config_flow.py @@ -49,7 +49,7 @@ class VelbusConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return False async def async_step_user(self, user_input=None): - """Step when user intializes a integration.""" + """Step when user initializes a integration.""" self._errors = {} if user_input is not None: name = slugify(user_input[CONF_NAME]) diff --git a/homeassistant/components/water_heater/__init__.py b/homeassistant/components/water_heater/__init__.py index ecff3105ae0..4de0a58a881 100644 --- a/homeassistant/components/water_heater/__init__.py +++ b/homeassistant/components/water_heater/__init__.py @@ -145,7 +145,7 @@ class WaterHeaterDevice(Entity): @property def capability_attributes(self): - """Return capabilitiy attributes.""" + """Return capability attributes.""" supported_features = self.supported_features or 0 data = { diff --git a/homeassistant/components/wink/services.yaml b/homeassistant/components/wink/services.yaml index 93d53159702..500f1fd3f2a 100644 --- a/homeassistant/components/wink/services.yaml +++ b/homeassistant/components/wink/services.yaml @@ -131,7 +131,7 @@ set_nimbus_dial_configuration: description: The minimum value allowed to be set example: 0 max_value: - description: The maximum value allowd to be set + description: The maximum value allowed to be set example: 500 min_position: description: The minimum position the dial hand can rotate to generally [0-360] @@ -141,10 +141,10 @@ set_nimbus_dial_configuration: example: 360 set_nimbus_dial_state: - description: Set the value and lables of an individual nimbus dial + description: Set the value and labels of an individual nimbus dial fields: entity_id: - description: Name fo the entity to set. + description: Name of the entity to set. example: 'wink.nimbus_dial_3' value: description: The value that should be set (Should be between min_value and max_value) diff --git a/homeassistant/components/yamaha/services.yaml b/homeassistant/components/yamaha/services.yaml index 592a1d1342e..c92522008be 100644 --- a/homeassistant/components/yamaha/services.yaml +++ b/homeassistant/components/yamaha/services.yaml @@ -2,7 +2,7 @@ enable_output: description: Enable or disable an output port fields: entity_id: - description: Name(s) of entites to enable/disable port on. + description: Name(s) of entities to enable/disable port on. example: 'media_player.yamaha' port: description: Name of port to enable/disable. diff --git a/homeassistant/components/zha/core/gateway.py b/homeassistant/components/zha/core/gateway.py index e5a199c5bbd..dd661835367 100644 --- a/homeassistant/components/zha/core/gateway.py +++ b/homeassistant/components/zha/core/gateway.py @@ -424,7 +424,7 @@ class ZHAGateway: # ZHA already has an initialized device so either the device was assigned a # new nwk or device was physically reset and added again without being removed _LOGGER.debug( - "device - %s has been reset and readded or its nwk address changed", + "device - %s has been reset and re-added or its nwk address changed", f"0x{device.nwk:04x}:{device.ieee}", ) await self._async_device_rejoined(zha_device) diff --git a/homeassistant/components/zhong_hong/climate.py b/homeassistant/components/zhong_hong/climate.py index 203131afdb1..62f5b9acbaf 100644 --- a/homeassistant/components/zhong_hong/climate.py +++ b/homeassistant/components/zhong_hong/climate.py @@ -88,7 +88,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): hub_is_initialized = False async def startup(): - """Start hub socket after all climate entity is setted up.""" + """Start hub socket after all climate entity is set up.""" nonlocal hub_is_initialized if not all([device.is_initialized for device in devices]): return diff --git a/homeassistant/components/zwave/climate.py b/homeassistant/components/zwave/climate.py index 840418fb063..4ee9b8b9cc9 100644 --- a/homeassistant/components/zwave/climate.py +++ b/homeassistant/components/zwave/climate.py @@ -529,7 +529,7 @@ class ZWaveClimateBase(ZWaveDeviceEntity, ClimateDevice): self._mode().data = operation_mode def turn_aux_heat_on(self): - """Turn auxillary heater on.""" + """Turn auxiliary heater on.""" if not self._aux_heat: return operation_mode = AUX_HEAT_ZWAVE_MODE @@ -537,7 +537,7 @@ class ZWaveClimateBase(ZWaveDeviceEntity, ClimateDevice): self._mode().data = operation_mode def turn_aux_heat_off(self): - """Turn auxillary heater off.""" + """Turn auxiliary heater off.""" if not self._aux_heat: return if HVAC_MODE_HEAT in self._hvac_mapping: diff --git a/homeassistant/components/zwave/lock.py b/homeassistant/components/zwave/lock.py index 44e73da320f..382d2c4dbf2 100644 --- a/homeassistant/components/zwave/lock.py +++ b/homeassistant/components/zwave/lock.py @@ -180,7 +180,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): if len(str(usercode)) < 4: _LOGGER.error( "Invalid code provided: (%s) " - "usercode must be atleast 4 and at most" + "usercode must be at least 4 and at most" " %s digits", usercode, len(value.data), diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index 793e8be0045..d8e64172ba0 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -947,7 +947,7 @@ class SystemOptions: self.disable_new_entities = disable_new_entities def as_dict(self) -> Dict[str, Any]: - """Return dictionary version of this config entrys system options.""" + """Return dictionary version of this config entries system options.""" return {"disable_new_entities": self.disable_new_entities} diff --git a/homeassistant/data_entry_flow.py b/homeassistant/data_entry_flow.py index 4dd1c7acf50..4a115762be4 100644 --- a/homeassistant/data_entry_flow.py +++ b/homeassistant/data_entry_flow.py @@ -30,7 +30,7 @@ class UnknownHandler(FlowError): class UnknownFlow(FlowError): - """Uknown flow specified.""" + """Unknown flow specified.""" class UnknownStep(FlowError): diff --git a/homeassistant/helpers/logging.py b/homeassistant/helpers/logging.py index 0b274458045..2e3270879f0 100644 --- a/homeassistant/helpers/logging.py +++ b/homeassistant/helpers/logging.py @@ -42,7 +42,7 @@ class KeywordStyleAdapter(logging.LoggerAdapter): def process( self, msg: Any, kwargs: MutableMapping[str, Any] ) -> Tuple[Any, MutableMapping[str, Any]]: - """Process the keyward args in preparation for logging.""" + """Process the keyword args in preparation for logging.""" return ( msg, { diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index 8565315f87f..77642ce5052 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -469,7 +469,7 @@ def _wrap_state(hass, state): def _get_state(hass, entity_id): state = hass.states.get(entity_id) if state is None: - # Only need to collect if none, if not none collect first actuall + # Only need to collect if none, if not none collect first actual # access to the state properties in the state wrapper. _collect_state(hass, entity_id) return None diff --git a/homeassistant/util/package.py b/homeassistant/util/package.py index 24cf8309228..9a5ae82d4a2 100644 --- a/homeassistant/util/package.py +++ b/homeassistant/util/package.py @@ -15,7 +15,7 @@ _LOGGER = logging.getLogger(__name__) def is_virtual_env() -> bool: - """Return if we run in a virtual environtment.""" + """Return if we run in a virtual environment.""" # Check supports venv && virtualenv return getattr(sys, "base_prefix", sys.prefix) != sys.prefix or hasattr( sys, "real_prefix" diff --git a/script/scaffold/gather_info.py b/script/scaffold/gather_info.py index 48d0a20ea73..fda5081e7c3 100644 --- a/script/scaffold/gather_info.py +++ b/script/scaffold/gather_info.py @@ -56,7 +56,7 @@ def gather_info(arguments) -> Info: YES_NO = { "validators": [["Type either 'yes' or 'no'", lambda value: value in ("yes", "no")]], - "convertor": lambda value: value == "yes", + "converter": lambda value: value == "yes", } @@ -155,8 +155,8 @@ def _gather_info(fields) -> dict: break if hint is None: - if "convertor" in info: - value = info["convertor"](value) + if "converter" in info: + value = info["converter"](value) answers[key] = value return answers diff --git a/tests/auth/mfa_modules/test_notify.py b/tests/auth/mfa_modules/test_notify.py index bc4ecaab712..c79d76baf4f 100644 --- a/tests/auth/mfa_modules/test_notify.py +++ b/tests/auth/mfa_modules/test_notify.py @@ -321,7 +321,7 @@ async def test_include_exclude_config(hass): async def test_setup_user_no_notify_service(hass): - """Test setup flow abort if there is no avilable notify service.""" + """Test setup flow abort if there is no available notify service.""" async_mock_service(hass, "notify", "test1", NOTIFY_SERVICE_SCHEMA) notify_auth_module = await auth_mfa_module_from_config( hass, {"type": "notify", "exclude": "test1"} diff --git a/tests/auth/test_init.py b/tests/auth/test_init.py index 2ff75c579e5..9d93e5e7042 100644 --- a/tests/auth/test_init.py +++ b/tests/auth/test_init.py @@ -453,7 +453,7 @@ async def test_refresh_token_type_long_lived_access_token(hass): async def test_cannot_deactive_owner(mock_hass): - """Test that we cannot deactive the owner.""" + """Test that we cannot deactivate the owner.""" manager = await auth.auth_manager_from_config(mock_hass, [], []) owner = MockUser(is_owner=True).add_to_auth_manager(manager) diff --git a/tests/components/api/test_init.py b/tests/components/api/test_init.py index dbc08a43bfa..01c8b27bfcc 100644 --- a/tests/components/api/test_init.py +++ b/tests/components/api/test_init.py @@ -541,7 +541,7 @@ async def test_rendering_template_legacy_user( async def test_api_call_service_not_found(hass, mock_api_client): - """Test if the API failes 400 if unknown service.""" + """Test if the API fails 400 if unknown service.""" resp = await mock_api_client.post( const.URL_API_SERVICES_SERVICE.format("test_domain", "test_service") ) @@ -549,7 +549,7 @@ async def test_api_call_service_not_found(hass, mock_api_client): async def test_api_call_service_bad_data(hass, mock_api_client): - """Test if the API failes 400 if unknown service.""" + """Test if the API fails 400 if unknown service.""" test_value = [] @ha.callback diff --git a/tests/components/apprise/test_notify.py b/tests/components/apprise/test_notify.py index a275e57653d..8135f4e8e2c 100644 --- a/tests/components/apprise/test_notify.py +++ b/tests/components/apprise/test_notify.py @@ -95,7 +95,7 @@ async def test_apprise_notification(hass): assert await async_setup_component(hass, BASE_COMPONENT, config) await hass.async_block_till_done() - # Test the existance of our service + # Test the existence of our service assert hass.services.has_service(BASE_COMPONENT, "test") # Test the call to our underlining notify() call @@ -134,7 +134,7 @@ async def test_apprise_notification_with_target(hass, tmp_path): assert await async_setup_component(hass, BASE_COMPONENT, config) await hass.async_block_till_done() - # Test the existance of our service + # Test the existence of our service assert hass.services.has_service(BASE_COMPONENT, "test") # Test the call to our underlining notify() call diff --git a/tests/components/arcam_fmj/test_media_player.py b/tests/components/arcam_fmj/test_media_player.py index 8448a25a7fd..2ff31a8fd4f 100644 --- a/tests/components/arcam_fmj/test_media_player.py +++ b/tests/components/arcam_fmj/test_media_player.py @@ -123,7 +123,7 @@ async def test_turn_off(player, state): @pytest.mark.parametrize("mute", [True, False]) async def test_mute_volume(player, state, mute): - """Test mute functionallity.""" + """Test mute functionality.""" await player.async_mute_volume(mute) state.set_mute.assert_called_with(mute) player.async_schedule_update_ha_state.assert_called_with() @@ -200,14 +200,14 @@ async def test_select_sound_mode(player, state, mode, mode_sel, mode_2ch, mode_m async def test_volume_up(player, state): - """Test mute functionallity.""" + """Test mute functionality.""" await player.async_volume_up() state.inc_volume.assert_called_with() player.async_schedule_update_ha_state.assert_called_with() async def test_volume_down(player, state): - """Test mute functionallity.""" + """Test mute functionality.""" await player.async_volume_down() state.dec_volume.assert_called_with() player.async_schedule_update_ha_state.assert_called_with() diff --git a/tests/components/bayesian/test_binary_sensor.py b/tests/components/bayesian/test_binary_sensor.py index d9341bb3271..c8a23517ae1 100644 --- a/tests/components/bayesian/test_binary_sensor.py +++ b/tests/components/bayesian/test_binary_sensor.py @@ -149,7 +149,7 @@ class TestBayesianBinarySensor(unittest.TestCase): assert state.state == "off" def test_threshold(self): - """Test sensor on probabilty threshold limits.""" + """Test sensor on probability threshold limits.""" config = { "binary_sensor": { "name": "Test_Binary", diff --git a/tests/components/cert_expiry/test_config_flow.py b/tests/components/cert_expiry/test_config_flow.py index bcd1482195d..71005672fdb 100644 --- a/tests/components/cert_expiry/test_config_flow.py +++ b/tests/components/cert_expiry/test_config_flow.py @@ -19,7 +19,7 @@ HOST = "example.com" @pytest.fixture(name="test_connect") def mock_controller(): - """Mock a successfull _prt_in_configuration_exists.""" + """Mock a successful _prt_in_configuration_exists.""" with patch( "homeassistant.components.cert_expiry.config_flow.CertexpiryConfigFlow._test_connection", side_effect=lambda *_: mock_coro(True), diff --git a/tests/components/cloud/test_client.py b/tests/components/cloud/test_client.py index 2338f0eaa1e..da20afba0b1 100644 --- a/tests/components/cloud/test_client.py +++ b/tests/components/cloud/test_client.py @@ -217,7 +217,7 @@ async def test_google_config_should_2fa(hass, mock_cloud_setup, mock_cloud_login async def test_set_username(hass): - """Test we set username during loggin.""" + """Test we set username during login.""" prefs = MagicMock( alexa_enabled=False, google_enabled=False, diff --git a/tests/components/config/test_zwave.py b/tests/components/config/test_zwave.py index 267c57717f9..059cdb1f1e8 100644 --- a/tests/components/config/test_zwave.py +++ b/tests/components/config/test_zwave.py @@ -480,7 +480,7 @@ async def test_set_protection_value_failed(hass, client): resp = await client.post( "/api/zwave/protection/18", - data=json.dumps({"value_id": "123456", "selection": "Protecton by Seuence"}), + data=json.dumps({"value_id": "123456", "selection": "Protecton by Sequence"}), ) assert resp.status == 202 @@ -512,7 +512,7 @@ async def test_set_protection_value_nonexisting_node(hass, client): resp = await client.post( "/api/zwave/protection/18", - data=json.dumps({"value_id": "123456", "selection": "Protecton by Seuence"}), + data=json.dumps({"value_id": "123456", "selection": "Protecton by Sequence"}), ) assert resp.status == 404 @@ -532,7 +532,7 @@ async def test_set_protection_value_missing_class(hass, client): resp = await client.post( "/api/zwave/protection/17", - data=json.dumps({"value_id": "123456", "selection": "Protecton by Seuence"}), + data=json.dumps({"value_id": "123456", "selection": "Protecton by Sequence"}), ) assert resp.status == 404 diff --git a/tests/components/darksky/test_sensor.py b/tests/components/darksky/test_sensor.py index bb716ed17ec..eff06e3bf7d 100644 --- a/tests/components/darksky/test_sensor.py +++ b/tests/components/darksky/test_sensor.py @@ -30,7 +30,7 @@ INVALID_CONFIG_MINIMAL = { "api_key": "foo", "forecast": [1, 2], "hourly_forecast": [1, 2], - "monitored_conditions": ["sumary", "iocn", "temperature_high"], + "monitored_conditions": ["summary", "iocn", "temperature_high"], "scan_interval": timedelta(seconds=120), } } diff --git a/tests/components/emulated_hue/test_hue_api.py b/tests/components/emulated_hue/test_hue_api.py index 0ddc429b2d9..8b2e7157256 100644 --- a/tests/components/emulated_hue/test_hue_api.py +++ b/tests/components/emulated_hue/test_hue_api.py @@ -610,7 +610,7 @@ async def test_close_cover(hass_hue, hue_client): async def test_set_position_cover(hass_hue, hue_client): - """Test setting postion cover .""" + """Test setting position cover .""" COVER_ID = "cover.living_room_window" # Turn the office light off first await hass_hue.services.async_call( diff --git a/tests/components/facebook/test_notify.py b/tests/components/facebook/test_notify.py index e23cc4f0982..c4c85d1cee0 100644 --- a/tests/components/facebook/test_notify.py +++ b/tests/components/facebook/test_notify.py @@ -88,7 +88,7 @@ class TestFacebook(unittest.TestCase): """Test sending a message without a target.""" mock.register_uri(requests_mock.POST, facebook.BASE_URL, status_code=200) - self.facebook.send_message(message="goin nowhere") + self.facebook.send_message(message="going nowhere") assert not mock.called @requests_mock.Mocker() diff --git a/tests/components/fritzbox/test_climate.py b/tests/components/fritzbox/test_climate.py index bbd332bb487..b535b35e182 100644 --- a/tests/components/fritzbox/test_climate.py +++ b/tests/components/fritzbox/test_climate.py @@ -91,7 +91,7 @@ class TestFritzboxClimate(unittest.TestCase): @patch.object(FritzboxThermostat, "set_hvac_mode") def test_set_temperature_operation_mode_precedence(self, mock_set_op): - """Test set_temperature for precedence of operation_mode arguement.""" + """Test set_temperature for precedence of operation_mode argument.""" self.thermostat.set_temperature(hvac_mode="heat", temperature=23.0) mock_set_op.assert_called_once_with("heat") self.thermostat._device.set_target_temperature.assert_not_called() diff --git a/tests/components/heos/test_media_player.py b/tests/components/heos/test_media_player.py index 354751be0d2..31aced7f807 100644 --- a/tests/components/heos/test_media_player.py +++ b/tests/components/heos/test_media_player.py @@ -506,7 +506,7 @@ async def test_select_radio_favorite(hass, config_entry, config, controller, fav async def test_select_radio_favorite_command_error( hass, config_entry, config, controller, favorites, caplog ): - """Tests command error loged when playing favorite.""" + """Tests command error logged when playing favorite.""" await setup_platform(hass, config_entry, config) player = controller.players[1] # Test set radio preset diff --git a/tests/components/homekit/test_accessories.py b/tests/components/homekit/test_accessories.py index f67e0e2478d..ddca9698987 100644 --- a/tests/components/homekit/test_accessories.py +++ b/tests/components/homekit/test_accessories.py @@ -246,7 +246,7 @@ async def test_linked_battery_sensor(hass, hk_driver, caplog): async def test_missing_linked_battery_sensor(hass, hk_driver, caplog): - """Test battery service with mising linked_battery_sensor.""" + """Test battery service with missing linked_battery_sensor.""" entity_id = "homekit.accessory" linked_battery = "sensor.battery" hass.states.async_set(entity_id, "open") diff --git a/tests/components/homekit_controller/test_alarm_control_panel.py b/tests/components/homekit_controller/test_alarm_control_panel.py index 39ad429d6ef..3b0662dc16d 100644 --- a/tests/components/homekit_controller/test_alarm_control_panel.py +++ b/tests/components/homekit_controller/test_alarm_control_panel.py @@ -16,7 +16,7 @@ def create_security_system_service(): targ_state.value = 0 # According to the spec, a battery-level characteristic is normally - # part of a seperate service. However as the code was written (which + # part of a separate service. However as the code was written (which # predates this test) the battery level would have to be part of the lock # service as it is here. targ_state = service.add_characteristic("battery-level") diff --git a/tests/components/homekit_controller/test_lock.py b/tests/components/homekit_controller/test_lock.py index 3b17ad13e41..d47b77a37eb 100644 --- a/tests/components/homekit_controller/test_lock.py +++ b/tests/components/homekit_controller/test_lock.py @@ -16,7 +16,7 @@ def create_lock_service(): targ_state.value = 0 # According to the spec, a battery-level characteristic is normally - # part of a seperate service. However as the code was written (which + # part of a separate service. However as the code was written (which # predates this test) the battery level would have to be part of the lock # service as it is here. targ_state = service.add_characteristic("battery-level") diff --git a/tests/components/hue/test_config_flow.py b/tests/components/hue/test_config_flow.py index b1f6785b0a7..75cba40dafb 100644 --- a/tests/components/hue/test_config_flow.py +++ b/tests/components/hue/test_config_flow.py @@ -215,7 +215,7 @@ async def test_flow_link_timeout(hass): async def test_flow_link_unknown_error(hass): - """Test if a unknown error happend during the linking processes.""" + """Test if a unknown error happened during the linking processes.""" mock_bridge = get_mock_bridge(mock_create_user=CoroutineMock(side_effect=OSError),) with patch( "homeassistant.components.hue.config_flow.discover_nupnp", diff --git a/tests/components/input_datetime/test_init.py b/tests/components/input_datetime/test_init.py index 67a23a61d8b..fa67bb2f8bf 100644 --- a/tests/components/input_datetime/test_init.py +++ b/tests/components/input_datetime/test_init.py @@ -307,7 +307,7 @@ async def test_restore_state(hass): async def test_default_value(hass): - """Test default value if none has been set via inital or restore state.""" + """Test default value if none has been set via initial or restore state.""" await async_setup_component( hass, DOMAIN, diff --git a/tests/components/mikrotik/test_config_flow.py b/tests/components/mikrotik/test_config_flow.py index 25f541e9287..37dbfad4d35 100644 --- a/tests/components/mikrotik/test_config_flow.py +++ b/tests/components/mikrotik/test_config_flow.py @@ -179,7 +179,7 @@ async def test_name_exists(hass, api): async def test_connection_error(hass, conn_error): - """Test error when connection is unsuccesful.""" + """Test error when connection is unsuccessful.""" result = await hass.config_entries.flow.async_init( mikrotik.DOMAIN, context={"source": "user"} diff --git a/tests/components/mikrotik/test_init.py b/tests/components/mikrotik/test_init.py index bf2b19c735c..ea7e22239b2 100644 --- a/tests/components/mikrotik/test_init.py +++ b/tests/components/mikrotik/test_init.py @@ -16,7 +16,7 @@ async def test_setup_with_no_config(hass): async def test_successful_config_entry(hass): - """Test config entry successfull setup.""" + """Test config entry successful setup.""" entry = MockConfigEntry(domain=mikrotik.DOMAIN, data=MOCK_DATA,) entry.add_to_hass(hass) mock_registry = Mock() diff --git a/tests/components/mqtt/test_config_flow.py b/tests/components/mqtt/test_config_flow.py index 889410927e5..aa72549152e 100644 --- a/tests/components/mqtt/test_config_flow.py +++ b/tests/components/mqtt/test_config_flow.py @@ -50,7 +50,7 @@ async def test_user_connection_works(hass, mock_try_connection, mock_finish_setu async def test_user_connection_fails(hass, mock_try_connection, mock_finish_setup): - """Test if connnection cannot be made.""" + """Test if connection cannot be made.""" mock_try_connection.return_value = False result = await hass.config_entries.flow.async_init( diff --git a/tests/components/mqtt/test_discovery.py b/tests/components/mqtt/test_discovery.py index 6320be3b772..e8da9b53a5e 100644 --- a/tests/components/mqtt/test_discovery.py +++ b/tests/components/mqtt/test_discovery.py @@ -229,7 +229,7 @@ async def test_discovery_expansion(hass, mqtt_mock, caplog): ' "name":"DiscoveryExpansionTest1 Device",' ' "mdl":"Generic",' ' "sw":"1.2.3.4",' - ' "mf":"Noone"' + ' "mf":"None"' " }" "}" ) diff --git a/tests/components/ring/test_light.py b/tests/components/ring/test_light.py index 6cc727b1a1c..5a2687e4cf9 100644 --- a/tests/components/ring/test_light.py +++ b/tests/components/ring/test_light.py @@ -7,7 +7,7 @@ from tests.common import load_fixture async def test_entity_registry(hass, requests_mock): - """Tests that the devices are registed in the entity registry.""" + """Tests that the devices are registered in the entity registry.""" await setup_platform(hass, LIGHT_DOMAIN) entity_registry = await hass.helpers.entity_registry.async_get_registry() diff --git a/tests/components/ring/test_switch.py b/tests/components/ring/test_switch.py index e2a86014f1c..6979fafc01d 100644 --- a/tests/components/ring/test_switch.py +++ b/tests/components/ring/test_switch.py @@ -7,7 +7,7 @@ from tests.common import load_fixture async def test_entity_registry(hass, requests_mock): - """Tests that the devices are registed in the entity registry.""" + """Tests that the devices are registered in the entity registry.""" await setup_platform(hass, SWITCH_DOMAIN) entity_registry = await hass.helpers.entity_registry.async_get_registry() diff --git a/tests/components/smhi/test_weather.py b/tests/components/smhi/test_weather.py index 92557f9d543..952e82c01be 100644 --- a/tests/components/smhi/test_weather.py +++ b/tests/components/smhi/test_weather.py @@ -75,7 +75,7 @@ async def test_setup_hass(hass: HomeAssistant, aioclient_mock) -> None: async def test_setup_plattform(hass): - """Test that setup plattform does nothing.""" + """Test that setup platform does nothing.""" assert await weather_smhi.async_setup_platform(hass, None, None) is None diff --git a/tests/components/solaredge/test_config_flow.py b/tests/components/solaredge/test_config_flow.py index 46f40dd80ef..759639362e4 100644 --- a/tests/components/solaredge/test_config_flow.py +++ b/tests/components/solaredge/test_config_flow.py @@ -18,7 +18,7 @@ API_KEY = "a1b2c3d4e5f6g7h8" @pytest.fixture(name="test_api") def mock_controller(): - """Mock a successfull Solaredge API.""" + """Mock a successful Solaredge API.""" api = Mock() api.get_details.return_value = {"details": {"status": "active"}} with patch("solaredge.Solaredge", return_value=api): diff --git a/tests/components/solarlog/test_config_flow.py b/tests/components/solarlog/test_config_flow.py index cd05cf13185..7828290560a 100644 --- a/tests/components/solarlog/test_config_flow.py +++ b/tests/components/solarlog/test_config_flow.py @@ -46,7 +46,7 @@ async def test_form(hass): @pytest.fixture(name="test_connect") def mock_controller(): - """Mock a successfull _host_in_configuration_exists.""" + """Mock a successful _host_in_configuration_exists.""" with patch( "homeassistant.components.solarlog.config_flow.SolarLogConfigFlow._test_connection", side_effect=lambda *_: mock_coro(True), diff --git a/tests/components/stream/test_hls.py b/tests/components/stream/test_hls.py index 293f8d1e4cf..888f56efb29 100644 --- a/tests/components/stream/test_hls.py +++ b/tests/components/stream/test_hls.py @@ -47,7 +47,7 @@ async def test_hls_stream(hass, hass_client): # Stop stream, if it hasn't quit already stream.stop() - # Ensure playlist not accessable after stream ends + # Ensure playlist not accessible after stream ends fail_response = await http_client.get(parsed_url.path) assert fail_response.status == 404 @@ -84,7 +84,7 @@ async def test_stream_timeout(hass, hass_client): future = dt_util.utcnow() + timedelta(minutes=5) async_fire_time_changed(hass, future) - # Ensure playlist not accessable + # Ensure playlist not accessible fail_response = await http_client.get(parsed_url.path) assert fail_response.status == 404 diff --git a/tests/components/tellduslive/test_config_flow.py b/tests/components/tellduslive/test_config_flow.py index f4972ada2c7..6ee265de8d5 100644 --- a/tests/components/tellduslive/test_config_flow.py +++ b/tests/components/tellduslive/test_config_flow.py @@ -239,7 +239,7 @@ async def test_abort_if_exception_generating_auth_url(hass, mock_tellduslive): async def test_discovery_already_configured(hass, mock_tellduslive): - """Test abort if alredy configured fires from discovery.""" + """Test abort if already configured fires from discovery.""" MockConfigEntry(domain="tellduslive", data={"host": "some-host"}).add_to_hass(hass) flow = init_config_flow(hass) diff --git a/tests/components/template/test_cover.py b/tests/components/template/test_cover.py index a0cccdcb18e..9980691085b 100644 --- a/tests/components/template/test_cover.py +++ b/tests/components/template/test_cover.py @@ -885,7 +885,7 @@ async def test_availability_template(hass, calls): async def test_availability_without_availability_template(hass, calls): - """Test that component is availble if there is no.""" + """Test that component is available if there is no.""" assert await setup.async_setup_component( hass, "cover", diff --git a/tests/components/tod/test_binary_sensor.py b/tests/components/tod/test_binary_sensor.py index 03581d16c09..1da0c16d43c 100644 --- a/tests/components/tod/test_binary_sensor.py +++ b/tests/components/tod/test_binary_sensor.py @@ -24,7 +24,7 @@ class TestBinarySensorTod(unittest.TestCase): def setup_method(self, method): """Set up things to be run when tests are started.""" self.hass = get_test_home_assistant() - self.hass.config.latitute = 50.27583 + self.hass.config.latitude = 50.27583 self.hass.config.longitude = 18.98583 def teardown_method(self, method): diff --git a/tests/components/unifi/test_controller.py b/tests/components/unifi/test_controller.py index 74137cf8a3a..a446bf914fb 100644 --- a/tests/components/unifi/test_controller.py +++ b/tests/components/unifi/test_controller.py @@ -307,7 +307,7 @@ async def test_get_controller_controller_unavailable(hass): async def test_get_controller_unknown_error(hass): - """Check that get_controller can handle unkown errors.""" + """Check that get_controller can handle unknown errors.""" with patch( "aiounifi.Controller.login", side_effect=aiounifi.AiounifiException ), pytest.raises(unifi.errors.AuthenticationRequired): diff --git a/tests/components/unifi/test_device_tracker.py b/tests/components/unifi/test_device_tracker.py index f123772a6ca..429e685c574 100644 --- a/tests/components/unifi/test_device_tracker.py +++ b/tests/components/unifi/test_device_tracker.py @@ -269,7 +269,7 @@ async def test_restoring_client(hass): async def test_dont_track_clients(hass): - """Test dont track clients config works.""" + """Test don't track clients config works.""" await setup_unifi_integration( hass, options={unifi.controller.CONF_TRACK_CLIENTS: False}, @@ -287,7 +287,7 @@ async def test_dont_track_clients(hass): async def test_dont_track_devices(hass): - """Test dont track devices config works.""" + """Test don't track devices config works.""" await setup_unifi_integration( hass, options={unifi.controller.CONF_TRACK_DEVICES: False}, @@ -305,7 +305,7 @@ async def test_dont_track_devices(hass): async def test_dont_track_wired_clients(hass): - """Test dont track wired clients config works.""" + """Test don't track wired clients config works.""" await setup_unifi_integration( hass, options={unifi.controller.CONF_TRACK_WIRED_CLIENTS: False}, diff --git a/tests/components/velbus/test_config_flow.py b/tests/components/velbus/test_config_flow.py index 66273e01f43..daeffb4ed1d 100644 --- a/tests/components/velbus/test_config_flow.py +++ b/tests/components/velbus/test_config_flow.py @@ -22,7 +22,7 @@ def mock_controller_assert(): @pytest.fixture(name="controller") def mock_controller(): - """Mock a successfull velbus controller.""" + """Mock a successful velbus controller.""" controller = Mock() with patch("velbus.Controller", return_value=controller): yield controller diff --git a/tests/components/vizio/conftest.py b/tests/components/vizio/conftest.py index fd78952bba4..f427e6d3e5a 100644 --- a/tests/components/vizio/conftest.py +++ b/tests/components/vizio/conftest.py @@ -72,7 +72,7 @@ def vizio_guess_device_type_fixture(): @pytest.fixture(name="vizio_cant_connect") def vizio_cant_connect_fixture(): - """Mock vizio device cant connect.""" + """Mock vizio device can't connect.""" with patch( "homeassistant.components.vizio.config_flow.VizioAsync.validate_ha_config", return_value=False, diff --git a/tests/components/vizio/test_config_flow.py b/tests/components/vizio/test_config_flow.py index 9805d2def46..41da5c0267b 100644 --- a/tests/components/vizio/test_config_flow.py +++ b/tests/components/vizio/test_config_flow.py @@ -316,7 +316,7 @@ async def test_zeroconf_flow( assert result["type"] == data_entry_flow.RESULT_TYPE_FORM assert result["step_id"] == "user" - # Apply discovery updates to entry to mimick when user hits submit without changing + # Apply discovery updates to entry to mimic when user hits submit without changing # defaults which were set from discovery parameters user_input = result["data_schema"](discovery_info) diff --git a/tests/components/yessssms/test_notify.py b/tests/components/yessssms/test_notify.py index f42f2f6af2e..f1eec4da942 100644 --- a/tests/components/yessssms/test_notify.py +++ b/tests/components/yessssms/test_notify.py @@ -36,7 +36,7 @@ def init_valid_settings(hass, config): @pytest.fixture(name="invalid_provider_settings") def init_invalid_provider_settings(hass, config): - """Set invalid provider data and initalize component.""" + """Set invalid provider data and initialize component.""" config["notify"][CONF_PROVIDER] = "FantasyMobile" # invalid provider return async_setup_component(hass, "notify", config) diff --git a/tests/components/zha/test_sensor.py b/tests/components/zha/test_sensor.py index 4c913e10034..b4fe0883bf3 100644 --- a/tests/components/zha/test_sensor.py +++ b/tests/components/zha/test_sensor.py @@ -110,7 +110,7 @@ async def async_build_devices(hass, zha_gateway, config_entry, cluster_ids): This will build devices for all cluster ids that exist in cluster_ids. They get added to the network and then the sensor component is loaded - which will cause sensor entites to get created for each device. + which will cause sensor entities to get created for each device. A dict containing relevant device info for testing is returned. It contains the entity id, zigpy device, and the zigbee cluster for the sensor. """ diff --git a/tests/components/zwave/test_climate.py b/tests/components/zwave/test_climate.py index 631bf0a0ce8..3586c992c08 100644 --- a/tests/components/zwave/test_climate.py +++ b/tests/components/zwave/test_climate.py @@ -342,7 +342,7 @@ def test_get_device_detects_single_setpoint_device(device_single_setpoint): def test_default_hvac_modes(): - """Test wether all hvac modes are included in default_hvac_modes.""" + """Test whether all hvac modes are included in default_hvac_modes.""" for hvac_mode in HVAC_MODES: assert hvac_mode in DEFAULT_HVAC_MODES diff --git a/tests/components/zwave/test_init.py b/tests/components/zwave/test_init.py index 540a3f96604..a8f72d2105c 100644 --- a/tests/components/zwave/test_init.py +++ b/tests/components/zwave/test_init.py @@ -100,7 +100,7 @@ async def test_network_key_validation(hass, mock_openzwave): async def test_erronous_network_key_fails_validation(hass, mock_openzwave): - """Test failing erronous network key validation.""" + """Test failing erroneous network key validation.""" test_values = [ ( "0x 01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, " diff --git a/tests/helpers/test_entity_component.py b/tests/helpers/test_entity_component.py index 07cea74c05f..41f84e65f6c 100644 --- a/tests/helpers/test_entity_component.py +++ b/tests/helpers/test_entity_component.py @@ -263,7 +263,7 @@ async def test_extract_from_service_no_group_expand(hass): async def test_setup_dependencies_platform(hass): """Test we setup the dependencies of a platform. - We're explictely testing that we process dependencies even if a component + We're explicitly testing that we process dependencies even if a component with the same name has already been loaded. """ mock_integration( @@ -305,7 +305,7 @@ async def test_setup_entry(hass): async def test_setup_entry_platform_not_exist(hass): - """Test setup entry fails if platform doesnt exist.""" + """Test setup entry fails if platform does not exist.""" component = EntityComponent(_LOGGER, DOMAIN, hass) entry = MockConfigEntry(domain="non_existing") diff --git a/tests/helpers/test_entity_platform.py b/tests/helpers/test_entity_platform.py index 8eea8ad004f..74105689957 100644 --- a/tests/helpers/test_entity_platform.py +++ b/tests/helpers/test_entity_platform.py @@ -394,7 +394,7 @@ async def test_using_prescribed_entity_id(hass): async def test_using_prescribed_entity_id_with_unique_id(hass): - """Test for ammending predefined entity ID because currently exists.""" + """Test for amending predefined entity ID because currently exists.""" component = EntityComponent(_LOGGER, DOMAIN, hass) await component.async_add_entities([MockEntity(entity_id="test_domain.world")]) @@ -839,7 +839,7 @@ async def test_override_restored_entities(hass): async def test_platform_with_no_setup(hass, caplog): - """Test setting up a platform that doesnt' support setup.""" + """Test setting up a platform that does not support setup.""" entity_platform = MockEntityPlatform( hass, domain="mock-integration", platform_name="mock-platform", platform=None ) diff --git a/tests/helpers/test_event.py b/tests/helpers/test_event.py index cef8baec70e..313710d03b7 100644 --- a/tests/helpers/test_event.py +++ b/tests/helpers/test_event.py @@ -475,7 +475,7 @@ async def test_track_sunrise_update_location(hass): with patch("homeassistant.util.dt.utcnow", return_value=utc_now): async_track_sunrise(hass, lambda: runs.append(1)) - # Mimick sunrise + # Mimic sunrise _send_time_changed(hass, next_rising) await hass.async_block_till_done() assert len(runs) == 1 @@ -485,7 +485,7 @@ async def test_track_sunrise_update_location(hass): await hass.config.async_update(latitude=40.755931, longitude=-73.984606) await hass.async_block_till_done() - # Mimick sunrise + # Mimic sunrise _send_time_changed(hass, next_rising) await hass.async_block_till_done() # Did not increase @@ -501,7 +501,7 @@ async def test_track_sunrise_update_location(hass): break mod += 1 - # Mimick sunrise at new location + # Mimic sunrise at new location _send_time_changed(hass, next_rising) await hass.async_block_till_done() assert len(runs) == 2 diff --git a/tests/helpers/test_service.py b/tests/helpers/test_service.py index 8d28bc73b88..55c2c67cee2 100644 --- a/tests/helpers/test_service.py +++ b/tests/helpers/test_service.py @@ -348,7 +348,7 @@ async def test_call_context_user_not_exist(hass): async def test_call_context_target_all(hass, mock_service_platform_call, mock_entities): - """Check we only target allowed entities if targetting all.""" + """Check we only target allowed entities if targeting all.""" with patch( "homeassistant.auth.AuthManager.async_get_user", return_value=mock_coro( @@ -473,7 +473,7 @@ async def test_call_no_context_target_specific( async def test_call_with_match_all( hass, mock_service_platform_call, mock_entities, caplog ): - """Check we only target allowed entities if targetting all.""" + """Check we only target allowed entities if targeting all.""" await service.entity_service_call( hass, [Mock(entities=mock_entities)], diff --git a/tests/test_config.py b/tests/test_config.py index 1fc92ee954b..319ef841f46 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -576,7 +576,7 @@ async def test_merge(merge_log_err, hass): async def test_merge_try_falsy(merge_log_err, hass): - """Ensure we dont add falsy items like empty OrderedDict() to list.""" + """Ensure we don't add falsy items like empty OrderedDict() to list.""" packages = { "pack_falsy_to_lst": {"automation": OrderedDict()}, "pack_list2": {"light": OrderedDict()}, diff --git a/tox.ini b/tox.ini index 17253e1d1e1..7060a46b764 100644 --- a/tox.ini +++ b/tox.ini @@ -36,6 +36,7 @@ deps = commands = python -m script.gen_requirements_all validate python -m script.hassfest validate + pre-commit run codespell {posargs: --all-files} pre-commit run flake8 {posargs: --all-files} pre-commit run bandit {posargs: --all-files}