From 214178ac49d57a7396794e1411e395701eec90db Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Wed, 23 Mar 2016 17:49:06 +0100 Subject: NMS: Update temp map to use public api --- web/nms.gathering.org/js/nms-map-handlers.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'web/nms.gathering.org/js/nms-map-handlers.js') 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); } } -- cgit v1.2.3