mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Cleanup supported_features in group (#82242)
* Cleanup supported_features in group * Remove defaults (already set to 0 in fan and media_player)
This commit is contained in:
parent
ad8b882cb6
commit
38a8e86dde
@ -110,18 +110,12 @@ class FanGroup(GroupEntity, FanEntity):
|
||||
self._percentage = None
|
||||
self._oscillating = None
|
||||
self._direction = None
|
||||
self._supported_features = 0
|
||||
self._speed_count = 100
|
||||
self._is_on: bool | None = False
|
||||
self._attr_name = name
|
||||
self._attr_extra_state_attributes = {ATTR_ENTITY_ID: entities}
|
||||
self._attr_unique_id = unique_id
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag supported features."""
|
||||
return self._supported_features
|
||||
|
||||
@property
|
||||
def speed_count(self) -> int:
|
||||
"""Return the number of speeds the fan supports."""
|
||||
@ -319,7 +313,7 @@ class FanGroup(GroupEntity, FanEntity):
|
||||
"_direction", FanEntityFeature.DIRECTION, ATTR_DIRECTION
|
||||
)
|
||||
|
||||
self._supported_features = reduce(
|
||||
self._attr_supported_features = reduce(
|
||||
ior, [feature for feature in SUPPORTED_FLAGS if self._fans[feature]], 0
|
||||
)
|
||||
self._attr_assumed_state |= any(
|
||||
|
@ -109,7 +109,6 @@ class MediaPlayerGroup(MediaPlayerEntity):
|
||||
"""Initialize a Media Group entity."""
|
||||
self._name = name
|
||||
self._state: str | None = None
|
||||
self._supported_features: int = 0
|
||||
self._attr_unique_id = unique_id
|
||||
|
||||
self._entities = entities
|
||||
@ -212,11 +211,6 @@ class MediaPlayerGroup(MediaPlayerEntity):
|
||||
"""Return the state of the media group."""
|
||||
return self._state
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag supported features."""
|
||||
return self._supported_features
|
||||
|
||||
@property
|
||||
def extra_state_attributes(self) -> dict:
|
||||
"""Return the state attributes for the media group."""
|
||||
@ -442,5 +436,5 @@ class MediaPlayerGroup(MediaPlayerEntity):
|
||||
| MediaPlayerEntityFeature.VOLUME_STEP
|
||||
)
|
||||
|
||||
self._supported_features = supported_features
|
||||
self._attr_supported_features = supported_features
|
||||
self.async_write_ha_state()
|
||||
|
Loading…
x
Reference in New Issue
Block a user