| alarmproperties | String | R | Properties of the alarm currently running | all |
| alarmrunning | Switch | R | Set to ON if the alarm was triggered | all |
| bass | Number | RW | Set or get the bass level adjustment (value in range -10 / 10) | all |
+| batterycharging | Switch | R | Indicator set to ON when the battery is charging | Move |
+| batterylevel | Number | R | Current battery level | Move |
| clearqueue | Switch | W | Suppress all songs from the current queue | all |
| control | Player | RW | Control the Zone Player, e.g. PLAY/PAUSE/NEXT/PREVIOUS | all |
| coordinator | String | R | UDN of the coordinator for the current group | all |
public static final String ALARMPROPERTIES = "alarmproperties";
public static final String ALARMRUNNING = "alarmrunning";
public static final String BASS = "bass";
+ public static final String BATTERYCHARGING = "batterycharging";
+ public static final String BATTERYLEVEL = "batterylevel";
public static final String CLEARQUEUE = "clearqueue";
public static final String CONTROL = "control";
public static final String COORDINATOR = "coordinator";
stateDescriptionProvider.setStateOptions(new ChannelUID(getThing().getUID(), RADIO), options);
}
break;
+ case "MoreInfo":
+ updateChannel(BATTERYCHARGING);
+ updateChannel(BATTERYLEVEL);
+ break;
default:
break;
}
newState = new StringType(value);
}
break;
+ case BATTERYCHARGING:
+ value = extractInfoFromMoreInfo("BattChg");
+ if (value != null) {
+ newState = OnOffType.from("CHARGING".equalsIgnoreCase(value));
+ }
+ break;
+ case BATTERYLEVEL:
+ value = extractInfoFromMoreInfo("RawBattPct");
+ if (value != null) {
+ newState = new DecimalType(value);
+ }
+ break;
default:
newState = null;
break;
int seconds = Integer.parseInt(units[2]);
return 3600 * hours + 60 * minutes + seconds;
}
+
+ private @Nullable String extractInfoFromMoreInfo(String searchedInfo) {
+ String value = stateMap.get("MoreInfo");
+ if (value != null) {
+ String[] fields = value.split(",");
+ for (int i = 0; i < fields.length; i++) {
+ String[] pair = fields[i].trim().split(":");
+ if (pair.length == 2 && searchedInfo.equalsIgnoreCase(pair[0].trim())) {
+ return pair[1].trim();
+ }
+ }
+ }
+ return null;
+ }
}
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
+ <!-- Extended SONOS channels -->
+ <channel id="batterycharging" typeId="batterycharging"/>
+ <channel id="batterylevel" typeId="system.battery-level"/>
</channels>
<properties>
<description>Play the line-in of the the Zone Player corresponding to the given UIN</description>
</channel-type>
+ <!-- Extended channels (for SONOS Move only) -->
+ <channel-type id="batterycharging" advanced="true">
+ <item-type>Switch</item-type>
+ <label>Battery Charging</label>
+ <description>Indicator set to ON when the battery is charging</description>
+ <state readOnly="true"/>
+ </channel-type>
+
</thing:thing-descriptions>