I want to change the thermostat block. Now it only reacts on + and -
When pressing the heating icon nothing happens.
I've tried to change it using custom.js, but I can't seem to get it working.
What I want to achieve is the following:
when pressing the heating icon I want to set the temperature to 18 degrees if it was set to 10.
If the heating was set to anything other than 10 degrees, I want to set the heating to 10 degrees.
The plus and minus icons should still work (and that is where the problem arrises).
I can add a click event to the whole block, but not to the heating icon itself.
I followed the sample to set a click event to the block, but how can I set a click event only on the part next to the + and - icons?
Code: Select all
function getBlock_233(block){ //change 233 to the idx of your device!
var idx = block.idx; //the Dashticz id
var device = block.device; //The Domoticz device info
var $mountPoint = block.$mountPoint // The DOM entry point for this block
$mountPoint.find('.mh') //Find the correct block
.off('click') //remove any previous click handler
.click(function() { //install new click handler
switchDevice(block, 'toggle', false); //switch the device on click
})
.addClass('hover'); //and add the predefined hover css class
Bryan