Add type ignore error codes [N-Z] (#66779)
This commit is contained in:
parent
d7170f43c3
commit
67e94f2b4b
6 changed files with 11 additions and 11 deletions
|
@ -489,7 +489,7 @@ class NestFlowHandler(
|
||||||
config_path = info["nest_conf_path"]
|
config_path = info["nest_conf_path"]
|
||||||
|
|
||||||
if not await self.hass.async_add_executor_job(os.path.isfile, config_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()
|
return await self.async_step_link()
|
||||||
|
|
||||||
flow = self.hass.data[DATA_FLOW_IMPL][DOMAIN]
|
flow = self.hass.data[DATA_FLOW_IMPL][DOMAIN]
|
||||||
|
|
|
@ -106,31 +106,31 @@ class AirSensor(AirQualityEntity):
|
||||||
"""Return the name of the sensor."""
|
"""Return the name of the sensor."""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property # type: ignore
|
@property # type: ignore[misc]
|
||||||
@round_state
|
@round_state
|
||||||
def air_quality_index(self):
|
def air_quality_index(self):
|
||||||
"""Return the Air Quality Index (AQI)."""
|
"""Return the Air Quality Index (AQI)."""
|
||||||
return self._api.data.get("aqi")
|
return self._api.data.get("aqi")
|
||||||
|
|
||||||
@property # type: ignore
|
@property # type: ignore[misc]
|
||||||
@round_state
|
@round_state
|
||||||
def nitrogen_dioxide(self):
|
def nitrogen_dioxide(self):
|
||||||
"""Return the NO2 (nitrogen dioxide) level."""
|
"""Return the NO2 (nitrogen dioxide) level."""
|
||||||
return self._api.data.get("no2_concentration")
|
return self._api.data.get("no2_concentration")
|
||||||
|
|
||||||
@property # type: ignore
|
@property # type: ignore[misc]
|
||||||
@round_state
|
@round_state
|
||||||
def ozone(self):
|
def ozone(self):
|
||||||
"""Return the O3 (ozone) level."""
|
"""Return the O3 (ozone) level."""
|
||||||
return self._api.data.get("o3_concentration")
|
return self._api.data.get("o3_concentration")
|
||||||
|
|
||||||
@property # type: ignore
|
@property # type: ignore[misc]
|
||||||
@round_state
|
@round_state
|
||||||
def particulate_matter_2_5(self):
|
def particulate_matter_2_5(self):
|
||||||
"""Return the particulate matter 2.5 level."""
|
"""Return the particulate matter 2.5 level."""
|
||||||
return self._api.data.get("pm25_concentration")
|
return self._api.data.get("pm25_concentration")
|
||||||
|
|
||||||
@property # type: ignore
|
@property # type: ignore[misc]
|
||||||
@round_state
|
@round_state
|
||||||
def particulate_matter_10(self):
|
def particulate_matter_10(self):
|
||||||
"""Return the particulate matter 10 level."""
|
"""Return the particulate matter 10 level."""
|
||||||
|
|
|
@ -178,7 +178,7 @@ class BaseNotificationService:
|
||||||
|
|
||||||
# While not purely typed, it makes typehinting more useful for us
|
# While not purely typed, it makes typehinting more useful for us
|
||||||
# and removes the need for constant None checks or asserts.
|
# and removes the need for constant None checks or asserts.
|
||||||
hass: HomeAssistant = None # type: ignore
|
hass: HomeAssistant = None # type: ignore[assignment]
|
||||||
|
|
||||||
# Name => target
|
# Name => target
|
||||||
registered_targets: dict[str, str]
|
registered_targets: dict[str, str]
|
||||||
|
@ -246,7 +246,7 @@ class BaseNotificationService:
|
||||||
if hasattr(self, "targets"):
|
if hasattr(self, "targets"):
|
||||||
stale_targets = set(self.registered_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}")
|
target_name = slugify(f"{self._target_service_name_prefix}_{name}")
|
||||||
if target_name in stale_targets:
|
if target_name in stale_targets:
|
||||||
stale_targets.remove(target_name)
|
stale_targets.remove(target_name)
|
||||||
|
|
|
@ -464,7 +464,7 @@ class TibberSensorRT(TibberSensor, update_coordinator.CoordinatorEntity):
|
||||||
ts_local = dt_util.parse_datetime(live_measurement["timestamp"])
|
ts_local = dt_util.parse_datetime(live_measurement["timestamp"])
|
||||||
if ts_local is not None:
|
if ts_local is not None:
|
||||||
if self.last_reset is None or (
|
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 (
|
and (
|
||||||
ts_local.hour == 0
|
ts_local.hour == 0
|
||||||
or (ts_local - self.last_reset) > timedelta(hours=24)
|
or (ts_local - self.last_reset) > timedelta(hours=24)
|
||||||
|
|
|
@ -96,7 +96,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
device: SmartDevice = hass_data[entry.entry_id].device
|
device: SmartDevice = hass_data[entry.entry_id].device
|
||||||
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
|
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
|
||||||
hass_data.pop(entry.entry_id)
|
hass_data.pop(entry.entry_id)
|
||||||
await device.protocol.close() # type: ignore
|
await device.protocol.close() # type: ignore[no-untyped-call]
|
||||||
return unload_ok
|
return unload_ok
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,7 @@ class ZWaveClimate(ZWaveBaseEntity, ClimateEntity):
|
||||||
if self._current_mode is None:
|
if self._current_mode is None:
|
||||||
# Thermostat(valve) with no support for setting a mode is considered heating-only
|
# Thermostat(valve) with no support for setting a mode is considered heating-only
|
||||||
return [ThermostatSetpointType.HEATING]
|
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
|
@property
|
||||||
def temperature_unit(self) -> str:
|
def temperature_unit(self) -> str:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue