mirror of
https://github.com/zyphlar/LanternPowerMonitor.git
synced 2024-03-08 14:07:47 +00:00
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:
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user