[powermax] New channel of type Contact to show the zone arm status (#9192)
Allow using lock icon from the classic iconset Allow displaying the "Locks" badge in MainUI Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
parent
102f770881
commit
ef31659452
@ -59,6 +59,7 @@ public class PowermaxBindingConstants {
|
|||||||
public static final String LAST_TRIP = "last_trip";
|
public static final String LAST_TRIP = "last_trip";
|
||||||
public static final String BYPASSED = "bypassed";
|
public static final String BYPASSED = "bypassed";
|
||||||
public static final String ARMED = "armed";
|
public static final String ARMED = "armed";
|
||||||
|
public static final String LOCKED = "locked";
|
||||||
public static final String LOW_BATTERY = "low_battery";
|
public static final String LOW_BATTERY = "low_battery";
|
||||||
public static final String PGM_STATUS = "pgm_status";
|
public static final String PGM_STATUS = "pgm_status";
|
||||||
public static final String X10_STATUS = "x10_status";
|
public static final String X10_STATUS = "x10_status";
|
||||||
|
|||||||
@ -558,20 +558,10 @@ public class PowermaxBridgeHandler extends BaseBridgeHandler implements Powermax
|
|||||||
PowermaxThingHandler handler = (PowermaxThingHandler) thing.getHandler();
|
PowermaxThingHandler handler = (PowermaxThingHandler) thing.getHandler();
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
if (thing.getThingTypeUID().equals(THING_TYPE_ZONE)) {
|
if (thing.getThingTypeUID().equals(THING_TYPE_ZONE)) {
|
||||||
if ((channel == null) || channel.equals(TRIPPED)) {
|
for (String channelId : List.of(TRIPPED, LAST_TRIP, BYPASSED, ARMED, LOCKED, LOW_BATTERY)) {
|
||||||
handler.updateChannelFromAlarmState(TRIPPED, state);
|
if ((channel == null) || channel.equals(channelId)) {
|
||||||
}
|
handler.updateChannelFromAlarmState(channelId, 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);
|
|
||||||
}
|
}
|
||||||
} else if (thing.getThingTypeUID().equals(THING_TYPE_X10)) {
|
} else if (thing.getThingTypeUID().equals(THING_TYPE_X10)) {
|
||||||
if ((channel == null) || channel.equals(X10_STATUS)) {
|
if ((channel == null) || channel.equals(X10_STATUS)) {
|
||||||
|
|||||||
@ -191,6 +191,8 @@ public class PowermaxThingHandler extends BaseThingHandler implements PowermaxPa
|
|||||||
updateState(BYPASSED, state.isSensorBypassed(num) ? OnOffType.ON : OnOffType.OFF);
|
updateState(BYPASSED, state.isSensorBypassed(num) ? OnOffType.ON : OnOffType.OFF);
|
||||||
} else if (channel.equals(ARMED) && (state.isSensorArmed(num) != null)) {
|
} else if (channel.equals(ARMED) && (state.isSensorArmed(num) != null)) {
|
||||||
updateState(ARMED, state.isSensorArmed(num) ? OnOffType.ON : OnOffType.OFF);
|
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)) {
|
} else if (channel.equals(LOW_BATTERY) && (state.isSensorLowBattery(num) != null)) {
|
||||||
updateState(LOW_BATTERY, state.isSensorLowBattery(num) ? OnOffType.ON : OnOffType.OFF);
|
updateState(LOW_BATTERY, state.isSensorLowBattery(num) ? OnOffType.ON : OnOffType.OFF);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,11 +109,18 @@
|
|||||||
|
|
||||||
<channel-type id="armed">
|
<channel-type id="armed">
|
||||||
<item-type>Switch</item-type>
|
<item-type>Switch</item-type>
|
||||||
<label>Zone Armed</label>
|
<label>Zone Armed (Switch)</label>
|
||||||
<description>Whether or not the zone is armed</description>
|
<description>Whether or not the zone is armed</description>
|
||||||
<state readOnly="true"></state>
|
<state readOnly="true"></state>
|
||||||
</channel-type>
|
</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">
|
<channel-type id="pgm_status" advanced="true">
|
||||||
<item-type>Switch</item-type>
|
<item-type>Switch</item-type>
|
||||||
<label>PGM Status</label>
|
<label>PGM Status</label>
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
<channels>
|
<channels>
|
||||||
<channel id="tripped" typeId="tripped"/>
|
<channel id="tripped" typeId="tripped"/>
|
||||||
<channel id="armed" typeId="armed"/>
|
<channel id="armed" typeId="armed"/>
|
||||||
|
<channel id="locked" typeId="locked"/>
|
||||||
<channel id="last_trip" typeId="last_trip"/>
|
<channel id="last_trip" typeId="last_trip"/>
|
||||||
<channel id="low_battery" typeId="system.low-battery"/>
|
<channel id="low_battery" typeId="system.low-battery"/>
|
||||||
<channel id="bypassed" typeId="bypassed"/>
|
<channel id="bypassed" typeId="bypassed"/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user