Next question, trying to understand the interfaces between clicking on the widgets and the corresponding code. For example I am trying to use the colorlight widget to adjust a RGB LED on my arduino.
I added the widget in trigger/setup:
Program.AddVirtualModules("HomeAutomation.ArduinoBsmtUtil", "Sensor", "homegenie/generic/sensor", 1, 4);
Program.AddVirtualModules("HomeAutomation.ArduinoBsmtUtil", "Light", "homegenie/generic/colorlight", 5, 5);
Then in my code I have a function to send the RGB values via my serial port to Arduino, this part is working :-) .
Looking at the Fibraro and MiLight RGB lights for examples, I see they have code in
When.ModuleParameterChanged( (module, property) => {
for Control.On and Control.Off, but not for Control.Level or Control.ColorHsb
They do handle these in the webservice call however:
When.WebServiceCallReceived("HomeAutomation.MiLight", ( args ) =>
...
case "Control.ColorHsb":
string[] values = parameter.Split(',');
So this brings the question, do widgets use the webservicecall or moduleparameterchange to execute the code?
Do the LED's or HSV values need to be formal module parameters?
Thanks!!!