Dial : customize grey dial bezel color depending on value
Posted: Saturday 20 February 2021 0:16
Hello !
I'm using the dial block and i'm trying to switch the dial bezel color depending on the current value of the Dial.
I got it working with standard block but not able to make it work with the default dial...
My block :
My function on custom.js :
Thanks in advance.
I'm using the dial block and i'm trying to switch the dial bezel color depending on the current value of the Dial.
I got it working with standard block but not able to make it work with the default dial...
My block :
Ths css i want to apply :blocks['nrj_conso'] = {
idx: 1027,
title: 'Conso',
type: 'dial',
values: ['Usage','CounterToday'],
min: 0,
max: 7000,
width: 3,
showunit: true,
shownumbers: false,
showring: true,
animation: false,
flash: true,
last_update: false
}
.warning {
background-color: #bb2424;
}
My function on custom.js :
If someone can helpfunction getStatus_nrj_conso(block) {
var value = block.device.Usage;
if (parseFloat(value) > 100 ) {
block.addClass='warning';
} else {
block.addClass='';
}
}
Thanks in advance.