robertvandervoort / SmartThings

156 stars 241 forks source link

Aeon SmartDimmer 6 DTHs not implementing Color Control properly #29

Open andrewsayre opened 5 years ago

andrewsayre commented 5 years ago

The three DTHs supporting Aeon SmartDimmer 6 implement Color Control (to change the LED color), but do not implement all of the required attributes and commands of the capability. The capability reference identifies attributes hue and saturation as required as well as supporting setHue and setSaturation. Currently, the DTHs are only supporting color and setColor.

There are built-in utilities to convert to/from color to hue/saturation:

From color hex to hue/sat:

def hsv = colorUtil.hexToHsv("#FFFFFF")
def hue = hsv[0]
def saturation = hsv[1]

From hue/sat to color hex:

def hue = 100
def saturation = 100
def color = colorUtil.hsvToHex(hue, saturation)