Skip to content

Commit

Permalink
B5r1oJ0A9G#58 Deprecated entities (i.e. SUPPORT_BROWSE_MEDIA) have be…
Browse files Browse the repository at this point in the history
…en removed from HA 2024.1, leading to an exception

Replacing magic numbers for MediaPlayerEntityFeature
  • Loading branch information
klausw01 committed Jun 28, 2024
1 parent 8e0f9fb commit a54baf1
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions custom_components/teufel_raumfeld/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from homeassistant.components.media_player import (
MediaPlayerDeviceClass,
MediaPlayerEntity,
MediaPlayerEntityFeature,
)
from homeassistant.components.media_player.browse_media import (
async_process_play_media_url,
Expand Down Expand Up @@ -87,29 +88,29 @@
)

SUPPORT_RAUMFELD_SPOTIFY = (
SUPPORT_PAUSE
| SUPPORT_PLAY
| SUPPORT_VOLUME_SET
| SUPPORT_PREVIOUS_TRACK
| SUPPORT_NEXT_TRACK
MediaPlayerEntityFeature.PAUSE
| MediaPlayerEntityFeature.PLAY
| MediaPlayerEntityFeature.VOLUME_SET
| MediaPlayerEntityFeature.PREVIOUS_TRACK
| MediaPlayerEntityFeature.NEXT_TRACK
)

SUPPORT_RAUMFELD_GROUP = (
SUPPORT_PAUSE
| SUPPORT_SEEK
| SUPPORT_VOLUME_SET
| SUPPORT_VOLUME_MUTE
| SUPPORT_PREVIOUS_TRACK
| SUPPORT_NEXT_TRACK
| SUPPORT_PLAY_MEDIA
| SUPPORT_VOLUME_STEP
| SUPPORT_STOP
| SUPPORT_TURN_ON
| SUPPORT_TURN_OFF
| SUPPORT_PLAY
| SUPPORT_SHUFFLE_SET
| SUPPORT_BROWSE_MEDIA
| SUPPORT_REPEAT_SET
MediaPlayerEntityFeature.PAUSE
| MediaPlayerEntityFeature.SEEK
| MediaPlayerEntityFeature.VOLUME_SET
| MediaPlayerEntityFeature.VOLUME_MUTE
| MediaPlayerEntityFeature.PREVIOUS_TRACK
| MediaPlayerEntityFeature.NEXT_TRACK
| MediaPlayerEntityFeature.PLAY_MEDIA
| MediaPlayerEntityFeature.VOLUME_STEP
| MediaPlayerEntityFeature.STOP
| MediaPlayerEntityFeature.TURN_ON
| MediaPlayerEntityFeature.TURN_OFF
| MediaPlayerEntityFeature.PLAY
| MediaPlayerEntityFeature.SHUFFLE_SET
| MediaPlayerEntityFeature.BROWSE_MEDIA
| MediaPlayerEntityFeature.REPEAT_SET
)

SUPPORT_RAUMFELD_ROOM = SUPPORT_RAUMFELD_GROUP | SUPPORT_GROUPING
Expand Down

0 comments on commit a54baf1

Please sign in to comment.