Skip to content

Commit dbe66e5

Browse files
authored
Add support for multilevel switch report V4 (openhab#1149)
Signed-off-by: Chris Jackson <[email protected]>
1 parent 842d60e commit dbe66e5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/openhab/binding/zwave/internal/protocol/commandclass/ZWaveMultiLevelSwitchCommandClass.java

+5
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ public void handleSwitchMultilevelSet(ZWaveCommandClassPayload payload, int endp
9797
@ZWaveResponseHandler(id = SWITCH_MULTILEVEL_REPORT, name = "SWITCH_MULTILEVEL_REPORT")
9898
public void handleSwitchMultilevelReport(ZWaveCommandClassPayload payload, int endpoint) {
9999
int value = payload.getPayloadByte(2);
100+
if (getVersion() == 4) {
101+
// Version 4 includes a target rather than the current value.
102+
// This fits better with the OH concepts
103+
value = payload.getPayloadByte(3);
104+
}
100105
logger.debug("NODE {}: Switch Multi Level report, value = {}", getNode().getNodeId(), value);
101106
ZWaveCommandClassValueEvent zEvent = new ZWaveCommandClassValueEvent(getNode().getNodeId(), endpoint,
102107
getCommandClass(), value);

0 commit comments

Comments
 (0)