Hi,
I have created a custom Pluging to manage temperature zone. I have created 9 zones all with same Attributes
these are the attributes defined for each zone:
In the interface I have binded HeatingSetpoint and so I can change each HeatingSetpoint for each zone.
I expected that in the “onChangeRequest” function in the “device” variable I received the reference to the correct device like “cucina” or “sala” but i see only value “gj”
To be more clear:
function onChangeRequest(device, attribute, value) {
console.log(attribute + "=" + value + ", device=" + device);
switch (attribute) {
case "Attivo":
device.Attivo = value;
break;
case "ScenarioAttivo":
if (device.ScenarioAttivo != value) {
CaricaTemperatureScenario;
};
break;
case "HeatingSetpoint":
device.HeatingSetpoint = value;
break;
case "Mode":
device.Mode = value;
break;
case "Luce":
device.Luce = value;
break;
case "TemperaturaReale":
device.TemperaturaReale = value;
break;
default:
break;
}
}
in the log i see:
HeatingSetpoint=23.5, device=gj
The code work fine but i would like better undestand.
what kind of object is device?
Thanks, Paolo