Had a similar chunk of code, swore it worked and didn’t throw an error a few weeks ago in VS code. Open the rules file a few days ago to work on something else and VS code flagged the last line of the following with similar error
var DecimalType hueINT = new DecimalType(0)
var PercentType saturationINT = new PercentType(100)
var PercentType brightnessINT = new PercentType(5)
var HSBType lightOBJ = new HSBType(hueINT, saturationINT, brightnessINT)
Hue_Stairwell_Color.sendCommand(lightOBJ)
Had to comment out the last line to get the file to not throw this error. VS code has auto updated itself a couple times, maybe something changed in VS code?
You are getting this error because the item Yeelightc_5 can accept different types of command and VS is struggling to find out which one you actually mean to use even through you declared an HSBType.
var DecimalType hueINT = new DecimalType(0)
var PercentType saturationINT = new PercentType(100)
var PercentType brightnessINT = new PercentType(5)
var HSBType lightOBJ = new HSBType(hueINT, saturationINT, brightnessINT)
Hue_Stairwell_Color.sendCommand(lightOBJ)
but this does
var DecimalType hueINT = new DecimalType(0)
var PercentType saturationINT = new PercentType(100)
var PercentType brightnessINT = new PercentType(5)
var HSBType lightOBJ = new HSBType(hueINT, saturationINT, brightnessINT)
Hue_Stairwell_Color.sendCommand(lightOBJ.toString)
just checked it, Vincent is right. I can set a Lifx bulb like this:
LifXbulb.sendcommand('0,100,2')
but I have to construct a HSBType for my Hue bulbs, then use toString on the variable to work.