Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions homeassistant/components/ai_task/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
"GenImageTaskResult",
"async_generate_data",
"async_generate_image",
"async_setup",
"async_setup_entry",
"async_unload_entry",
]

_LOGGER = logging.getLogger(__name__)
Expand Down
1 change: 0 additions & 1 deletion homeassistant/components/assist_pipeline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"async_create_default_pipeline",
"async_get_pipelines",
"async_pipeline_from_audio_stream",
"async_setup",
"async_update_pipeline",
)

Expand Down
14 changes: 12 additions & 2 deletions homeassistant/components/assist_pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
import hass_nabucasa
import voluptuous as vol

from homeassistant.components import conversation, stt, tts, wake_word, websocket_api
from homeassistant.components import (
conversation,
media_player,
stt,
tts,
wake_word,
websocket_api,
)
from homeassistant.const import ATTR_SUPPORTED_FEATURES, MATCH_ALL
from homeassistant.core import Context, HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
Expand Down Expand Up @@ -130,7 +137,10 @@ def validate_language(data: dict[str, Any]) -> Any:
@callback
def _async_local_fallback_intent_filter(result: RecognizeResult) -> bool:
"""Filter out intents that are not local fallback."""
return result.intent.name in (intent.INTENT_GET_STATE)
return result.intent.name in (
intent.INTENT_GET_STATE,
media_player.INTENT_MEDIA_SEARCH_AND_PLAY,
)


@callback
Expand Down
27 changes: 20 additions & 7 deletions homeassistant/components/asuswrt/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,16 @@ class WrtDevice(NamedTuple):

_LOGGER = logging.getLogger(__name__)

type _FuncType[_T] = Callable[[_T], Awaitable[list[Any] | tuple[Any] | dict[str, Any]]]
type _FuncType[_T] = Callable[
[_T],
Awaitable[
list[str]
| tuple[float | None, float | None]
| list[float]
| dict[str, float | str | None]
| dict[str, float]
],
]
type _ReturnFuncType[_T] = Callable[[_T], Coroutine[Any, Any, dict[str, Any]]]


Expand All @@ -87,7 +96,9 @@ def _handle_errors_and_zip(
"""Run library methods and zip results or manage exceptions."""

@functools.wraps(func)
async def _wrapper(self: _AsusWrtBridgeT) -> dict[str, str]:
async def _wrapper(
self: _AsusWrtBridgeT,
) -> dict[str, float | str | None] | dict[str, float]:
try:
data = await func(self)
except exceptions as exc:
Expand All @@ -114,7 +125,9 @@ class AsusWrtBridge(ABC):

@staticmethod
def get_bridge(
hass: HomeAssistant, conf: dict[str, Any], options: dict[str, Any] | None = None
hass: HomeAssistant,
conf: dict[str, str | int],
options: dict[str, str | bool | int] | None = None,
) -> AsusWrtBridge:
"""Get Bridge instance."""
if conf[CONF_PROTOCOL] in (PROTOCOL_HTTPS, PROTOCOL_HTTP):
Expand Down Expand Up @@ -313,22 +326,22 @@ async def _get_available_temperature_sensors(self) -> list[str]:
return [SENSORS_TEMPERATURES_LEGACY[i] for i in range(3) if availability[i]]

@handle_errors_and_zip((IndexError, OSError, ValueError), SENSORS_BYTES)
async def _get_bytes(self) -> Any:
async def _get_bytes(self) -> tuple[float | None, float | None]:
"""Fetch byte information from the router."""
return await self._api.async_get_bytes_total()

@handle_errors_and_zip((IndexError, OSError, ValueError), SENSORS_RATES)
async def _get_rates(self) -> Any:
async def _get_rates(self) -> tuple[float, float]:
"""Fetch rates information from the router."""
return await self._api.async_get_current_transfer_rates()

@handle_errors_and_zip((IndexError, OSError, ValueError), SENSORS_LOAD_AVG)
async def _get_load_avg(self) -> Any:
async def _get_load_avg(self) -> list[float]:
"""Fetch load average information from the router."""
return await self._api.async_get_loadavg()

@handle_errors_and_zip((OSError, ValueError), None)
async def _get_temperatures(self) -> Any:
async def _get_temperatures(self) -> dict[str, float]:
"""Fetch temperatures information from the router."""
return await self._api.async_get_temperature()

Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/asuswrt/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ def _show_setup_form(self, error: str | None = None) -> ConfigFlowResult:
)

