]> git.basschouten.com Git - openhab-addons.git/commitdiff
[sonos] Add support for Sonos Move (#9962)
authorlolodomo <lg.hc@free.fr>
Wed, 27 Jan 2021 02:39:13 +0000 (03:39 +0100)
committerGitHub <noreply@github.com>
Wed, 27 Jan 2021 02:39:13 +0000 (18:39 -0800)
* [sonos] Add support for Sonos Move

Fix #9950

* README: updated list of supported Sonos models

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.sonos/README.md
bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosBindingConstants.java
bundles/org.openhab.binding.sonos/src/main/resources/OH-INF/thing/Move.xml [new file with mode: 0644]

index 91d83fdbd73c2b6237432743839a71c9a83600d4..081680c3d045225af8bc9e4e5b0e01649bf81839 100644 (file)
@@ -10,9 +10,12 @@ 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, OneSL, Play:1, Play:3, Play:5, Connect, Connect:Amp, Port, 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, One SL, Move, Play:1, Play:3, Play:5, Connect, Connect:Amp, Port, Amp, SYMFONISK, Playbar, Playbase, Beam, Arc, Arc SL 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, OneSL, PLAY1, PLAY3, PLAY5, PLAYBAR, PLAYBASE, Beam, CONNECT, CONNECTAMP, Port and Amp should be used.
+When being defined in a \*.things file, the specific thing types One, OneSL, Move, PLAY1, PLAY3, PLAY5, SYMFONISK, PLAYBAR, PLAYBASE, Beam, Arc, ArcSL, CONNECT, CONNECTAMP, Port and Amp should be used.
 
 Please note that these thing types are case sensitive (you need to define them **exactly as stated above**).
 
index 08b0b7cf06e0d0c7c6f75c3a0da92c3621aedf26..5cb4daafd4d8dc95d69df80e4edbc0e865656aae 100644 (file)
@@ -51,6 +51,7 @@ public class SonosBindingConstants {
     public static final ThingTypeUID SYMFONISK_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "SYMFONISK");
     public static final ThingTypeUID ARC_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "Arc");
     public static final ThingTypeUID ARC_SL_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "ArcSL");
+    public static final ThingTypeUID MOVE_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "Move");
     public static final ThingTypeUID ZONEPLAYER_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "zoneplayer");
 
     public static final Set<ThingTypeUID> WITH_LINEIN_THING_TYPES_UIDS = Stream.of(PLAY5_THING_TYPE_UID,
@@ -68,7 +69,7 @@ public class SonosBindingConstants {
             .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, PORT_THING_TYPE_UID, AMP_THING_TYPE_UID,
-                    SYMFONISK_THING_TYPE_UID, ARC_THING_TYPE_UID, ARC_SL_THING_TYPE_UID)
+                    SYMFONISK_THING_TYPE_UID, ARC_THING_TYPE_UID, ARC_SL_THING_TYPE_UID, MOVE_THING_TYPE_UID)
             .collect(Collectors.toSet());
 
     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>(SUPPORTED_KNOWN_THING_TYPES_UIDS);
diff --git a/bundles/org.openhab.binding.sonos/src/main/resources/OH-INF/thing/Move.xml b/bundles/org.openhab.binding.sonos/src/main/resources/OH-INF/thing/Move.xml
new file mode 100644 (file)
index 0000000..e26a1c8
--- /dev/null
@@ -0,0 +1,67 @@
+<?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">
+
+       <!-- Sonos Move Thing Type -->
+       <thing-type id="Move" listed="false">
+               <label>Move</label>
+               <description>Represents SONOS Move speaker</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">Move</property>
+               </properties>
+
+               <representation-property>udn</representation-property>
+
+               <config-description-ref uri="thing-type:sonos:zoneplayer"/>
+       </thing-type>
+</thing:thing-descriptions>