public static final String CHANNEL_TYPE_INPUT = "input";
public static final String CHANNEL_TYPE_AUDIO_MUTE = "audioMute";
public static final String CHANNEL_TYPE_VIDEO_MUTE = "videoMute";
+ public static final String CHANNEL_TYPE_AUDIO_AND_VIDEO_MUTE = "audioAndVideoMute";
public static final String CHANNEL_TYPE_LAMP_HOURS = "lampHours";
public static final String CHANNEL_TYPE_LAMP_ACTIVE = "lampActive";
break;
case CHANNEL_TYPE_AUDIO_MUTE:
case CHANNEL_TYPE_VIDEO_MUTE:
+ case CHANNEL_TYPE_AUDIO_AND_VIDEO_MUTE:
boolean isAudioMute = channelTypeId.equals(PJLinkDeviceBindingConstants.CHANNEL_TYPE_AUDIO_MUTE);
boolean isVideoMute = channelTypeId.equals(PJLinkDeviceBindingConstants.CHANNEL_TYPE_VIDEO_MUTE);
- if (isVideoMute || isAudioMute) {
+ boolean isAudioAndVideoMute = channelTypeId
+ .equals(PJLinkDeviceBindingConstants.CHANNEL_TYPE_AUDIO_AND_VIDEO_MUTE);
+ if (isVideoMute || isAudioMute || isAudioAndVideoMute) {
if (command == RefreshType.REFRESH) {
// refresh both video and audio mute, as it's one request
MuteQueryResponseValue muteStatus = device.getMuteStatus();
OnOffType.from(muteStatus.isAudioMuted()));
updateState(PJLinkDeviceBindingConstants.CHANNEL_VIDEO_MUTE,
OnOffType.from(muteStatus.isVideoMuted()));
+ updateState(PJLinkDeviceBindingConstants.CHANNEL_TYPE_AUDIO_AND_VIDEO_MUTE,
+ OnOffType.from(muteStatus.isAudioAndVideoMuted()));
} else {
if (isAudioMute) {
logger.trace("Received audio mute command {}", command);
boolean muteOn = command == OnOffType.ON;
device.setMute(MuteInstructionChannel.VIDEO, muteOn);
}
+ if (isAudioAndVideoMute) {
+ logger.trace("Received video mute command {}", command);
+ boolean muteOn = command == OnOffType.ON;
+ device.setMute(MuteInstructionChannel.AUDIO_AND_VIDEO, muteOn);
+ }
}
} else {
logger.debug("Received unknown audio/video mute command {}", command);
public class MuteQueryResponse extends PrefixedResponse<MuteQueryResponse.MuteQueryResponseValue> {
public enum MuteQueryResponseValue {
- OFF("Mute off", "30", false, false),
- VIDEO_MUTE_ON("Video muted", "11", false, true),
- AUDIO_MUTE_ON("Audio muted", "21", true, false),
- AUDIO_AND_VIDEO_MUTE_ON("Audio and video muted", "31", true, true);
+ OFF("Mute off", "30", false, false, false),
+ VIDEO_MUTE_ON("Video muted", "11", false, true, false),
+ AUDIO_MUTE_ON("Audio muted", "21", true, false, false),
+ AUDIO_AND_VIDEO_MUTE_ON("Audio and video muted", "31", true, true, true);
private String text;
private String code;
private boolean audioMuted;
private boolean videoMuted;
+ private boolean audioAndVideoMuted;
- private MuteQueryResponseValue(String text, String code, boolean audioMuted, boolean videoMuted) {
+ private MuteQueryResponseValue(String text, String code, boolean audioMuted, boolean videoMuted,
+ boolean audioAndVideoMuted) {
this.text = text;
this.code = code;
this.audioMuted = audioMuted;
this.videoMuted = videoMuted;
+ this.audioAndVideoMuted = audioAndVideoMuted;
}
public String getText() {
public boolean isVideoMuted() {
return this.videoMuted;
}
+
+ public boolean isAudioAndVideoMuted() {
+ return this.audioAndVideoMuted;
+ }
}
private static final HashSet<ErrorCode> SPECIFIED_ERRORCODES = new HashSet<>(
# channel types
+channel-type.pjLinkDevice.audioAndVideoMute.label = Audio and Video Mute
+channel-type.pjLinkDevice.audioAndVideoMute.description = Select the audio and video mute status
channel-type.pjLinkDevice.audioMute.label = Audio Mute
channel-type.pjLinkDevice.audioMute.description = Select the audio mute status
channel-type.pjLinkDevice.input.label = Input
<channel id="input" typeId="input"/>
<channel id="audioMute" typeId="audioMute"/>
<channel id="videoMute" typeId="videoMute"/>
+ <channel id="audioAndVideoMute" typeId="audioAndVideoMute"/>
<channel id="lamp1Hours" typeId="lampHours"/>
<channel id="lamp1Active" typeId="lampActive"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<config-description>
<parameter-group name="basic">
<context>basic</context>
<description>Select the video mute status</description>
</channel-type>
+ <channel-type id="audioAndVideoMute">
+ <item-type>Switch</item-type>
+ <label>Audio and Video Mute</label>
+ <description>Select the audio and video mute status</description>
+ </channel-type>
+
<channel-type id="lampHours">
<item-type>Number</item-type>
<label>Lamp Hours</label>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
+ xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
+ <thing-type uid="pjLinkDevice:pjLinkDevice">
+ <instruction-set targetVersion="1">
+ <add-channel id="audioAndVideoMute">
+ <type>pjLinkDevice:audioAndVideoMute</type>
+ </add-channel>
+ </instruction-set>
+ </thing-type>
+
+</update:update-descriptions>