Page 1 of 1

Dashticz change temperature text color

Posted: Monday 11 November 2019 20:35
by cornesch
Hello,


Is it possible to change the text color of a temperature block when another block changes status in Dashticz?

I display the temperature of the living room in white, when the boiler starts heating I want the text color to change from white to red.

I have already tried a few things in the custom.js file, but I am not getting a good result.


I hope someone can help me with this,

Corné

Re: Dashticz change temperature text color

Posted: Monday 11 November 2019 23:13
by HansieNL
An example if device 123 is on change color of col-data of device 234 to red.
custom.js:

Code: Select all

function afterGetDevices(){
  if (alldevices[123].Data == 'On') {
    $('.block_234 .col-data').addClass('textred');
  }
  else {
    $('.block_234 .col-data').removeClass('textred');
  }
}
custom.css:

Code: Select all

.textred {
	color: red !important;
}

Re: Dashticz change temperature text color

Posted: Tuesday 12 November 2019 7:12
by cornesch
@HansieNL

Thanks, it works.

This code is even simpler than what I was trying