I'm trying to change the color of a block if the Last_Update of the corresponding domoticz device is greater than 1 hour.
Here is the part of my CONFIG.js
Code: Select all
function afterGetDevices(){
var device = Domoticz.getAllDevices()['348'];
if(moment(device['LastUpdate']).unix() < (moment().unix() - (3600))) {
Dashticz.setBlock('348', {
addClass: 'update_timeout'
});
}
else {
Dashticz.setBlock('348', {
addClass: 'update_OK'
});
}
}
Code: Select all
.update_timeout {
background: rgba(230, 101, 92, 0.8)!important;
background-clip: padding-box;
}
.update_OK {
background: rgba(81, 204, 252, 0.4)!important;
background-clip: padding-box;
}
What am I doing wrong ?
Thank you for your help