mirror of
https://github.com/zyphlar/LanternPowerMonitor.git
synced 2024-03-08 14:07:47 +00:00
Password reset functionality, ZWave switch schedule improvement, support zwave controller on pi, support relay switches and security sensors.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>com.neuronrobotics</groupId>
|
||||
<artifactId>nrjavaserial</artifactId>
|
||||
<version>3.15.0</version>
|
||||
<version>5.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
@@ -60,6 +60,46 @@
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.1</version>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<finalName>lantern-zwave</finalName>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<manifestEntries>
|
||||
<Main-Class>com.lanternsoftware.zwave.PortEnum</Main-Class>
|
||||
<Specification-Title>Lantern ZWave</Specification-Title>
|
||||
<Specification-Version>${project.version}</Specification-Version>
|
||||
<Specification-Vendor>Lantern Software, Inc.</Specification-Vendor>
|
||||
</manifestEntries>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.lanternsoftware.zwave;
|
||||
|
||||
import gnu.io.CommPortIdentifier;
|
||||
|
||||
import java.util.Enumeration;
|
||||
|
||||
public class PortEnum {
|
||||
public static void main(String[] args) {
|
||||
Enumeration<CommPortIdentifier> e = CommPortIdentifier.getPortIdentifiers();
|
||||
while (e.hasMoreElements()) {
|
||||
CommPortIdentifier id = e.nextElement();
|
||||
if (id != null) {
|
||||
System.out.println(id.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public enum CommandClass {
|
||||
TIME_PARAMETERS((byte)0x8B, "TIME_PARAMETERS"),
|
||||
GEOGRAPHIC_LOCATION((byte)0x8C, "GEOGRAPHIC_LOCATION"),
|
||||
COMPOSITE((byte)0x8D, "COMPOSITE"),
|
||||
MULTI_INSTANCE_ASSOCIATION((byte)0x8E, "MULTI_INSTANCE_ASSOCIATION"),
|
||||
MULTI_CHANNEL_ASSOCIATION((byte)0x8E, "MULTI_CHANNEL_ASSOCIATION"),
|
||||
MULTI_CMD((byte)0x8F, "MULTI_CMD"),
|
||||
ENERGY_PRODUCTION((byte)0x90, "ENERGY_PRODUCTION"),
|
||||
MANUFACTURER_PROPRIETARY((byte)0x91, "MANUFACTURER_PROPRIETARY"),
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
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 AssociationGetRequest extends RequestMessage {
|
||||
public AssociationGetRequest() {
|
||||
this((byte)0);
|
||||
}
|
||||
|
||||
public AssociationGetRequest(byte _nodeId) {
|
||||
super(_nodeId, ControllerMessageType.SendData, CommandClass.ASSOCIATION, (byte)0x02);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return name() + " node: " + nodeId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
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 AssociationReportRequest extends RequestMessage {
|
||||
private byte groupIdx;
|
||||
private byte maxAssociations;
|
||||
private byte numReportsToFollow;
|
||||
|
||||
public AssociationReportRequest() {
|
||||
this((byte) 0);
|
||||
}
|
||||
|
||||
public AssociationReportRequest(byte _nodeId) {
|
||||
super(_nodeId, ControllerMessageType.ApplicationCommandHandler, CommandClass.ASSOCIATION, (byte) 0x03);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromPayload(byte[] _payload) {
|
||||
nodeId = _payload[5];
|
||||
groupIdx = _payload[8];
|
||||
maxAssociations = _payload[9];
|
||||
numReportsToFollow = _payload[10];
|
||||
}
|
||||
|
||||
public byte getGroupIdx() {
|
||||
return groupIdx;
|
||||
}
|
||||
|
||||
public void setGroupIdx(byte _groupIdx) {
|
||||
groupIdx = _groupIdx;
|
||||
}
|
||||
|
||||
public byte getMaxAssociations() {
|
||||
return maxAssociations;
|
||||
}
|
||||
|
||||
public void setMaxAssociations(byte _maxAssociations) {
|
||||
maxAssociations = _maxAssociations;
|
||||
}
|
||||
|
||||
public byte getNumReportsToFollow() {
|
||||
return numReportsToFollow;
|
||||
}
|
||||
|
||||
public void setNumReportsToFollow(byte _numReportsToFollow) {
|
||||
numReportsToFollow = _numReportsToFollow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return name() + " node: " + nodeId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.lanternsoftware.zwave.message.impl;
|
||||
|
||||
import com.lanternsoftware.zwave.message.CommandClass;
|
||||
import com.lanternsoftware.zwave.message.SendDataRequestMessage;
|
||||
|
||||
public class AssociationSetRequest extends SendDataRequestMessage {
|
||||
private byte groupIdx;
|
||||
private byte targetNodeId;
|
||||
|
||||
public AssociationSetRequest() {
|
||||
this((byte)0, (byte)0, (byte)0);
|
||||
}
|
||||
|
||||
public AssociationSetRequest(byte _nodeId, byte _groupIdx, byte _targetNodeId) {
|
||||
super(_nodeId, CommandClass.ASSOCIATION, (byte) 0x01);
|
||||
groupIdx = _groupIdx;
|
||||
targetNodeId = _targetNodeId;
|
||||
}
|
||||
|
||||
public byte getGroupIdx() {
|
||||
return groupIdx;
|
||||
}
|
||||
|
||||
public void setGroupIdx(byte _groupIdx) {
|
||||
groupIdx = _groupIdx;
|
||||
}
|
||||
|
||||
public byte getTargetNodeId() {
|
||||
return targetNodeId;
|
||||
}
|
||||
|
||||
public void setTargetNodeId(byte _targetNodeId) {
|
||||
targetNodeId = _targetNodeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getPayload() {
|
||||
return asByteArray(groupIdx, targetNodeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return name() + " node: " + nodeId + " groupIdx: " + groupIdx + " targetNodeIdx: " + targetNodeId;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
com.lanternsoftware.zwave.message.impl.ApplicationUpdateRequest
|
||||
com.lanternsoftware.zwave.message.impl.AssociationGetRequest
|
||||
com.lanternsoftware.zwave.message.impl.AssociationReportRequest
|
||||
com.lanternsoftware.zwave.message.impl.BinarySwitchSetRequest
|
||||
com.lanternsoftware.zwave.message.impl.BinarySwitchReportRequest
|
||||
com.lanternsoftware.zwave.message.impl.ByteMessage
|
||||
|
||||
Reference in New Issue
Block a user