mirror of
https://github.com/home-assistant/core.git
synced 2025-06-06 14:17:06 +00:00
Add status_light to Sonos set_option service (#35515)
This commit is contained in:
parent
5e2de4531f
commit
5b2bf8fd17
@ -99,6 +99,7 @@ ATTR_WITH_GROUP = "with_group"
|
|||||||
ATTR_NIGHT_SOUND = "night_sound"
|
ATTR_NIGHT_SOUND = "night_sound"
|
||||||
ATTR_SPEECH_ENHANCE = "speech_enhance"
|
ATTR_SPEECH_ENHANCE = "speech_enhance"
|
||||||
ATTR_QUEUE_POSITION = "queue_position"
|
ATTR_QUEUE_POSITION = "queue_position"
|
||||||
|
ATTR_STATUS_LIGHT = "status_light"
|
||||||
|
|
||||||
UNAVAILABLE_VALUES = {"", "NOT_IMPLEMENTED", None}
|
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_NIGHT_SOUND): cv.boolean,
|
||||||
vol.Optional(ATTR_SPEECH_ENHANCE): cv.boolean,
|
vol.Optional(ATTR_SPEECH_ENHANCE): cv.boolean,
|
||||||
|
vol.Optional(ATTR_STATUS_LIGHT): cv.boolean,
|
||||||
},
|
},
|
||||||
"set_option",
|
"set_option",
|
||||||
)
|
)
|
||||||
@ -1242,7 +1244,7 @@ class SonosEntity(MediaPlayerEntity):
|
|||||||
alarm.save()
|
alarm.save()
|
||||||
|
|
||||||
@soco_error()
|
@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."""
|
"""Modify playback options."""
|
||||||
if night_sound is not None and self._night_sound is not None:
|
if night_sound is not None and self._night_sound is not None:
|
||||||
self.soco.night_mode = night_sound
|
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:
|
if speech_enhance is not None and self._speech_enhance is not None:
|
||||||
self.soco.dialog_mode = speech_enhance
|
self.soco.dialog_mode = speech_enhance
|
||||||
|
|
||||||
|
if status_light is not None:
|
||||||
|
self.soco.status_light = status_light
|
||||||
|
|
||||||
@soco_error()
|
@soco_error()
|
||||||
def play_queue(self, queue_position=0):
|
def play_queue(self, queue_position=0):
|
||||||
"""Start playing the queue."""
|
"""Start playing the queue."""
|
||||||
|
@ -64,6 +64,9 @@ set_option:
|
|||||||
speech_enhance:
|
speech_enhance:
|
||||||
description: Enable Speech Enhancement mode
|
description: Enable Speech Enhancement mode
|
||||||
example: "true"
|
example: "true"
|
||||||
|
status_light:
|
||||||
|
description: Enable Status (LED) Light
|
||||||
|
example: "true"
|
||||||
|
|
||||||
play_queue:
|
play_queue:
|
||||||
description: Starts playing the queue from the first item.
|
description: Starts playing the queue from the first item.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user