diff --git a/homeassistant/components/bmw_connected_drive/binary_sensor.py b/homeassistant/components/bmw_connected_drive/binary_sensor.py index 43beb2cbf81..df25efb6d5e 100644 --- a/homeassistant/components/bmw_connected_drive/binary_sensor.py +++ b/homeassistant/components/bmw_connected_drive/binary_sensor.py @@ -38,10 +38,10 @@ ALLOWED_CONDITION_BASED_SERVICE_KEYS = { "VEHICLE_CHECK", "VEHICLE_TUV", } -LOGGED_CONDITION_BASED_SERVICE_WARNINGS = set() +LOGGED_CONDITION_BASED_SERVICE_WARNINGS: set[str] = set() ALLOWED_CHECK_CONTROL_MESSAGE_KEYS = {"ENGINE_OIL", "TIRE_PRESSURE"} -LOGGED_CHECK_CONTROL_MESSAGE_WARNINGS = set() +LOGGED_CHECK_CONTROL_MESSAGE_WARNINGS: set[str] = set() def _condition_based_services( diff --git a/homeassistant/components/camera/img_util.py b/homeassistant/components/camera/img_util.py index 87bc0e14fba..cfa8399c4d5 100644 --- a/homeassistant/components/camera/img_util.py +++ b/homeassistant/components/camera/img_util.py @@ -2,7 +2,7 @@ from __future__ import annotations import logging -from typing import TYPE_CHECKING, cast +from typing import TYPE_CHECKING, Literal, cast SUPPORTED_SCALING_FACTORS = [(7, 8), (3, 4), (5, 8), (1, 2), (3, 8), (1, 4), (1, 8)] @@ -78,10 +78,10 @@ class TurboJPEGSingleton: seconds. """ - __instance = None + __instance: TurboJPEG | Literal[False] | None = None @staticmethod - def instance() -> TurboJPEG: + def instance() -> TurboJPEG | Literal[False] | None: """Singleton for TurboJPEG.""" if TurboJPEGSingleton.__instance is None: TurboJPEGSingleton() diff --git a/homeassistant/components/fastdotcom/sensor.py b/homeassistant/components/fastdotcom/sensor.py index 1df431d0bf3..4f00dd5a543 100644 --- a/homeassistant/components/fastdotcom/sensor.py +++ b/homeassistant/components/fastdotcom/sensor.py @@ -32,7 +32,6 @@ class SpeedtestSensor(RestoreEntity, SensorEntity): _attr_native_unit_of_measurement = UnitOfDataRate.MEGABITS_PER_SECOND _attr_icon = "mdi:speedometer" _attr_should_poll = False - _attr_native_value = None def __init__(self, speedtest_data: dict[str, Any]) -> None: """Initialize the sensor.""" diff --git a/homeassistant/components/logbook/queries/common.py b/homeassistant/components/logbook/queries/common.py index 424a174b7af..ba26983dd24 100644 --- a/homeassistant/components/logbook/queries/common.py +++ b/homeassistant/components/logbook/queries/common.py @@ -1,6 +1,8 @@ """Queries for logbook.""" from __future__ import annotations +from typing import Final + import sqlalchemy from sqlalchemy import select from sqlalchemy.orm import Query @@ -33,7 +35,7 @@ ALWAYS_CONTINUOUS_ENTITY_ID_LIKE = like_domain_matchers(ALWAYS_CONTINUOUS_DOMAIN UNIT_OF_MEASUREMENT_JSON = '"unit_of_measurement":' UNIT_OF_MEASUREMENT_JSON_LIKE = f"%{UNIT_OF_MEASUREMENT_JSON}%" -PSUEDO_EVENT_STATE_CHANGED = None +PSUEDO_EVENT_STATE_CHANGED: Final = None # Since we don't store event_types and None # and we don't store state_changed in events # we use a NULL for state_changed events diff --git a/homeassistant/components/mqtt/config_flow.py b/homeassistant/components/mqtt/config_flow.py index a9a78b32bd6..1af68cd5bac 100644 --- a/homeassistant/components/mqtt/config_flow.py +++ b/homeassistant/components/mqtt/config_flow.py @@ -159,7 +159,7 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN): VERSION = 1 - _hassio_discovery = None + _hassio_discovery: dict[str, Any] | None = None @staticmethod @callback diff --git a/homeassistant/components/mqtt/sensor.py b/homeassistant/components/mqtt/sensor.py index 656de35232b..33c1b9d9fb8 100644 --- a/homeassistant/components/mqtt/sensor.py +++ b/homeassistant/components/mqtt/sensor.py @@ -154,7 +154,7 @@ class MqttSensor(MqttEntity, RestoreSensor): """Representation of a sensor that can be updated using MQTT.""" _entity_id_format = ENTITY_ID_FORMAT - _attr_last_reset = None + _attr_last_reset: datetime | None = None _attributes_extra_blocked = MQTT_SENSOR_ATTRIBUTES_BLOCKED _expire_after: int | None _expired: bool | None diff --git a/homeassistant/components/netatmo/const.py b/homeassistant/components/netatmo/const.py index 50578eb8223..3e489fe8ea5 100644 --- a/homeassistant/components/netatmo/const.py +++ b/homeassistant/components/netatmo/const.py @@ -63,7 +63,6 @@ DATA_PERSONS = "netatmo_persons" DATA_SCHEDULES = "netatmo_schedules" NETATMO_EVENT = "netatmo_event" -NETATMO_WEBHOOK_URL = None DEFAULT_DISCOVERY = True DEFAULT_PERSON = "unknown" diff --git a/homeassistant/components/stream/core.py b/homeassistant/components/stream/core.py index 2ae4fc5b31c..a499d0cc114 100644 --- a/homeassistant/components/stream/core.py +++ b/homeassistant/components/stream/core.py @@ -374,7 +374,6 @@ class StreamView(HomeAssistantView): """ requires_auth = False - platform = None async def get( self, request: web.Request, token: str, sequence: str = "", part_num: str = "" diff --git a/homeassistant/components/switchbee/cover.py b/homeassistant/components/switchbee/cover.py index a9eed00801a..ac0de3622f1 100644 --- a/homeassistant/components/switchbee/cover.py +++ b/homeassistant/components/switchbee/cover.py @@ -81,7 +81,7 @@ class SwitchBeeCoverEntity(SwitchBeeDeviceEntity[SwitchBeeShutter], CoverEntity) | CoverEntityFeature.SET_POSITION | CoverEntityFeature.STOP ) - _attr_is_closed = None + _attr_is_closed: bool | None = None @callback def _handle_coordinator_update(self) -> None: