mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
Remove undocumented Contact command support (#20815)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
+14
-23
@@ -52,7 +52,6 @@ import org.openhab.core.library.types.DecimalType;
|
|||||||
import org.openhab.core.library.types.IncreaseDecreaseType;
|
import org.openhab.core.library.types.IncreaseDecreaseType;
|
||||||
import org.openhab.core.library.types.NextPreviousType;
|
import org.openhab.core.library.types.NextPreviousType;
|
||||||
import org.openhab.core.library.types.OnOffType;
|
import org.openhab.core.library.types.OnOffType;
|
||||||
import org.openhab.core.library.types.OpenClosedType;
|
|
||||||
import org.openhab.core.library.types.PercentType;
|
import org.openhab.core.library.types.PercentType;
|
||||||
import org.openhab.core.library.types.PlayPauseType;
|
import org.openhab.core.library.types.PlayPauseType;
|
||||||
import org.openhab.core.library.types.RawType;
|
import org.openhab.core.library.types.RawType;
|
||||||
@@ -1901,10 +1900,8 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setLoudness(Command command) {
|
public void setLoudness(Command command) {
|
||||||
if (!isOutputLevelFixed() && (command instanceof OnOffType || command instanceof OpenClosedType
|
if (!isOutputLevelFixed() && (command instanceof OnOffType || command instanceof UpDownType)) {
|
||||||
|| command instanceof UpDownType)) {
|
String value = (command.equals(OnOffType.ON) || command.equals(UpDownType.UP)) ? "True" : "False";
|
||||||
String value = (command.equals(OnOffType.ON) || command.equals(UpDownType.UP)
|
|
||||||
|| command.equals(OpenClosedType.OPEN)) ? "True" : "False";
|
|
||||||
executeAction(SERVICE_RENDERING_CONTROL, ACTION_SET_LOUDNESS,
|
executeAction(SERVICE_RENDERING_CONTROL, ACTION_SET_LOUDNESS,
|
||||||
Map.of("InstanceID", "0", "Channel", "Master", "DesiredLoudness", value));
|
Map.of("InstanceID", "0", "Channel", "Master", "DesiredLoudness", value));
|
||||||
}
|
}
|
||||||
@@ -2045,12 +2042,11 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setShuffle(Command command) {
|
public void setShuffle(Command command) {
|
||||||
if (command instanceof OnOffType || command instanceof OpenClosedType || command instanceof UpDownType) {
|
if (command instanceof OnOffType || command instanceof UpDownType) {
|
||||||
try {
|
try {
|
||||||
ZonePlayerHandler coordinator = getCoordinatorHandler();
|
ZonePlayerHandler coordinator = getCoordinatorHandler();
|
||||||
|
|
||||||
if (command.equals(OnOffType.ON) || command.equals(UpDownType.UP)
|
if (command.equals(OnOffType.ON) || command.equals(UpDownType.UP)) {
|
||||||
|| command.equals(OpenClosedType.OPEN)) {
|
|
||||||
switch (coordinator.getRepeatMode()) {
|
switch (coordinator.getRepeatMode()) {
|
||||||
case "ALL":
|
case "ALL":
|
||||||
coordinator.updatePlayMode("SHUFFLE");
|
coordinator.updatePlayMode("SHUFFLE");
|
||||||
@@ -2062,8 +2058,7 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici
|
|||||||
coordinator.updatePlayMode("SHUFFLE_NOREPEAT");
|
coordinator.updatePlayMode("SHUFFLE_NOREPEAT");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (command.equals(OnOffType.OFF) || command.equals(UpDownType.DOWN)
|
} else if (command.equals(OnOffType.OFF) || command.equals(UpDownType.DOWN)) {
|
||||||
|| command.equals(OpenClosedType.CLOSED)) {
|
|
||||||
switch (coordinator.getRepeatMode()) {
|
switch (coordinator.getRepeatMode()) {
|
||||||
case "ALL":
|
case "ALL":
|
||||||
coordinator.updatePlayMode("REPEAT_ALL");
|
coordinator.updatePlayMode("REPEAT_ALL");
|
||||||
@@ -2150,9 +2145,8 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setEqualizerBooleanSetting(Command command, String eqType) {
|
private void setEqualizerBooleanSetting(Command command, String eqType) {
|
||||||
if (command instanceof OnOffType || command instanceof OpenClosedType || command instanceof UpDownType) {
|
if (command instanceof OnOffType || command instanceof UpDownType) {
|
||||||
setEQ(eqType, (command.equals(OnOffType.ON) || command.equals(UpDownType.UP)
|
setEQ(eqType, (command.equals(OnOffType.ON) || command.equals(UpDownType.UP)) ? "1" : "0");
|
||||||
|| command.equals(OpenClosedType.OPEN)) ? "1" : "0");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2353,9 +2347,8 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setMute(Command command) {
|
public void setMute(Command command) {
|
||||||
if (command instanceof OnOffType || command instanceof OpenClosedType || command instanceof UpDownType) {
|
if (command instanceof OnOffType || command instanceof UpDownType) {
|
||||||
String value = (command.equals(OnOffType.ON) || command.equals(UpDownType.UP)
|
String value = (command.equals(OnOffType.ON) || command.equals(UpDownType.UP)) ? "True" : "False";
|
||||||
|| command.equals(OpenClosedType.OPEN)) ? "True" : "False";
|
|
||||||
executeAction(SERVICE_RENDERING_CONTROL, ACTION_SET_MUTE,
|
executeAction(SERVICE_RENDERING_CONTROL, ACTION_SET_MUTE,
|
||||||
Map.of("Channel", "Master", "DesiredMute", value));
|
Map.of("Channel", "Master", "DesiredMute", value));
|
||||||
}
|
}
|
||||||
@@ -2399,11 +2392,10 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setAlarm(Command command) {
|
public void setAlarm(Command command) {
|
||||||
if (command instanceof OnOffType || command instanceof OpenClosedType || command instanceof UpDownType) {
|
if (command instanceof OnOffType || command instanceof UpDownType) {
|
||||||
if (command.equals(OnOffType.ON) || command.equals(UpDownType.UP) || command.equals(OpenClosedType.OPEN)) {
|
if (command.equals(OnOffType.ON) || command.equals(UpDownType.UP)) {
|
||||||
setAlarm(true);
|
setAlarm(true);
|
||||||
} else if (command.equals(OnOffType.OFF) || command.equals(UpDownType.DOWN)
|
} else if (command.equals(OnOffType.OFF) || command.equals(UpDownType.DOWN)) {
|
||||||
|| command.equals(OpenClosedType.CLOSED)) {
|
|
||||||
setAlarm(false);
|
setAlarm(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3010,9 +3002,8 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setLed(Command command) {
|
public void setLed(Command command) {
|
||||||
if (command instanceof OnOffType || command instanceof OpenClosedType || command instanceof UpDownType) {
|
if (command instanceof OnOffType || command instanceof UpDownType) {
|
||||||
String value = (command.equals(OnOffType.ON) || command.equals(UpDownType.UP)
|
String value = (command.equals(OnOffType.ON) || command.equals(UpDownType.UP)) ? "On" : "Off";
|
||||||
|| command.equals(OpenClosedType.OPEN)) ? "On" : "Off";
|
|
||||||
executeAction(SERVICE_DEVICE_PROPERTIES, ACTION_SET_LED_STATE, Map.of("DesiredLEDState", value));
|
executeAction(SERVICE_DEVICE_PROPERTIES, ACTION_SET_LED_STATE, Map.of("DesiredLEDState", value));
|
||||||
executeAction(SERVICE_DEVICE_PROPERTIES, ACTION_GET_LED_STATE, null);
|
executeAction(SERVICE_DEVICE_PROPERTIES, ACTION_GET_LED_STATE, null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user