[sonos] Ignore TRANSITIONING device state when updating channels (#13241)
* [sonos] Ignore TRANSITIONING device state when updating channels * Remove TRANSITIONING state option Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
@@ -100,6 +100,7 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici
|
|||||||
private static final String STATE_PLAYING = "PLAYING";
|
private static final String STATE_PLAYING = "PLAYING";
|
||||||
private static final String STATE_PAUSED_PLAYBACK = "PAUSED_PLAYBACK";
|
private static final String STATE_PAUSED_PLAYBACK = "PAUSED_PLAYBACK";
|
||||||
private static final String STATE_STOPPED = "STOPPED";
|
private static final String STATE_STOPPED = "STOPPED";
|
||||||
|
private static final String STATE_TRANSITIONING = "TRANSITIONING";
|
||||||
|
|
||||||
private static final String LINEINCONNECTED = "LineInConnected";
|
private static final String LINEINCONNECTED = "LineInConnected";
|
||||||
private static final String TOSLINEINCONNECTED = "TOSLinkConnected";
|
private static final String TOSLINEINCONNECTED = "TOSLinkConnected";
|
||||||
@@ -761,7 +762,8 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici
|
|||||||
case STATE:
|
case STATE:
|
||||||
value = getTransportState();
|
value = getTransportState();
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
newState = new StringType(value);
|
// Ignoring state TRANSITIONING
|
||||||
|
newState = STATE_TRANSITIONING.equals(value) ? null : new StringType(value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CONTROL:
|
case CONTROL:
|
||||||
@@ -772,12 +774,15 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici
|
|||||||
newState = PlayPauseType.PAUSE;
|
newState = PlayPauseType.PAUSE;
|
||||||
} else if (STATE_PAUSED_PLAYBACK.equals(value)) {
|
} else if (STATE_PAUSED_PLAYBACK.equals(value)) {
|
||||||
newState = PlayPauseType.PAUSE;
|
newState = PlayPauseType.PAUSE;
|
||||||
|
} else if (STATE_TRANSITIONING.equals(value)) {
|
||||||
|
// Ignoring state TRANSITIONING
|
||||||
|
newState = null;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STOP:
|
case STOP:
|
||||||
value = getTransportState();
|
value = getTransportState();
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
newState = OnOffType.from(STATE_STOPPED.equals(value));
|
newState = STATE_TRANSITIONING.equals(value) ? null : OnOffType.from(STATE_STOPPED.equals(value));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SHUFFLE:
|
case SHUFFLE:
|
||||||
|
|||||||
@@ -167,7 +167,6 @@ channel-type.sonos.state.description = The State channel contains state of the S
|
|||||||
channel-type.sonos.state.state.option.STOPPED = Stopped
|
channel-type.sonos.state.state.option.STOPPED = Stopped
|
||||||
channel-type.sonos.state.state.option.PLAYING = Playing
|
channel-type.sonos.state.state.option.PLAYING = Playing
|
||||||
channel-type.sonos.state.state.option.PAUSED_PLAYBACK = Paused
|
channel-type.sonos.state.state.option.PAUSED_PLAYBACK = Paused
|
||||||
channel-type.sonos.state.state.option.TRANSITIONING = Transitioning
|
|
||||||
channel-type.sonos.stop.label = Stop
|
channel-type.sonos.stop.label = Stop
|
||||||
channel-type.sonos.stop.description = Stop the Sonos device. ON if the player is stopped.
|
channel-type.sonos.stop.description = Stop the Sonos device. ON if the player is stopped.
|
||||||
channel-type.sonos.subwoofer.label = Subwoofer
|
channel-type.sonos.subwoofer.label = Subwoofer
|
||||||
|
|||||||
@@ -279,7 +279,6 @@
|
|||||||
<option value="STOPPED">Stopped</option>
|
<option value="STOPPED">Stopped</option>
|
||||||
<option value="PLAYING">Playing</option>
|
<option value="PLAYING">Playing</option>
|
||||||
<option value="PAUSED_PLAYBACK">Paused</option>
|
<option value="PAUSED_PLAYBACK">Paused</option>
|
||||||
<option value="TRANSITIONING">Transitioning</option>
|
|
||||||
</options>
|
</options>
|
||||||
</state>
|
</state>
|
||||||
</channel-type>
|
</channel-type>
|
||||||
|
|||||||
Reference in New Issue
Block a user