Commit 43080277 by Johan Ström

resolver/device: use default state int, also init properly in js

parent a483f12c
Pipeline #346 passed with stage
in 6 minutes 53 seconds
......@@ -725,8 +725,7 @@ void AgoResolver::eventHandler(const std::string& subject, qpid::types::Variant:
uint64_t timestamp;
timestamp = time(NULL);
device["lastseen"] = timestamp;
device["state"] = "0";
device["state"].setEncoding("utf8");
device["state"] = 0;
device["values"] = values;
device["stale"] = 0;
......
......@@ -18,7 +18,7 @@ function device(agocontrol, obj, uuid) {
this.action = ''; // dummy for table
this.name = ko.observable(this.name);
this.handledBy = this['handled-by'];
var currentState = parseInt(this.state);
var currentState = parseInt(this['state'] || 0);
this.state = ko.observable(currentState);
this.values = ko.observable(this.values);
this.timeStamp = ko.observable(timestampToString(this.lastseen));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment