[Debian-iot-packaging] [openzwave-controlpanel] 46/81: update for the ZWavePlus CC
Dara Adib
daradib-guest at moszumanska.debian.org
Thu Dec 22 16:57:50 UTC 2016
This is an automated email from the git hooks/post-receive script.
daradib-guest pushed a commit to branch debian/master
in repository openzwave-controlpanel.
commit 1f98f493f2337b5931f0b17e61919b0152504127
Author: Justin Hammond <justin at dynam.ac>
Date: Wed Jun 24 23:00:40 2015 +0800
update for the ZWavePlus CC
---
cp.js | 5 +++++
webserver.cpp | 14 ++++++++++++--
zwavelib.cpp | 4 +---
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/cp.js b/cp.js
index b0b30d9..a3a103a 100644
--- a/cp.js
+++ b/cp.js
@@ -213,6 +213,7 @@ function PollReply()
manufacturer: elem[i].getAttribute('manufacturer'), product: elem[i].getAttribute('product'),
name: elem[i].getAttribute('name'), location: elem[i].getAttribute('location'),
listening: elem[i].getAttribute('listening') == 'true', frequent: elem[i].getAttribute('frequent') == 'true',
+ zwaveplus: elem[i].getAttribute('zwaveplus') == 'true',
beam: elem[i].getAttribute('beam') == 'true', routing: elem[i].getAttribute('routing') == 'true',
security: elem[i].getAttribute('security') == 'true', status: elem[i].getAttribute('status'),
values: null, groups: null};
@@ -330,6 +331,10 @@ function PollReply()
ext = ext + 'S';
exthelp = exthelp + 'security, ';
}
+ if (nodes[i].zwaveplus) {
+ ext = ext + "+";
+ exthelp = exthelp + 'ZwavePlus, ';
+ }
if (exthelp.length > 0)
exthelp = exthelp.substr(0, exthelp.length - 2);
stuff=stuff+'<tr id="node'+i+'" onmouseover="this.className=\'highlight\';" onmouseout="if (this.id == curnode) this.className=\'click\'; else this.className=\'normal\';" onclick="return SaveNode(this.id);" ondblClick="ClearNode(); return DisplayNode();"><td onmouseover="ShowToolTip(\''+exthelp+'\',0);" onmouseout="HideToolTip();">'+nodes[i].id+ext+'</td><td>'+nodes[i].btype+'</td><td>'+nodes[i].gtype+'</td><td>'+nodes[i].manufacturer+' '+nodes[i].product+'</td><td>'+nodes[i].name+'</ [...]
diff --git a/webserver.cpp b/webserver.cpp
index ef7169a..7654074 100644
--- a/webserver.cpp
+++ b/webserver.cpp
@@ -732,11 +732,20 @@ int Webserver::SendPollResponse (struct MHD_Connection *conn)
if (nodes[i] != NULL && nodes[i]->getChanged()) {
bool listening;
bool flirs;
+ bool zwaveplus;
TiXmlElement* nodeElement = new TiXmlElement("node");
pollElement->LinkEndChild(nodeElement);
nodeElement->SetAttribute("id", i);
- nodeElement->SetAttribute("btype", nodeBasicStr(Manager::Get()->GetNodeBasic(homeId, i)));
- nodeElement->SetAttribute("gtype", Manager::Get()->GetNodeType(homeId, i).c_str());
+ zwaveplus = Manager::Get()->IsNodeZWavePlus(homeId, i);
+ if (zwaveplus) {
+ string value = Manager::Get()->GetNodePlusTypeString(homeId, i);
+ value += " " + Manager::Get()->GetNodeRoleString(homeId, i);
+ nodeElement->SetAttribute("btype", value.c_str());
+ nodeElement->SetAttribute("gtype", Manager::Get()->GetNodeDeviceTypeString(homeId, i).c_str());
+ } else {
+ nodeElement->SetAttribute("btype", nodeBasicStr(Manager::Get()->GetNodeBasic(homeId, i)));
+ nodeElement->SetAttribute("gtype", Manager::Get()->GetNodeType(homeId, i).c_str());
+ }
nodeElement->SetAttribute("name", Manager::Get()->GetNodeName(homeId, i).c_str());
nodeElement->SetAttribute("location", Manager::Get()->GetNodeLocation(homeId, i).c_str());
nodeElement->SetAttribute("manufacturer", Manager::Get()->GetNodeManufacturerName(homeId, i).c_str());
@@ -745,6 +754,7 @@ int Webserver::SendPollResponse (struct MHD_Connection *conn)
nodeElement->SetAttribute("listening", listening ? "true" : "false");
flirs = Manager::Get()->IsNodeFrequentListeningDevice(homeId, i);
nodeElement->SetAttribute("frequent", flirs ? "true" : "false");
+ nodeElement->SetAttribute("zwaveplus", zwaveplus ? "true" : "false");
nodeElement->SetAttribute("beam", Manager::Get()->IsNodeBeamingDevice(homeId, i) ? "true" : "false");
nodeElement->SetAttribute("routing", Manager::Get()->IsNodeRoutingDevice(homeId, i) ? "true" : "false");
nodeElement->SetAttribute("security", Manager::Get()->IsNodeSecurityDevice(homeId, i) ? "true" : "false");
diff --git a/zwavelib.cpp b/zwavelib.cpp
index 59af67e..ce3ea46 100644
--- a/zwavelib.cpp
+++ b/zwavelib.cpp
@@ -141,7 +141,6 @@ const char *nodeBasicStr (uint8 basic)
const char *cclassStr (uint8 cc)
{
switch (cc) {
- default:
case 0x00:
return "NO OPERATION";
case 0x20:
@@ -507,7 +506,6 @@ const char *controllerErrorStr (Driver::ControllerError err)
return "Disabled";
case Driver::ControllerError_Overflow:
return "Overflow";
- default:
- return "Unknown error";
}
+ return "Unknown";
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-iot/openzwave-controlpanel.git
More information about the Debian-iot-packaging
mailing list