Skip to content

Commit

Permalink
[sonos] Add speechenhancement channel for Sonos One (openhab#7484)
Browse files Browse the repository at this point in the history
* [sonos] Add speechenhancement channel for Sonos One

Signed-off-by: Breland Miley <[email protected]>
  • Loading branch information
mindstorms6 authored and LoungeFlyZ committed Jun 8, 2020
1 parent 833f2ed commit c92a087
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bundles/org.openhab.binding.sonos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ This happens because of a TTL=1 for ALIVE packets send by Sonos devices, resulti

## Supported Things

All available Sonos (playback) devices are supported by this binding. This includes the One, Play:1, Play:3, Play:5, Connect, Connect:Amp, Playbar, Playbase, Beam and Sub. The Bridge and Boost are not supported, but these devices do only have an auxiliary role in the Sonos network and do not have any playback capability. All supported Sonos devices are registered as an audio sink in the framework.
All available Sonos (playback) devices are supported by this binding. This includes the One, OneSL, Play:1, Play:3, Play:5, Connect, Connect:Amp, Playbar, Playbase, Beam and Sub. The Bridge and Boost are not supported, but these devices do only have an auxiliary role in the Sonos network and do not have any playback capability. All supported Sonos devices are registered as an audio sink in the framework.

When being defined in a \*.things file, the specific thing types One, PLAY1, PLAY3, PLAY5, PLAYBAR, PLAYBASE, Beam, CONNECT and CONNECTAMP should be used.
When being defined in a \*.things file, the specific thing types One, OneSL, PLAY1, PLAY3, PLAY5, PLAYBAR, PLAYBASE, Beam, CONNECT and CONNECTAMP should be used.

Please note that these thing types are case sensitive (you need to define them **exactly as stated above**).

Expand Down Expand Up @@ -85,7 +85,7 @@ The devices support the following channels:
| shuffle | Switch | RW | Shuffle the queue playback | all |
| sleeptimer | Number | RW | Set/show the duration of the SleepTimer in seconds | all |
| snooze | Number | W | Snooze the running alarm, if any, with the given number of minutes | all |
| speechenhancement | Switch | RW | Enable or disable the speech enhancement feature | PLAYBAR, PLAYBASE, Beam |
| speechenhancement | Switch | RW | Enable or disable the speech enhancement feature | PLAYBAR, PLAYBASE, Beam, One |
| standalone | Switch | W | Make the Zone Player leave its Group and become a standalone Zone Player | all |
| state | String | R | The State channel contains state of the Zone Player, e.g. PLAYING, STOPPED, ... | all |
| stop | Switch | W | Write `ON` to this channel: Stops the Zone Player player. | all |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class SonosBindingConstants {
// Column (:) is not used for PLAY:1, PLAY:3, PLAY:5 and CONNECT:AMP because of
// ThingTypeUID and device pairing name restrictions
public static final ThingTypeUID ONE_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "One");
public static final ThingTypeUID ONE_SL_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "OneSL");
public static final ThingTypeUID PLAY1_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "PLAY1");
public static final ThingTypeUID PLAY3_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "PLAY3");
public static final ThingTypeUID PLAY5_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "PLAY5");
Expand All @@ -52,7 +53,7 @@ public class SonosBindingConstants {
.collect(Collectors.toSet());

public static final Set<ThingTypeUID> SUPPORTED_KNOWN_THING_TYPES_UIDS = Stream
.of(ONE_THING_TYPE_UID, PLAY1_THING_TYPE_UID, PLAY3_THING_TYPE_UID, PLAY5_THING_TYPE_UID,
.of(ONE_THING_TYPE_UID, ONE_SL_THING_TYPE_UID, PLAY1_THING_TYPE_UID, PLAY3_THING_TYPE_UID, PLAY5_THING_TYPE_UID,
PLAYBAR_THING_TYPE_UID, PLAYBASE_THING_TYPE_UID, BEAM_THING_TYPE_UID, CONNECT_THING_TYPE_UID,
CONNECTAMP_THING_TYPE_UID, SYMFONISK_THING_TYPE_UID)
.collect(Collectors.toSet());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public ThingUID getThingUID(RemoteDevice device) {
modelName = "CONNECTAMP";
break;
case "One SL":
modelName = "One";
modelName = "OneSL";
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
<channel id="speechenhancement" typeId="speechenhancement" />
</channels>

<properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">

<!-- Player One SL Thing Type -->
<thing-type id="OneSL" listed="false">
<!-- Label without column (:) because of device pairing name restrictions -->
<label>One SL</label>
<description>Represents SONOS One SL Zone Player</description>

<channels>
<channel id="add" typeId="add" />
<channel id="alarm" typeId="alarm" />
<channel id="alarmproperties" typeId="alarmproperties" />
<channel id="alarmrunning" typeId="alarmrunning" />
<channel id="control" typeId="system.media-control" />
<channel id="currentalbum" typeId="currentalbum" />
<channel id="currentalbumart" typeId="currentalbumart" />
<channel id="currentalbumarturl" typeId="currentalbumarturl" />
<channel id="currentartist" typeId="system.media-artist" />
<channel id="currenttitle" typeId="system.media-title" />
<channel id="currenttrack" typeId="currenttrack" />
<channel id="shuffle" typeId="shuffle" />
<channel id="repeat" typeId="repeat" />
<channel id="favorite" typeId="favorite" />
<channel id="led" typeId="led" />
<channel id="localcoordinator" typeId="localcoordinator" />
<channel id="mute" typeId="system.mute" />
<channel id="notificationsound" typeId="notificationsound" />
<channel id="playlist" typeId="playlist" />
<channel id="clearqueue" typeId="clearqueue" />
<channel id="playlinein" typeId="playlinein" />
<channel id="playqueue" typeId="playqueue" />
<channel id="playtrack" typeId="playtrack" />
<channel id="playuri" typeId="playuri" />
<channel id="publicaddress" typeId="publicaddress" />
<channel id="radio" typeId="radio" />
<channel id="remove" typeId="remove" />
<channel id="restore" typeId="restore" />
<channel id="restoreall" typeId="restoreall" />
<channel id="save" typeId="save" />
<channel id="saveall" typeId="saveall" />
<channel id="snooze" typeId="snooze" />
<channel id="standalone" typeId="standalone" />
<channel id="state" typeId="state" />
<channel id="stop" typeId="stop" />
<channel id="tuneinstationid" typeId="tuneinstationid" />
<channel id="volume" typeId="system.volume" />
<channel id="zonegroupid" typeId="zonegroupid" />
<channel id="zonename" typeId="zonename" />
<channel id="coordinator" typeId="coordinator" />
<channel id="sleeptimer" typeId="sleeptimer" />
<channel id="currenttransporturi" typeId="currenttransporturi" />
<channel id="currenttrackuri" typeId="currenttrackuri" />
</channels>

<properties>
<property name="vendor">SONOS</property>
<property name="modelId">One SL</property>
</properties>

<representation-property>udn</representation-property>

<config-description-ref uri="thing-type:sonos:zoneplayer" />
</thing-type>
</thing:thing-descriptions>

0 comments on commit c92a087

Please sign in to comment.