public static final String LAST_TRIP = "last_trip";
public static final String BYPASSED = "bypassed";
public static final String ARMED = "armed";
+ public static final String LOCKED = "locked";
public static final String LOW_BATTERY = "low_battery";
public static final String PGM_STATUS = "pgm_status";
public static final String X10_STATUS = "x10_status";
PowermaxThingHandler handler = (PowermaxThingHandler) thing.getHandler();
if (handler != null) {
if (thing.getThingTypeUID().equals(THING_TYPE_ZONE)) {
- if ((channel == null) || channel.equals(TRIPPED)) {
- handler.updateChannelFromAlarmState(TRIPPED, state);
- }
- if ((channel == null) || channel.equals(LAST_TRIP)) {
- handler.updateChannelFromAlarmState(LAST_TRIP, state);
- }
- if ((channel == null) || channel.equals(BYPASSED)) {
- handler.updateChannelFromAlarmState(BYPASSED, state);
- }
- if ((channel == null) || channel.equals(ARMED)) {
- handler.updateChannelFromAlarmState(ARMED, state);
- }
- if ((channel == null) || channel.equals(LOW_BATTERY)) {
- handler.updateChannelFromAlarmState(LOW_BATTERY, state);
+ for (String channelId : List.of(TRIPPED, LAST_TRIP, BYPASSED, ARMED, LOCKED, LOW_BATTERY)) {
+ if ((channel == null) || channel.equals(channelId)) {
+ handler.updateChannelFromAlarmState(channelId, state);
+ }
}
} else if (thing.getThingTypeUID().equals(THING_TYPE_X10)) {
if ((channel == null) || channel.equals(X10_STATUS)) {
updateState(BYPASSED, state.isSensorBypassed(num) ? OnOffType.ON : OnOffType.OFF);
} else if (channel.equals(ARMED) && (state.isSensorArmed(num) != null)) {
updateState(ARMED, state.isSensorArmed(num) ? OnOffType.ON : OnOffType.OFF);
+ } else if (channel.equals(LOCKED) && (state.isSensorArmed(num) != null)) {
+ updateState(LOCKED, state.isSensorArmed(num) ? OpenClosedType.CLOSED : OpenClosedType.OPEN);
} else if (channel.equals(LOW_BATTERY) && (state.isSensorLowBattery(num) != null)) {
updateState(LOW_BATTERY, state.isSensorLowBattery(num) ? OnOffType.ON : OnOffType.OFF);
}
<channel-type id="armed">
<item-type>Switch</item-type>
- <label>Zone Armed</label>
+ <label>Zone Armed (Switch)</label>
<description>Whether or not the zone is armed</description>
<state readOnly="true"></state>
</channel-type>
+ <channel-type id="locked">
+ <item-type>Contact</item-type>
+ <label>Zone Armed (Contact)</label>
+ <description>Whether or not the zone is armed (CLOSED when armed)</description>
+ <state readOnly="true"></state>
+ </channel-type>
+
<channel-type id="pgm_status" advanced="true">
<item-type>Switch</item-type>
<label>PGM Status</label>
<channels>
<channel id="tripped" typeId="tripped"/>
<channel id="armed" typeId="armed"/>
+ <channel id="locked" typeId="locked"/>
<channel id="last_trip" typeId="last_trip"/>
<channel id="low_battery" typeId="system.low-battery"/>
<channel id="bypassed" typeId="bypassed"/>