aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Lyngstol <kly@kly@.no>2016-03-23 17:49:06 +0100
committerKristian Lyngstol <kly@kly@.no>2016-03-23 17:49:06 +0100
commit214178ac49d57a7396794e1411e395701eec90db (patch)
treed321a913a98d7243861e7beddbfda32e30d2dfe2
parenta174cec51faa448973056847e5c664801222c739 (diff)
NMS: Update temp map to use public api
-rw-r--r--web/nms.gathering.org/js/nms-map-handlers.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/web/nms.gathering.org/js/nms-map-handlers.js b/web/nms.gathering.org/js/nms-map-handlers.js
index 6de2943..7c13421 100644
--- a/web/nms.gathering.org/js/nms-map-handlers.js
+++ b/web/nms.gathering.org/js/nms-map-handlers.js
@@ -236,16 +236,14 @@ function tempUpdater()
var t = "white";
var temp = "";
- if(!nmsData.snmp || !nmsData.snmp.snmp || ! nmsData.snmp.snmp[sw] || !nmsData.snmp.snmp[sw]["misc"] || !nmsData.snmp.snmp[sw]["misc"]["enterprises.2636.3.1.13.1.7.7.1.0.0"])
+ if(!nmsData.switchstate || !nmsData.switchstate.switches || !nmsData.switchstate.switches[sw] || !nmsData.switchstate.switches[sw].temp)
continue;
- var tempObj = nmsData.snmp.snmp[sw]["misc"]["enterprises.2636.3.1.13.1.7.7.1.0.0"];
- if(tempObj[""]) {
- temp = tempObj[""] + "°C";
- t = temp_color(temp);
- nmsMap.setSwitchColor(sw, t);
- nmsMap.setSwitchInfo(sw, temp);
- }
+ var t = nmsData.switchstate.switches[sw].temp;
+ temp = t + "°C";
+ t = temp_color(temp);
+ nmsMap.setSwitchColor(sw, t);
+ nmsMap.setSwitchInfo(sw, temp);
}
}