Allow binary and dimmer switches to be grouped together. Allow a custom host to be sent to the power monitor hubs.

This commit is contained in:
Mark Milligan
2021-01-30 17:11:12 -06:00
parent 1a1acb9cbc
commit 7075c702df
9 changed files with 159 additions and 112 deletions

View File

@@ -53,8 +53,8 @@ public class Controller {
CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(_port);
serialPort = portIdentifier.open("zwaveport", 2000);
serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
serialPort.enableReceiveThreshold(1);
serialPort.enableReceiveTimeout(1000);
serialPort.disableReceiveThreshold();
serialPort.enableReceiveTimeout(500);
os = serialPort.getOutputStream();
running = true;
executor.submit(new MessageReceiver());

View File

@@ -0,0 +1,28 @@
package com.lanternsoftware.zwave.message.impl;
import com.lanternsoftware.zwave.message.CommandClass;
import com.lanternsoftware.zwave.message.ControllerMessageType;
import com.lanternsoftware.zwave.message.RequestMessage;
public class BinarySwitchReportRequest extends RequestMessage {
private int level;
public BinarySwitchReportRequest() {
super(ControllerMessageType.ApplicationCommandHandler, CommandClass.SWITCH_BINARY, (byte) 0x03);
}
@Override
public void fromPayload(byte[] _payload) {
nodeId = _payload[5];
level = _payload[9];
}
public int getLevel() {
return level;
}
@Override
public String describe() {
return name() + " node: " + nodeId + " level: " + level;
}
}

View File

@@ -1,5 +1,6 @@
com.lanternsoftware.zwave.message.impl.ApplicationUpdateRequest
com.lanternsoftware.zwave.message.impl.BinarySwitchSetRequest
com.lanternsoftware.zwave.message.impl.BinarySwitchReportRequest
com.lanternsoftware.zwave.message.impl.ByteMessage
com.lanternsoftware.zwave.message.impl.ControllerCapabilitiesRequest
com.lanternsoftware.zwave.message.impl.ControllerCapabilitiesResponse