Dynamically set supported features
This commit is contained in:
parent
f0c49b3995
commit
93cc266b06
1 changed files with 8 additions and 1 deletions
|
@ -101,7 +101,6 @@ class EsphomeAssistSatellite(
|
|||
translation_key="assist_satellite",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
)
|
||||
_attr_supported_features = assist_satellite.AssistSatelliteEntityFeature.ANNOUNCE
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
@ -162,6 +161,12 @@ class EsphomeAssistSatellite(
|
|||
)
|
||||
)
|
||||
|
||||
if feature_flags & VoiceAssistantFeature.ANNOUNCE:
|
||||
# Device supports announcements
|
||||
self._attr_supported_features |= (
|
||||
assist_satellite.AssistSatelliteEntityFeature.ANNOUNCE
|
||||
)
|
||||
|
||||
async def async_will_remove_from_hass(self) -> None:
|
||||
"""Run when entity will be removed from hass."""
|
||||
self._is_running = False
|
||||
|
@ -444,6 +449,8 @@ class EsphomeAssistSatellite(
|
|||
finally:
|
||||
self._udp_server = None
|
||||
|
||||
_LOGGER.debug("Stopped UDP server")
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue