This is something that i find strange.
I add a listener for change:metrics:level
Code: Select all
this.controller.devices.on(this.config.device, 'change:metrics:level', this.handler);
Code: Select all
this.handler = function (vDev) {
var value = vDev.get("metrics:level");
};
If I in the expert GUI change the state for the device that i am listening to then i will get two responses, first the value the device had and then the value it became.
This means if the device was On and a changed it in GUI to Off then i will get this
value = On
value = Off
And my listener also get called every time i push the update for that device in Expert GUI.
So my question is, what should i listen on to only get the actual change of an device and not every update on same state?