Update influxdb-logger.groovy
authorRahmadi Trimananda <rahmadi.trimananda@uci.edu>
Wed, 7 Aug 2019 06:54:28 +0000 (23:54 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Wed, 7 Aug 2019 06:54:28 +0000 (23:54 -0700)
third-party/influxdb-logger.groovy

index 4eb95a2..90603c9 100755 (executable)
@@ -693,18 +693,67 @@ private manageSubscriptions() {
     // Subscribe to mode events:
     if (prefLogModeEvents) subscribe(location, "mode", handleModeEvent)
     
-    // Subscribe to device attributes (iterate over each attribute for each device collection in state.deviceAttributes):
-    def devs // dynamic variable holding device collection.
-    state.deviceAttributes.each { da ->
-        devs = settings."${da.devices}"
-        if (devs && (da.attributes)) {
-            da.attributes.each { attr ->
-                logger("manageSubscriptions(): Subscribing to attribute: ${attr}, for devices: ${da.devices}","info")
-                // There is no need to check if all devices in the collection have the attribute.
-                subscribe(devs, attr, handleEvent)
-            }
-        }
-    }
+    subscribe(accelerometers, "accelerometers", handleEvent)
+    subscribe(alarms, "alarms", handleEvent)
+    subscribe(batteries, "batteries", handleEvent)
+    subscribe(beacons, "beacons", handleEvent)
+    subscribe(buttons, "buttons", handleEvent)
+    subscribe(cos, "carbonMonoxide", handleEvent)
+    subscribe(cos, "carbonDioxide", handleEvent)
+    subscribe(colors, "hue", handleEvent)
+    subscribe(colors, "saturation", handleEvent)
+    subscribe(colors, "color", handleEvent)
+    subscribe(consumables, "consumableStatus", handleEvent)
+    subscribe(contacts, "contact", handleEvent)
+    subscribe(doorsControllers, "door", handleEvent)
+    subscribe(energyMeters, "energy", handleEvent)
+    subscribe(humidities, "humidity", handleEvent)
+    subscribe(illuminances, "illuminance", handleEvent)
+    subscribe(locks, "lock", handleEvent)
+    subscribe(motions, "motion", handleEvent)
+    subscribe(musicPlayers, "status", handleEvent)
+    subscribe(musicPlayers, "level", handleEvent)
+    subscribe(musicPlayers, "trackDescription", handleEvent)
+    subscribe(musicPlayers, "trackData", handleEvent)
+    subscribe(musicPlayers, "mute", handleEvent)
+    subscribe(peds, "steps", handleEvent)
+    subscribe(peds, "goal", handleEvent)
+    subscribe(phMeters, "pH", handleEvent)
+    subscribe(powerMeters, "power", handleEvent)
+    subscribe(powerMeters, "voltage", handleEvent)
+    subscribe(powerMeters, "current", handleEvent)
+    subscribe(powerMeters, "powerFactor", handleEvent)
+    subscribe(presences, "presence", handleEvent)
+    subscribe(pressures, "pressure", handleEvent)
+    subscribe(shockSensors, "shock", handleEvent)
+    subscribe(signalStrengthMeters, "lqi", handleEvent)
+    subscribe(signalStrengthMeters, "rssi", handleEvent)
+    subscribe(sleepSensors, "sleeping", handleEvent)
+    subscribe(smokeDetectors, "smoke", handleEvent)
+    subscribe(soundSensors, "sound", handleEvent)
+    subscribe(spls, "soundPressureLevel", handleEvent)
+    subscribe(switches, "switch", handleEvent)
+    subscribe(switchLevels, "level", handleEvent)
+    subscribe(tamperAlerts, "tamper", handleEvent)
+    subscribe(temperatures, "temperature", handleEvent)
+    subscribe(thermostats, "temperature", handleEvent)
+    subscribe(thermostats, "heatingSetpoint", handleEvent)
+    subscribe(thermostats, "coolingSetpoint", handleEvent)
+    subscribe(thermostats, "thermostatSetpoint", handleEvent)
+    subscribe(thermostats, "thermostatMode", handleEvent)
+    subscribe(thermostats, "thermostatFanMode", handleEvent)
+    subscribe(thermostats, "thermostatOperatingState", handleEvent)
+    subscribe(thermostats, "thermostatSetpointMode", handleEvent)
+    subscribe(thermostats, "scheduledSetpoint", handleEvent)
+    subscribe(thermostats, "optimisation", handleEvent)
+    subscribe(thermostats, "windowFunction", handleEvent)
+    subscribe(threeAxis, "threeAxis", handleEvent)
+    subscribe(touchs, "touch", handleEvent)
+    subscribe(uvs, "ultravioletIndex", handleEvent)
+    subscribe(valves, "contact", handleEvent)
+    subscribe(volts, "voltage", handleEvent)
+    subscribe(waterSensors, "water", handleEvent)
+    subscribe(windowShades, "windowShade", handleEvent)
 }
 
 /**