mirror of
https://github.com/home-assistant/core.git
synced 2025-06-25 01:21:51 +02:00
Add Volumio repeat support (#64132)
This commit is contained in:
@ -5,6 +5,6 @@
|
||||
"codeowners": ["@OnFreund"],
|
||||
"config_flow": true,
|
||||
"zeroconf": ["_Volumio._tcp.local."],
|
||||
"requirements": ["pyvolumio==0.1.3"],
|
||||
"requirements": ["pyvolumio==0.1.5"],
|
||||
"iot_class": "local_polling"
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ import json
|
||||
from homeassistant.components.media_player import MediaPlayerEntity
|
||||
from homeassistant.components.media_player.const import (
|
||||
MEDIA_TYPE_MUSIC,
|
||||
REPEAT_MODE_ALL,
|
||||
REPEAT_MODE_OFF,
|
||||
SUPPORT_BROWSE_MEDIA,
|
||||
SUPPORT_CLEAR_PLAYLIST,
|
||||
SUPPORT_NEXT_TRACK,
|
||||
@ -16,6 +18,7 @@ from homeassistant.components.media_player.const import (
|
||||
SUPPORT_PLAY,
|
||||
SUPPORT_PLAY_MEDIA,
|
||||
SUPPORT_PREVIOUS_TRACK,
|
||||
SUPPORT_REPEAT_SET,
|
||||
SUPPORT_SEEK,
|
||||
SUPPORT_SELECT_SOURCE,
|
||||
SUPPORT_SHUFFLE_SET,
|
||||
@ -52,6 +55,7 @@ SUPPORT_VOLUMIO = (
|
||||
| SUPPORT_PLAY_MEDIA
|
||||
| SUPPORT_VOLUME_STEP
|
||||
| SUPPORT_SELECT_SOURCE
|
||||
| SUPPORT_REPEAT_SET
|
||||
| SUPPORT_SHUFFLE_SET
|
||||
| SUPPORT_CLEAR_PLAYLIST
|
||||
| SUPPORT_BROWSE_MEDIA
|
||||
@ -182,6 +186,13 @@ class Volumio(MediaPlayerEntity):
|
||||
"""Boolean if shuffle is enabled."""
|
||||
return self._state.get("random", False)
|
||||
|
||||
@property
|
||||
def repeat(self):
|
||||
"""Return current repeat mode."""
|
||||
if self._state.get("repeat", None):
|
||||
return REPEAT_MODE_ALL
|
||||
return REPEAT_MODE_OFF
|
||||
|
||||
@property
|
||||
def source_list(self):
|
||||
"""Return the list of available input sources."""
|
||||
@ -243,6 +254,13 @@ class Volumio(MediaPlayerEntity):
|
||||
"""Enable/disable shuffle mode."""
|
||||
await self._volumio.set_shuffle(shuffle)
|
||||
|
||||
async def async_set_repeat(self, repeat):
|
||||
"""Set repeat mode."""
|
||||
if repeat == REPEAT_MODE_OFF:
|
||||
await self._volumio.repeatAll("false")
|
||||
else:
|
||||
await self._volumio.repeatAll("true")
|
||||
|
||||
async def async_select_source(self, source):
|
||||
"""Choose an available playlist and play it."""
|
||||
await self._volumio.play_playlist(source)
|
||||
|
@ -2039,7 +2039,7 @@ pyvizio==0.1.57
|
||||
pyvlx==0.2.19
|
||||
|
||||
# homeassistant.components.volumio
|
||||
pyvolumio==0.1.3
|
||||
pyvolumio==0.1.5
|
||||
|
||||
# homeassistant.components.html5
|
||||
pywebpush==1.9.2
|
||||
|
@ -1258,7 +1258,7 @@ pyvesync==1.4.2
|
||||
pyvizio==0.1.57
|
||||
|
||||
# homeassistant.components.volumio
|
||||
pyvolumio==0.1.3
|
||||
pyvolumio==0.1.5
|
||||
|
||||
# homeassistant.components.html5
|
||||
pywebpush==1.9.2
|
||||
|
Reference in New Issue
Block a user