Skip to content

Commit 6a1e3b6

Browse files
authored
Filter speak notify entity for WHA devices in Alexa Devices (home-assistant#146688)
1 parent 434cd95 commit 6a1e3b6

File tree

1 file changed

+4
-0
lines changed
  • homeassistant/components/alexa_devices

1 file changed

+4
-0
lines changed

homeassistant/components/alexa_devices/notify.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import Any, Final
88

99
from aioamazondevices.api import AmazonDevice, AmazonEchoApi
10+
from aioamazondevices.const import SPEAKER_GROUP_FAMILY
1011

1112
from homeassistant.components.notify import NotifyEntity, NotifyEntityDescription
1213
from homeassistant.core import HomeAssistant
@@ -22,6 +23,7 @@
2223
class AmazonNotifyEntityDescription(NotifyEntityDescription):
2324
"""Alexa Devices notify entity description."""
2425

26+
is_supported: Callable[[AmazonDevice], bool] = lambda _device: True
2527
method: Callable[[AmazonEchoApi, AmazonDevice, str], Awaitable[None]]
2628
subkey: str
2729

@@ -31,6 +33,7 @@ class AmazonNotifyEntityDescription(NotifyEntityDescription):
3133
key="speak",
3234
translation_key="speak",
3335
subkey="AUDIO_PLAYER",
36+
is_supported=lambda _device: _device.device_family != SPEAKER_GROUP_FAMILY,
3437
method=lambda api, device, message: api.call_alexa_speak(device, message),
3538
),
3639
AmazonNotifyEntityDescription(
@@ -58,6 +61,7 @@ async def async_setup_entry(
5861
for sensor_desc in NOTIFY
5962
for serial_num in coordinator.data
6063
if sensor_desc.subkey in coordinator.data[serial_num].capabilities
64+
and sensor_desc.is_supported(coordinator.data[serial_num])
6165
)
6266

6367

0 commit comments

Comments
 (0)