Adding missing methods and condition.
authorrtrimana <rtrimana@uci.edu>
Sat, 10 Aug 2019 18:19:44 +0000 (11:19 -0700)
committerrtrimana <rtrimana@uci.edu>
Sat, 10 Aug 2019 18:19:44 +0000 (11:19 -0700)
ColorControl/ColorControl.groovy
ColorControl/ColorControls.groovy
Extractor/ExtractorScript.py

index 4878c48b9f82c55e43a105068269d29e1b6f02dc..c3d652d1e8aa85090c56c75dcb2d564b368b26b6 100644 (file)
@@ -142,6 +142,16 @@ public class ColorControl {
                }
        }
 
+       def setLevel(long level) {
+               if (level != this.level) {
+                       this.currentLevel = level
+                       this.level = level
+                       println("The level of the light is changed to $level!")
+                       sendEvent([name: "level", value: "$level", deviceId: this.id, descriptionText: "",
+                                  displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+               }
+       }
+
        def setColorTemperature(int colorTemperature) {
                if (colorTemperature != this.colorTemperature) {
                        this.colorTemperature = colorTemperature
index 9b003f6189301780896e68525c7b74ecaf455566..90223c54bdd233baf3feb1690ed53477676ef9e9 100644 (file)
@@ -205,6 +205,14 @@ public class ColorControls {
                }
        }
 
+       def setLevel(long level) {
+               if (level != this.level) {
+                       this.currentLevel = level
+                       this.level = level
+                       colorControls[0].setLevel(level)
+               }
+       }
+
        def setColorTemperature(int colorTemperature) {
                if (colorTemperature != this.colorTemperature) {
                        this.colorTemperature = colorTemperature
index a5d46c899934a97e650c73d5a28ecd2f692dfdd3..1643c43b02ee8e6d758333bc5fd76fe319d785a5 100644 (file)
@@ -261,6 +261,7 @@ def AnalyzeCapabilities(Temp, appName, F):
                        Temp == "capability.switchLevel" or
                        Temp == "capability.illuminanceMeasurement" or
                        Temp == "capability.colorControl" or
+                       Temp == "capability.colorTemperature" or
                        #Motion related
                        Temp == "capability.motionSensor" or
                        Temp == "capability.accelerationSensor" or
@@ -289,7 +290,7 @@ def AnalyzeCapabilities(Temp, appName, F):
 def AnalyzePhysicalInteraction(app1Capab, app2Capab):
        #Light
        if ("capability.illuminanceMeasurement" in app1Capab) and ("capability.switch" in app2Capab or 
-                       "capability.switchLevel" in app2Capab or "capability.colorControl" in app2Capab):
+                       "capability.switchLevel" in app2Capab or "capability.colorControl" or "capability.colorTemperature" in app2Capab):
                print ("\nWARNING: Potential PHYSICAL CONFLICT (light) detected between App1 and App2!\n")
        #Motion
        # TODO: Technically this is not entirely precise since we need to be able to detect that the other app creates motion