Add status_light to Sonos set_option service (#35515)

This commit is contained in:
Ian 2020-06-08 22:41:12 +01:00 committed by GitHub
parent 5e2de4531f
commit 5b2bf8fd17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -99,6 +99,7 @@ ATTR_WITH_GROUP = "with_group"
ATTR_NIGHT_SOUND = "night_sound"
ATTR_SPEECH_ENHANCE = "speech_enhance"
ATTR_QUEUE_POSITION = "queue_position"
ATTR_STATUS_LIGHT = "status_light"
UNAVAILABLE_VALUES = {"", "NOT_IMPLEMENTED", None}
@ -281,6 +282,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
{
vol.Optional(ATTR_NIGHT_SOUND): cv.boolean,
vol.Optional(ATTR_SPEECH_ENHANCE): cv.boolean,
vol.Optional(ATTR_STATUS_LIGHT): cv.boolean,
},
"set_option",
)
@ -1242,7 +1244,7 @@ class SonosEntity(MediaPlayerEntity):
alarm.save()
@soco_error()
def set_option(self, night_sound=None, speech_enhance=None):
def set_option(self, night_sound=None, speech_enhance=None, status_light=None):
"""Modify playback options."""
if night_sound is not None and self._night_sound is not None:
self.soco.night_mode = night_sound
@ -1250,6 +1252,9 @@ class SonosEntity(MediaPlayerEntity):
if speech_enhance is not None and self._speech_enhance is not None:
self.soco.dialog_mode = speech_enhance
if status_light is not None:
self.soco.status_light = status_light
@soco_error()
def play_queue(self, queue_position=0):
"""Start playing the queue."""

View File

@ -64,6 +64,9 @@ set_option:
speech_enhance:
description: Enable Speech Enhancement mode
example: "true"
status_light:
description: Enable Status (LED) Light
example: "true"
play_queue:
description: Starts playing the queue from the first item.