async def _async_check_connection(
self, user_input: dict[str, Any]
self, user_input: dict[str, str | int]
) -> tuple[str, str | None]:
"""Attempt to connect the AsusWrt router."""

api: AsusWrtBridge
host: str = user_input[CONF_HOST]
host = user_input[CONF_HOST]
protocol = user_input[CONF_PROTOCOL]
error: str | None = None

Expand Down
10 changes: 4 additions & 6 deletions homeassistant/components/asuswrt/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:

self._on_close: list[Callable] = []

self._options: dict[str, Any] = {
self._options: dict[str, str | bool | int] = {
CONF_DNSMASQ: DEFAULT_DNSMASQ,
CONF_INTERFACE: DEFAULT_INTERFACE,
CONF_REQUIRE_IP: True,
Expand Down Expand Up @@ -299,12 +299,10 @@ async def update_devices(self) -> None:
_LOGGER.warning("Reconnected to ASUS router %s", self.host)

self._connected_devices = len(wrt_devices)
consider_home: int = self._options.get(
CONF_CONSIDER_HOME, DEFAULT_CONSIDER_HOME.total_seconds()
)
track_unknown: bool = self._options.get(
CONF_TRACK_UNKNOWN, DEFAULT_TRACK_UNKNOWN
consider_home = int(
self._options.get(CONF_CONSIDER_HOME, DEFAULT_CONSIDER_HOME.total_seconds())
)
track_unknown = self._options.get(CONF_TRACK_UNKNOWN, DEFAULT_TRACK_UNKNOWN)

for device_mac, device in self._devices.items():
dev_info = wrt_devices.pop(device_mac, None)
Expand Down
1 change: 0 additions & 1 deletion homeassistant/components/conversation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"async_get_chat_log",
"async_get_result_from_chat_log",
"async_set_agent",
"async_setup",
"async_unset_agent",
]

Expand Down
49 changes: 4 additions & 45 deletions homeassistant/components/device_tracker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

from __future__ import annotations

from homeassistant.const import STATE_HOME
from homeassistant.const import ATTR_GPS_ACCURACY, STATE_HOME # noqa: F401
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType
from homeassistant.loader import bind_hass

from .config_entry import (
from .config_entry import ( # noqa: F401
ScannerEntity,
ScannerEntityDescription,
TrackerEntity,
TrackerEntityDescription,
async_setup_entry,
async_unload_entry,
)
from .const import (
from .const import ( # noqa: F401
ATTR_ATTRIBUTES,
ATTR_BATTERY,
ATTR_DEV_ID,
Expand All @@ -37,7 +37,7 @@
SCAN_INTERVAL,
SourceType,
)
from .legacy import (
from .legacy import ( # noqa: F401
PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE,
SERVICE_SEE,
Expand All @@ -61,44 +61,3 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the device tracker."""
async_setup_legacy_integration(hass, config)
return True


__all__ = (
"ATTR_ATTRIBUTES",
"ATTR_BATTERY",
"ATTR_DEV_ID",
"ATTR_GPS",
"ATTR_HOST_NAME",
"ATTR_IP",
"ATTR_LOCATION_NAME",
"ATTR_MAC",
"ATTR_SOURCE_TYPE",
"CONF_CONSIDER_HOME",
"CONF_NEW_DEVICE_DEFAULTS",
"CONF_SCAN_INTERVAL",
"CONF_TRACK_NEW",
"CONNECTED_DEVICE_REGISTERED",
"DEFAULT_CONSIDER_HOME",
"DEFAULT_TRACK_NEW",
"DOMAIN",
"ENTITY_ID_FORMAT",
"PLATFORM_SCHEMA",
"PLATFORM_SCHEMA_BASE",
"SCAN_INTERVAL",
"SERVICE_SEE",
"SERVICE_SEE_PAYLOAD_SCHEMA",
"SOURCE_TYPES",
"AsyncSeeCallback",
"DeviceScanner",
"ScannerEntity",
"ScannerEntityDescription",
"SeeCallback",
"SourceType",
"TrackerEntity",
"TrackerEntityDescription",
"async_setup",
"async_setup_entry",
"async_unload_entry",
"is_on",
"see",
)
1 change: 1 addition & 0 deletions homeassistant/components/husqvarna_automower/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"config_flow": true,
"dependencies": ["application_credentials"],
"documentation": "https://www.home-assistant.io/integrations/husqvarna_automower",
"integration_type": "hub",
"iot_class": "cloud_push",
"loggers": ["aioautomower"],
"quality_scale": "silver",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ def _is_supported(discovery_info: BluetoothServiceInfo):
LOGGER.debug("Unsupported device: %s (%s)", manufacturer_data, discovery_info)
return False

if not manufacturer_data.pairable:
LOGGER.error(
"The mower does not appear to be pairable. "
"Ensure the mower is in pairing mode before continuing. "
"If the mower isn't pariable you will receive authentication "
"errors and be unable to connect"
)

LOGGER.debug("Supported device: %s", manufacturer_data)
return True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/husqvarna_automower_ble",
"iot_class": "local_polling",
"requirements": ["automower-ble==0.2.7", "gardena-bluetooth==1.6.0"]
"requirements": ["automower-ble==0.2.8", "gardena-bluetooth==1.6.0"]
}
2 changes: 0 additions & 2 deletions homeassistant/components/mcp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

__all__ = [
"DOMAIN",
"async_setup_entry",
"async_unload_entry",
]

API_PROMPT = "The following tools are available from a remote server named {name}."
Expand Down
3 changes: 0 additions & 3 deletions homeassistant/components/mcp_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
__all__ = [
"CONFIG_SCHEMA",
"DOMAIN",
"async_setup",
"async_setup_entry",
"async_unload_entry",
]

CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/media_player/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
ATTR_SOUND_MODE_LIST,
CONTENT_AUTH_EXPIRY_TIME,
DOMAIN,
INTENT_MEDIA_SEARCH_AND_PLAY,
REPEAT_MODES,
SERVICE_BROWSE_MEDIA,
SERVICE_CLEAR_PLAYLIST,
Expand Down
10 changes: 10 additions & 0 deletions homeassistant/components/media_player/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@

DOMAIN = "media_player"

INTENT_MEDIA_PAUSE = "HassMediaPause"
INTENT_MEDIA_UNPAUSE = "HassMediaUnpause"
INTENT_MEDIA_NEXT = "HassMediaNext"
INTENT_MEDIA_PREVIOUS = "HassMediaPrevious"
INTENT_PLAYER_MUTE = "HassMediaPlayerMute"
INTENT_PLAYER_UNMUTE = "HassMediaPlayerUnmute"
INTENT_SET_VOLUME = "HassSetVolume"
INTENT_SET_VOLUME_RELATIVE = "HassSetVolumeRelative"
INTENT_MEDIA_SEARCH_AND_PLAY = "HassMediaSearchAndPlay"


class MediaPlayerState(
StrEnum,
Expand Down
19 changes: 9 additions & 10 deletions homeassistant/components/media_player/intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,22 @@
ATTR_MEDIA_VOLUME_LEVEL,
ATTR_MEDIA_VOLUME_MUTED,
DOMAIN,
INTENT_MEDIA_NEXT,
INTENT_MEDIA_PAUSE,
INTENT_MEDIA_PREVIOUS,
INTENT_MEDIA_SEARCH_AND_PLAY,
INTENT_MEDIA_UNPAUSE,
INTENT_PLAYER_MUTE,
INTENT_PLAYER_UNMUTE,
INTENT_SET_VOLUME,
INTENT_SET_VOLUME_RELATIVE,
SERVICE_PLAY_MEDIA,
SERVICE_SEARCH_MEDIA,
MediaClass,
MediaPlayerEntityFeature,
MediaPlayerState,
)

INTENT_MEDIA_PAUSE = "HassMediaPause"
INTENT_MEDIA_UNPAUSE = "HassMediaUnpause"
INTENT_MEDIA_NEXT = "HassMediaNext"
INTENT_MEDIA_PREVIOUS = "HassMediaPrevious"
INTENT_PLAYER_MUTE = "HassMediaPlayerMute"
INTENT_PLAYER_UNMUTE = "HassMediaPlayerUnmute"
INTENT_SET_VOLUME = "HassSetVolume"
INTENT_SET_VOLUME_RELATIVE = "HassSetVolumeRelative"
INTENT_MEDIA_SEARCH_AND_PLAY = "HassMediaSearchAndPlay"

_LOGGER = logging.getLogger(__name__)


Expand Down
3 changes: 0 additions & 3 deletions homeassistant/components/mqtt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,9 @@
"async_prepare_subscribe_topics",
"async_publish",
"async_remove_config_entry_device",
"async_setup",
"async_setup_entry",
"async_subscribe",
"async_subscribe_connection_status",
"async_subscribe_topics",
"async_unload_entry",
"async_unsubscribe_topics",
"async_wait_for_mqtt_client",
"convert_outgoing_mqtt_payload",
Expand Down
Loading
Loading