mirror of
https://github.com/zyphlar/LanternPowerMonitor.git
synced 2024-03-08 14:07:47 +00:00
Make sure the switch states stay in sync across zwave controller nodes. Allow switches to be grouped in a hierarchy.
This commit is contained in:
@@ -14,6 +14,7 @@ public class Switch {
|
||||
private String room;
|
||||
private String name;
|
||||
private int nodeId;
|
||||
private int parentNodeId;
|
||||
private int level;
|
||||
private int gpioPin;
|
||||
private boolean primary;
|
||||
@@ -82,6 +83,14 @@ public class Switch {
|
||||
nodeId = _nodeId;
|
||||
}
|
||||
|
||||
public int getParentNodeId() {
|
||||
return parentNodeId;
|
||||
}
|
||||
|
||||
public void setParentNodeId(int _parentNodeId) {
|
||||
parentNodeId = _parentNodeId;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ public class SwitchSerializer extends AbstractDaoSerializer<Switch>
|
||||
d.put("room", _o.getRoom());
|
||||
d.put("name", _o.getName());
|
||||
d.put("node_id", _o.getNodeId());
|
||||
d.put("parent_node_id", _o.getParentNodeId());
|
||||
d.put("level", _o.getLevel());
|
||||
d.put("gpio_pin", _o.getGpioPin());
|
||||
d.put("primary", _o.isPrimary());
|
||||
@@ -53,6 +54,7 @@ public class SwitchSerializer extends AbstractDaoSerializer<Switch>
|
||||
o.setRoom(DaoSerializer.getString(_d, "room"));
|
||||
o.setName(DaoSerializer.getString(_d, "name"));
|
||||
o.setNodeId(DaoSerializer.getInteger(_d, "node_id"));
|
||||
o.setParentNodeId(DaoSerializer.getInteger(_d, "parent_node_id"));
|
||||
o.setLevel(DaoSerializer.getInteger(_d, "level"));
|
||||
o.setGpioPin(DaoSerializer.getInteger(_d, "gpio_pin"));
|
||||
o.setPrimary(DaoSerializer.getBoolean(_d, "primary"));
|
||||
|
||||
Reference in New Issue
Block a user