Skip to content

Commit

Permalink
Add support for Sonos One player (eclipse-archived#4429)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivaylo Ivanov <ivivanov.bg@gmail.com>
  • Loading branch information
ivivanov-bg authored and hsudbrock committed Oct 24, 2017
1 parent e87fbd7 commit 7eac193
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
Expand Up @@ -21,6 +21,8 @@ thing-type.sonos.PLAYBAR.label = PLAYBAR
thing-type.sonos.PLAYBAR.description = Représente une barre de son Sonos
thing-type.sonos.zoneplayer.label = Autre Sonos
thing-type.sonos.zoneplayer.description = Représente un équipement Sonos inconnu de l'extension
thing-type.sonos.One.label = One
thing-type.sonos.One.description = Represente une enceinte Sonos One

thing-type.config.sonos.zoneplayer.udn.label = Nom unique (UDN)
thing-type.config.sonos.zoneplayer.udn.description = Identifie de manière unique un Sonos
Expand Down
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">

<!-- Player One Thing Type -->
<thing-type id="One" listed="false">
<!-- Label without column (:) because of device pairing name restrictions -->
<label>One</label>
<description>Represents SONOS One 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="control" />
<channel id="currentalbum" typeId="currentalbum" />
<channel id="currentalbumart" typeId="currentalbumart" />
<channel id="currentalbumarturl" typeId="currentalbumarturl" />
<channel id="currentartist" typeId="currentartist" />
<channel id="currenttitle" typeId="currenttitle" />
<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="mute" />
<channel id="notificationsound" typeId="notificationsound" />
<channel id="notificationvolume" typeId="notificationvolume" />
<channel id="playlist" typeId="playlist" />
<channel id="clearqueue" typeId="clearqueue" />
<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="volume" />
<channel id="zonegroup" typeId="zonegroup" />
<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</property>
</properties>

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

<config-description-ref uri="thing-type:sonos:zoneplayer" />
</thing-type>
</thing:thing-descriptions>
Expand Up @@ -29,6 +29,7 @@ public class SonosBindingConstants {
// List of all Thing Type UIDs
// Column (:) is not used for PLAY:1, PLAY:3, PLAY:5 and CONNECT:AMP because of
// ThingTypeUID and device pairing name restrictions
public final static ThingTypeUID ONE_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "One");
public final static ThingTypeUID PLAY1_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "PLAY1");
public final static ThingTypeUID PLAY3_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "PLAY3");
public final static ThingTypeUID PLAY5_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "PLAY5");
Expand All @@ -38,7 +39,7 @@ public class SonosBindingConstants {
public final static ThingTypeUID ZONEPLAYER_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "zoneplayer");

public static final Set<ThingTypeUID> SUPPORTED_KNOWN_THING_TYPES_UIDS = Stream
.of(PLAY1_THING_TYPE_UID, PLAY3_THING_TYPE_UID, PLAY5_THING_TYPE_UID, PLAYBAR_THING_TYPE_UID,
.of(ONE_THING_TYPE_UID, PLAY1_THING_TYPE_UID, PLAY3_THING_TYPE_UID, PLAY5_THING_TYPE_UID, PLAYBAR_THING_TYPE_UID,
CONNECT_THING_TYPE_UID, CONNECTAMP_THING_TYPE_UID)
.collect(Collectors.toSet());

Expand Down

0 comments on commit 7eac193

Please sign in to comment.