Skip to content

Commit

Permalink
Merge pull request #56 from ymerj/ymerj-patch
Browse files Browse the repository at this point in the history
missing component setHue and setSaturation
  • Loading branch information
ymerj committed Nov 16, 2022
2 parents e27d5a9 + 0a8574c commit 1ad74b4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions HA parent.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,26 @@ def componentSetColorTemperature(ch, colortemperature, level, transition=1){
executeCommand(ch, "turn_on", data)
}

def componentSetHue(ch, hue, transition=1)
{
if (logEnable) log.info("received setHue request from ${ch.label}")

convertedHue = Math.round(hue * 360/100)

data = [brightness_pct: "${ch.currentValue("level")}", hs_color: ["${convertedHue}", "${ch.currentValue("saturation")}"], transition: "${transition}"]
executeCommand(ch, "turn_on", data)
}

def componentSetSaturation(ch, saturation, transition=1)
{
if (logEnable) log.info("received setSaturation request from ${ch.label}")

convertedHue = Math.round(ch.currentValue("hue") * 360/100)

data = [brightness_pct: "${ch.currentValue("level")}", hs_color: ["${convertedHue}", "${saturation}"], transition: "${transition}"]
executeCommand(ch, "turn_on", data)
}

def componentSetSpeed(ch, speed) {
if (logEnable) log.info("received setSpeed request from ${ch.label}, with speed = ${speed}")
int percentage = 0
Expand Down

0 comments on commit 1ad74b4

Please sign in to comment.