Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/airos/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/airos",
"iot_class": "local_polling",
"quality_scale": "bronze",
"requirements": ["airos==0.5.3"]
"requirements": ["airos==0.5.4"]
}
2 changes: 2 additions & 0 deletions homeassistant/components/airthings_ble/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
),
}

PARALLEL_UPDATES = 0


@callback
def async_migrate(hass: HomeAssistant, address: str, sensor_name: str) -> None:
Expand Down
6 changes: 2 additions & 4 deletions homeassistant/components/asuswrt/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

from __future__ import annotations

from typing import Any, TypeVar

T = TypeVar("T", dict[str, Any], list[Any], None)
from typing import Any

TRANSLATION_MAP = {
"wan_rx": "sensor_rx_bytes",
Expand Down Expand Up @@ -36,7 +34,7 @@ def clean_dict(raw: dict[str, Any]) -> dict[str, Any]:
return {k: v for k, v in raw.items() if v is not None or k.endswith("state")}


def translate_to_legacy(raw: T) -> T:
def translate_to_legacy[T: (dict[str, Any], list[Any], None)](raw: T) -> T:
"""Translate raw data to legacy format for dicts and lists."""

if raw is None:
Expand Down
20 changes: 0 additions & 20 deletions homeassistant/components/camera/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@
from homeassistant.core import Event, HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_validation as cv, issue_registry as ir
from homeassistant.helpers.deprecation import (
DeprecatedConstantEnum,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
from homeassistant.helpers.entity import Entity, EntityDescription
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.event import async_track_time_interval
Expand Down Expand Up @@ -118,12 +112,6 @@
ATTR_MEDIA_PLAYER: Final = "media_player"
ATTR_FORMAT: Final = "format"

# These constants are deprecated as of Home Assistant 2024.10
# Please use the StreamType enum instead.
_DEPRECATED_STATE_RECORDING = DeprecatedConstantEnum(CameraState.RECORDING, "2025.10")
_DEPRECATED_STATE_STREAMING = DeprecatedConstantEnum(CameraState.STREAMING, "2025.10")
_DEPRECATED_STATE_IDLE = DeprecatedConstantEnum(CameraState.IDLE, "2025.10")


class CameraEntityFeature(IntFlag):
"""Supported features of the camera entity."""
Expand Down Expand Up @@ -1117,11 +1105,3 @@ async def async_handle_record_service(
duration=service_call.data[CONF_DURATION],
lookback=service_call.data[CONF_LOOKBACK],
)


# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
4 changes: 3 additions & 1 deletion homeassistant/components/growatt_server/coordinator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Coordinator module for managing Growatt data fetching."""

from __future__ import annotations

import datetime
import json
import logging
Expand Down Expand Up @@ -145,7 +147,7 @@ def get_currency(self):
return self.data.get("currency")

def get_data(
self, entity_description: "GrowattSensorEntityDescription"
self, entity_description: GrowattSensorEntityDescription
) -> str | int | float | None:
"""Get the data."""
variable = entity_description.api_key
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/hassio/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"documentation": "https://www.home-assistant.io/integrations/hassio",
"iot_class": "local_polling",
"quality_scale": "internal",
"requirements": ["aiohasupervisor==0.3.3b0"],
"requirements": ["aiohasupervisor==0.3.3"],
"single_config_entry": true
}
2 changes: 1 addition & 1 deletion homeassistant/components/inkbird/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .const import CONF_DEVICE_DATA, CONF_DEVICE_TYPE
from .coordinator import INKBIRDActiveBluetoothProcessorCoordinator

INKBIRDConfigEntry = ConfigEntry[INKBIRDActiveBluetoothProcessorCoordinator]
type INKBIRDConfigEntry = ConfigEntry[INKBIRDActiveBluetoothProcessorCoordinator]

PLATFORMS: list[Platform] = [Platform.SENSOR]

Expand Down
22 changes: 1 addition & 21 deletions homeassistant/components/lock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,16 @@
import voluptuous as vol

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ( # noqa: F401
_DEPRECATED_STATE_JAMMED,
_DEPRECATED_STATE_LOCKED,
_DEPRECATED_STATE_LOCKING,
_DEPRECATED_STATE_UNLOCKED,
_DEPRECATED_STATE_UNLOCKING,
from homeassistant.const import (
ATTR_CODE,
ATTR_CODE_FORMAT,
SERVICE_LOCK,
SERVICE_OPEN,
SERVICE_UNLOCK,
STATE_OPEN,
STATE_OPENING,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.deprecation import (
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
from homeassistant.helpers.entity import Entity, EntityDescription
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.typing import ConfigType, StateType
Expand Down Expand Up @@ -317,11 +305,3 @@ def _async_read_entity_options(self) -> None:
return

self._lock_option_default_code = ""


# These can be removed if no deprecated constant are in this module anymore
__getattr__ = ft.partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = ft.partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
2 changes: 1 addition & 1 deletion homeassistant/components/mcp/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
UPDATE_INTERVAL = datetime.timedelta(minutes=30)
TIMEOUT = 10

TokenManager = Callable[[], Awaitable[str]]
type TokenManager = Callable[[], Awaitable[str]]


@asynccontextmanager
Expand Down
48 changes: 1 addition & 47 deletions homeassistant/components/media_player/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@
from homeassistant.core import HomeAssistant, SupportsResponse
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.deprecation import (
DeprecatedConstantEnum,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
from homeassistant.helpers.entity import Entity, EntityDescription
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.network import get_url
Expand All @@ -75,26 +69,6 @@
async_process_play_media_url,
)
from .const import ( # noqa: F401
_DEPRECATED_MEDIA_CLASS_DIRECTORY,
_DEPRECATED_SUPPORT_BROWSE_MEDIA,
_DEPRECATED_SUPPORT_CLEAR_PLAYLIST,
_DEPRECATED_SUPPORT_GROUPING,
_DEPRECATED_SUPPORT_NEXT_TRACK,
_DEPRECATED_SUPPORT_PAUSE,
_DEPRECATED_SUPPORT_PLAY,
_DEPRECATED_SUPPORT_PLAY_MEDIA,
_DEPRECATED_SUPPORT_PREVIOUS_TRACK,
_DEPRECATED_SUPPORT_REPEAT_SET,
_DEPRECATED_SUPPORT_SEEK,
_DEPRECATED_SUPPORT_SELECT_SOUND_MODE,
_DEPRECATED_SUPPORT_SELECT_SOURCE,
_DEPRECATED_SUPPORT_SHUFFLE_SET,
_DEPRECATED_SUPPORT_STOP,
_DEPRECATED_SUPPORT_TURN_OFF,
_DEPRECATED_SUPPORT_TURN_ON,
_DEPRECATED_SUPPORT_VOLUME_MUTE,
_DEPRECATED_SUPPORT_VOLUME_SET,
_DEPRECATED_SUPPORT_VOLUME_STEP,
ATTR_APP_ID,
ATTR_APP_NAME,
ATTR_ENTITY_PICTURE_LOCAL,
Expand Down Expand Up @@ -188,17 +162,6 @@ class MediaPlayerDeviceClass(StrEnum):
DEVICE_CLASSES_SCHEMA = vol.All(vol.Lower, vol.Coerce(MediaPlayerDeviceClass))


# DEVICE_CLASS* below are deprecated as of 2021.12
# use the MediaPlayerDeviceClass enum instead.
_DEPRECATED_DEVICE_CLASS_TV = DeprecatedConstantEnum(
MediaPlayerDeviceClass.TV, "2025.10"
)
_DEPRECATED_DEVICE_CLASS_SPEAKER = DeprecatedConstantEnum(
MediaPlayerDeviceClass.SPEAKER, "2025.10"
)
_DEPRECATED_DEVICE_CLASS_RECEIVER = DeprecatedConstantEnum(
MediaPlayerDeviceClass.RECEIVER, "2025.10"
)
DEVICE_CLASSES = [cls.value for cls in MediaPlayerDeviceClass]


Expand Down Expand Up @@ -1196,6 +1159,7 @@ async def async_internal_search_media(
media_content_id: str | None = None,
media_filter_classes: list[MediaClass] | None = None,
) -> SearchMedia:
"""Search for media."""
return await self.async_search_media(
query=SearchMediaQuery(
search_query=search_query,
Expand Down Expand Up @@ -1510,13 +1474,3 @@ async def async_fetch_image(
logger.warning("Error retrieving proxied image from %s", url)

return content, content_type


# As we import deprecated constants from the const module, we need to add these two functions
# otherwise this module will be logged for using deprecated constants and not the custom component
# These can be removed if no deprecated constant are in this module anymore
__getattr__ = ft.partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = ft.partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())
Loading
Loading