From e3489f25a17cdac00870cba0fcef2d88be939868 Mon Sep 17 00:00:00 2001 From: Breland Miley Date: Thu, 30 Apr 2020 19:23:09 -0700 Subject: [PATCH] [sonos] Add speechenhancement channel for Sonos One (#7484) * [sonos] Add speechenhancement channel for Sonos One Signed-off-by: Breland Miley --- bundles/org.openhab.binding.sonos/README.md | 6 +- .../sonos/internal/SonosBindingConstants.java | 3 +- .../ZonePlayerDiscoveryParticipant.java | 2 +- .../src/main/resources/ESH-INF/thing/One.xml | 1 + .../main/resources/ESH-INF/thing/OneSL.xml | 68 +++++++++++++++++++ 5 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/OneSL.xml diff --git a/bundles/org.openhab.binding.sonos/README.md b/bundles/org.openhab.binding.sonos/README.md index ad6b2759c2012..0e55956638b77 100644 --- a/bundles/org.openhab.binding.sonos/README.md +++ b/bundles/org.openhab.binding.sonos/README.md @@ -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**). @@ -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 | diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosBindingConstants.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosBindingConstants.java index b010f11a055b0..c957f38162e66 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosBindingConstants.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosBindingConstants.java @@ -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"); @@ -52,7 +53,7 @@ public class SonosBindingConstants { .collect(Collectors.toSet()); public static final Set 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()); diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/discovery/ZonePlayerDiscoveryParticipant.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/discovery/ZonePlayerDiscoveryParticipant.java index f66fd74d4b511..cfff378ee0faa 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/discovery/ZonePlayerDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/discovery/ZonePlayerDiscoveryParticipant.java @@ -86,7 +86,7 @@ public ThingUID getThingUID(RemoteDevice device) { modelName = "CONNECTAMP"; break; case "One SL": - modelName = "One"; + modelName = "OneSL"; break; default: break; diff --git a/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/One.xml b/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/One.xml index 455a0706f1f3e..64c157523ffa5 100644 --- a/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/One.xml +++ b/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/One.xml @@ -54,6 +54,7 @@ + diff --git a/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/OneSL.xml b/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/OneSL.xml new file mode 100644 index 0000000000000..14c51b5317503 --- /dev/null +++ b/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/OneSL.xml @@ -0,0 +1,68 @@ + + + + + + + + Represents SONOS One SL Zone Player + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SONOS + One SL + + + udn + + + +