From d7170f43c3c3b8c7e0b217f839b1fad494cef74f Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 18 Feb 2022 09:38:15 +0100 Subject: [PATCH] Add type ignore error codes [A-L] (#66778) --- homeassistant/components/adguard/__init__.py | 2 +- homeassistant/components/arcam_fmj/device_trigger.py | 2 +- homeassistant/components/azure_devops/__init__.py | 2 +- homeassistant/components/azure_event_hub/client.py | 2 +- homeassistant/components/hue/v2/device_trigger.py | 2 +- homeassistant/components/hue/v2/hue_event.py | 2 +- homeassistant/components/insteon/ipdb.py | 2 +- homeassistant/components/iqvia/sensor.py | 2 +- homeassistant/components/knx/config_flow.py | 2 +- homeassistant/components/lookin/climate.py | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/adguard/__init__.py b/homeassistant/components/adguard/__init__.py index 8c90efcd44c..1f2645e227c 100644 --- a/homeassistant/components/adguard/__init__.py +++ b/homeassistant/components/adguard/__init__.py @@ -205,7 +205,7 @@ class AdGuardHomeDeviceEntity(AdGuardHomeEntity): return DeviceInfo( entry_type=DeviceEntryType.SERVICE, identifiers={ - (DOMAIN, self.adguard.host, self.adguard.port, self.adguard.base_path) # type: ignore + (DOMAIN, self.adguard.host, self.adguard.port, self.adguard.base_path) # type: ignore[arg-type] }, manufacturer="AdGuard Team", name="AdGuard Home", diff --git a/homeassistant/components/arcam_fmj/device_trigger.py b/homeassistant/components/arcam_fmj/device_trigger.py index b33710bf936..2b1a3bf3a19 100644 --- a/homeassistant/components/arcam_fmj/device_trigger.py +++ b/homeassistant/components/arcam_fmj/device_trigger.py @@ -76,7 +76,7 @@ async def async_attach_trigger( job, { "trigger": { - **trigger_data, # type: ignore # https://github.com/python/mypy/issues/9117 + **trigger_data, # type: ignore[arg-type] # https://github.com/python/mypy/issues/9117 **config, "description": f"{DOMAIN} - {entity_id}", } diff --git a/homeassistant/components/azure_devops/__init__.py b/homeassistant/components/azure_devops/__init__.py index 213dc19ff9e..1b1c65ae6d1 100644 --- a/homeassistant/components/azure_devops/__init__.py +++ b/homeassistant/components/azure_devops/__init__.py @@ -123,7 +123,7 @@ class AzureDevOpsDeviceEntity(AzureDevOpsEntity): """Return device information about this Azure DevOps instance.""" return DeviceInfo( entry_type=DeviceEntryType.SERVICE, - identifiers={(DOMAIN, self._organization, self._project_name)}, # type: ignore + identifiers={(DOMAIN, self._organization, self._project_name)}, # type: ignore[arg-type] manufacturer=self._organization, name=self._project_name, ) diff --git a/homeassistant/components/azure_event_hub/client.py b/homeassistant/components/azure_event_hub/client.py index 1a5aa330cc8..27a4eabf535 100644 --- a/homeassistant/components/azure_event_hub/client.py +++ b/homeassistant/components/azure_event_hub/client.py @@ -64,7 +64,7 @@ class AzureEventHubClientSAS(AzureEventHubClient): return EventHubProducerClient( fully_qualified_namespace=f"{self.event_hub_namespace}.servicebus.windows.net", eventhub_name=self.event_hub_instance_name, - credential=EventHubSharedKeyCredential( # type: ignore + credential=EventHubSharedKeyCredential( # type: ignore[arg-type] policy=self.event_hub_sas_policy, key=self.event_hub_sas_key ), **ADDITIONAL_ARGS, diff --git a/homeassistant/components/hue/v2/device_trigger.py b/homeassistant/components/hue/v2/device_trigger.py index 3f474cdf70b..cab21b63d6d 100644 --- a/homeassistant/components/hue/v2/device_trigger.py +++ b/homeassistant/components/hue/v2/device_trigger.py @@ -72,7 +72,7 @@ def check_invalid_device_trigger( "Please manually fix the outdated automation(s) once to fix this issue." ) if automation_info: - automation_id = automation_info["variables"]["this"]["attributes"]["id"] # type: ignore + automation_id = automation_info["variables"]["this"]["attributes"]["id"] # type: ignore[index] msg += f"\n\n[Check it out](/config/automation/edit/{automation_id})." persistent_notification.async_create( bridge.hass, diff --git a/homeassistant/components/hue/v2/hue_event.py b/homeassistant/components/hue/v2/hue_event.py index 1d45293012c..4b9adf16226 100644 --- a/homeassistant/components/hue/v2/hue_event.py +++ b/homeassistant/components/hue/v2/hue_event.py @@ -47,7 +47,7 @@ async def async_setup_hue_events(bridge: "HueBridge"): data = { # send slugified entity name as id = backwards compatibility with previous version CONF_ID: slugify(f"{hue_device.metadata.name} Button"), - CONF_DEVICE_ID: device.id, # type: ignore + CONF_DEVICE_ID: device.id, # type: ignore[union-attr] CONF_UNIQUE_ID: hue_resource.id, CONF_TYPE: hue_resource.button.last_event.value, CONF_SUBTYPE: hue_resource.metadata.control_id, diff --git a/homeassistant/components/insteon/ipdb.py b/homeassistant/components/insteon/ipdb.py index 9b32bc40043..6866e052368 100644 --- a/homeassistant/components/insteon/ipdb.py +++ b/homeassistant/components/insteon/ipdb.py @@ -110,4 +110,4 @@ def get_device_platforms(device): def get_platform_groups(device, domain) -> dict: """Return the platforms that a device belongs in.""" - return DEVICE_PLATFORM.get(type(device), {}).get(domain, {}) # type: ignore + return DEVICE_PLATFORM.get(type(device), {}).get(domain, {}) # type: ignore[attr-defined] diff --git a/homeassistant/components/iqvia/sensor.py b/homeassistant/components/iqvia/sensor.py index 46da1aea0aa..51f2969e9fe 100644 --- a/homeassistant/components/iqvia/sensor.py +++ b/homeassistant/components/iqvia/sensor.py @@ -161,7 +161,7 @@ def calculate_trend(indices: list[float]) -> str: """Calculate the "moving average" of a set of indices.""" index_range = np.arange(0, len(indices)) index_array = np.array(indices) - linear_fit = np.polyfit(index_range, index_array, 1) # type: ignore + linear_fit = np.polyfit(index_range, index_array, 1) # type: ignore[no-untyped-call] slope = round(linear_fit[0], 2) if slope > 0: diff --git a/homeassistant/components/knx/config_flow.py b/homeassistant/components/knx/config_flow.py index 4f7a9d6723c..6bc6085d0e5 100644 --- a/homeassistant/components/knx/config_flow.py +++ b/homeassistant/components/knx/config_flow.py @@ -317,7 +317,7 @@ class KNXOptionsFlowHandler(OptionsFlow): CONF_KNX_TUNNELING, CONF_KNX_ROUTING, ] - self.current_config = self.config_entry.data # type: ignore + self.current_config = self.config_entry.data # type: ignore[assignment] data_schema = { vol.Required( diff --git a/homeassistant/components/lookin/climate.py b/homeassistant/components/lookin/climate.py index ab6b53978be..e661c14a151 100644 --- a/homeassistant/components/lookin/climate.py +++ b/homeassistant/components/lookin/climate.py @@ -100,7 +100,7 @@ async def async_setup_entry( class ConditionerEntity(LookinCoordinatorEntity, ClimateEntity): """An aircon or heat pump.""" - _attr_current_humidity: float | None = None # type: ignore + _attr_current_humidity: float | None = None # type: ignore[assignment] _attr_temperature_unit = TEMP_CELSIUS _attr_supported_features: int = SUPPORT_FLAGS _attr_fan_modes: list[str] = LOOKIN_FAN_MODE_IDX_TO_HASS