Add type ignore error codes [A-L] (#66778)

This commit is contained in:
Marc Mueller 2022-02-18 09:38:15 +01:00 committed by GitHub
parent 98982c86e4
commit d7170f43c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 10 additions and 10 deletions

View File

@ -205,7 +205,7 @@ class AdGuardHomeDeviceEntity(AdGuardHomeEntity):
return DeviceInfo( return DeviceInfo(
entry_type=DeviceEntryType.SERVICE, entry_type=DeviceEntryType.SERVICE,
identifiers={ 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", manufacturer="AdGuard Team",
name="AdGuard Home", name="AdGuard Home",

View File

@ -76,7 +76,7 @@ async def async_attach_trigger(
job, job,
{ {
"trigger": { "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, **config,
"description": f"{DOMAIN} - {entity_id}", "description": f"{DOMAIN} - {entity_id}",
} }

View File

@ -123,7 +123,7 @@ class AzureDevOpsDeviceEntity(AzureDevOpsEntity):
"""Return device information about this Azure DevOps instance.""" """Return device information about this Azure DevOps instance."""
return DeviceInfo( return DeviceInfo(
entry_type=DeviceEntryType.SERVICE, 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, manufacturer=self._organization,
name=self._project_name, name=self._project_name,
) )

View File

@ -64,7 +64,7 @@ class AzureEventHubClientSAS(AzureEventHubClient):
return EventHubProducerClient( return EventHubProducerClient(
fully_qualified_namespace=f"{self.event_hub_namespace}.servicebus.windows.net", fully_qualified_namespace=f"{self.event_hub_namespace}.servicebus.windows.net",
eventhub_name=self.event_hub_instance_name, 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 policy=self.event_hub_sas_policy, key=self.event_hub_sas_key
), ),
**ADDITIONAL_ARGS, **ADDITIONAL_ARGS,

View File

@ -72,7 +72,7 @@ def check_invalid_device_trigger(
"Please manually fix the outdated automation(s) once to fix this issue." "Please manually fix the outdated automation(s) once to fix this issue."
) )
if automation_info: 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})." msg += f"\n\n[Check it out](/config/automation/edit/{automation_id})."
persistent_notification.async_create( persistent_notification.async_create(
bridge.hass, bridge.hass,

View File

@ -47,7 +47,7 @@ async def async_setup_hue_events(bridge: "HueBridge"):
data = { data = {
# send slugified entity name as id = backwards compatibility with previous version # send slugified entity name as id = backwards compatibility with previous version
CONF_ID: slugify(f"{hue_device.metadata.name} Button"), 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_UNIQUE_ID: hue_resource.id,
CONF_TYPE: hue_resource.button.last_event.value, CONF_TYPE: hue_resource.button.last_event.value,
CONF_SUBTYPE: hue_resource.metadata.control_id, CONF_SUBTYPE: hue_resource.metadata.control_id,

View File

@ -110,4 +110,4 @@ def get_device_platforms(device):
def get_platform_groups(device, domain) -> dict: def get_platform_groups(device, domain) -> dict:
"""Return the platforms that a device belongs in.""" """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]

View File

@ -161,7 +161,7 @@ def calculate_trend(indices: list[float]) -> str:
"""Calculate the "moving average" of a set of indices.""" """Calculate the "moving average" of a set of indices."""
index_range = np.arange(0, len(indices)) index_range = np.arange(0, len(indices))
index_array = np.array(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) slope = round(linear_fit[0], 2)
if slope > 0: if slope > 0:

View File

@ -317,7 +317,7 @@ class KNXOptionsFlowHandler(OptionsFlow):
CONF_KNX_TUNNELING, CONF_KNX_TUNNELING,
CONF_KNX_ROUTING, CONF_KNX_ROUTING,
] ]
self.current_config = self.config_entry.data # type: ignore self.current_config = self.config_entry.data # type: ignore[assignment]
data_schema = { data_schema = {
vol.Required( vol.Required(

View File

@ -100,7 +100,7 @@ async def async_setup_entry(
class ConditionerEntity(LookinCoordinatorEntity, ClimateEntity): class ConditionerEntity(LookinCoordinatorEntity, ClimateEntity):
"""An aircon or heat pump.""" """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_temperature_unit = TEMP_CELSIUS
_attr_supported_features: int = SUPPORT_FLAGS _attr_supported_features: int = SUPPORT_FLAGS
_attr_fan_modes: list[str] = LOOKIN_FAN_MODE_IDX_TO_HASS _attr_fan_modes: list[str] = LOOKIN_FAN_MODE_IDX_TO_HASS