Add type ignore error codes [N-Z] (#66779)

This commit is contained in:
Marc Mueller 2022-02-18 09:41:12 +01:00 committed by GitHub
parent d7170f43c3
commit 67e94f2b4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 11 deletions

View file

@ -489,7 +489,7 @@ class NestFlowHandler(
config_path = info["nest_conf_path"]
if not await self.hass.async_add_executor_job(os.path.isfile, config_path):
self.flow_impl = DOMAIN # type: ignore
self.flow_impl = DOMAIN # type: ignore[assignment]
return await self.async_step_link()
flow = self.hass.data[DATA_FLOW_IMPL][DOMAIN]

View file

@ -106,31 +106,31 @@ class AirSensor(AirQualityEntity):
"""Return the name of the sensor."""
return self._name
@property # type: ignore
@property # type: ignore[misc]
@round_state
def air_quality_index(self):
"""Return the Air Quality Index (AQI)."""
return self._api.data.get("aqi")
@property # type: ignore
@property # type: ignore[misc]
@round_state
def nitrogen_dioxide(self):
"""Return the NO2 (nitrogen dioxide) level."""
return self._api.data.get("no2_concentration")
@property # type: ignore
@property # type: ignore[misc]
@round_state
def ozone(self):
"""Return the O3 (ozone) level."""
return self._api.data.get("o3_concentration")
@property # type: ignore
@property # type: ignore[misc]
@round_state
def particulate_matter_2_5(self):
"""Return the particulate matter 2.5 level."""
return self._api.data.get("pm25_concentration")
@property # type: ignore
@property # type: ignore[misc]
@round_state
def particulate_matter_10(self):
"""Return the particulate matter 10 level."""

View file

@ -178,7 +178,7 @@ class BaseNotificationService:
# While not purely typed, it makes typehinting more useful for us
# and removes the need for constant None checks or asserts.
hass: HomeAssistant = None # type: ignore
hass: HomeAssistant = None # type: ignore[assignment]
# Name => target
registered_targets: dict[str, str]
@ -246,7 +246,7 @@ class BaseNotificationService:
if hasattr(self, "targets"):
stale_targets = set(self.registered_targets)
for name, target in self.targets.items(): # type: ignore
for name, target in self.targets.items(): # type: ignore[attr-defined]
target_name = slugify(f"{self._target_service_name_prefix}_{name}")
if target_name in stale_targets:
stale_targets.remove(target_name)

View file

@ -464,7 +464,7 @@ class TibberSensorRT(TibberSensor, update_coordinator.CoordinatorEntity):
ts_local = dt_util.parse_datetime(live_measurement["timestamp"])
if ts_local is not None:
if self.last_reset is None or (
state < 0.5 * self.native_value # type: ignore # native_value is float
state < 0.5 * self.native_value # type: ignore[operator] # native_value is float
and (
ts_local.hour == 0
or (ts_local - self.last_reset) > timedelta(hours=24)

View file

@ -96,7 +96,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
device: SmartDevice = hass_data[entry.entry_id].device
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
hass_data.pop(entry.entry_id)
await device.protocol.close() # type: ignore
await device.protocol.close() # type: ignore[no-untyped-call]
return unload_ok

View file

@ -242,7 +242,7 @@ class ZWaveClimate(ZWaveBaseEntity, ClimateEntity):
if self._current_mode is None:
# Thermostat(valve) with no support for setting a mode is considered heating-only
return [ThermostatSetpointType.HEATING]
return THERMOSTAT_MODE_SETPOINT_MAP.get(int(self._current_mode.value), []) # type: ignore
return THERMOSTAT_MODE_SETPOINT_MAP.get(int(self._current_mode.value), []) # type: ignore[no-any-return]
@property
def temperature_unit(self) -> str: