From a537534880a8867d73c250dd83c542f945755970 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 14 Apr 2022 12:48:51 -0700 Subject: [PATCH] Add media player features enum --- .../components/media_player/const.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/homeassistant/components/media_player/const.py b/homeassistant/components/media_player/const.py index fec2cfb3d0a..c9f0742ea57 100644 --- a/homeassistant/components/media_player/const.py +++ b/homeassistant/components/media_player/const.py @@ -1,4 +1,6 @@ """Provides the constants needed for component.""" +from enum import IntEnum + # How long our auth signature on the content should be valid for CONTENT_AUTH_EXPIRY_TIME = 3600 * 24 @@ -90,6 +92,32 @@ REPEAT_MODE_OFF = "off" REPEAT_MODE_ONE = "one" REPEAT_MODES = [REPEAT_MODE_OFF, REPEAT_MODE_ALL, REPEAT_MODE_ONE] + +class MediaPlayerEntityFeature(IntEnum): + """Supported features of the media player entity.""" + + PAUSE = 1 + SEEK = 2 + VOLUME_SET = 4 + VOLUME_MUTE = 8 + PREVIOUS_TRACK = 16 + NEXT_TRACK = 32 + + TURN_ON = 128 + TURN_OFF = 256 + PLAY_MEDIA = 512 + VOLUME_STEP = 1024 + SELECT_SOURCE = 2048 + STOP = 4096 + CLEAR_PLAYLIST = 8192 + PLAY = 16384 + SHUFFLE_SET = 32768 + SELECT_SOUND_MODE = 65536 + BROWSE_MEDIA = 131072 + REPEAT_SET = 262144 + GROUPING = 524288 + + SUPPORT_PAUSE = 1 SUPPORT_SEEK = 2 SUPPORT_VOLUME_SET = 4