UI template led not working anymore

#1

I'm using these led without any problems for a while and since 19.5 the script doesn't respond anymore to payloads, and this on two separate systems. Is something deprecated lately in this code?

<!DOCTYPE html>

<style>
:focus {
outline: 0;
}
md-led2{
    display: block;
	border-radius:80px;
	border:2px solid #666666;
	width: 16px; 
	height:16px;
	margin: 5px 0px 0px 5px; 	
	background: -webkit-radial-gradient(#9AF589, #42B821);
    text-align:center;	
 }

</style>
<p style="font-size:100%;text-align:center;margin: -2px;">1</p>
<md-led2
    ng-style="{background: msg.payload=='on' ?'transparrent':'#423f3f'}"
    
>
{{msg.payload == 'off' ? '' : ''}}
</md-led2>

you could check this with payloads of on and off.

Thanks.

0 Likes

#2

Are you aware there is now a node-red-contrib-ui-led that you might find useful

0 Likes

#3

maybe if you spell transparent correctly ?

1 Like

#4

Got it. I took this code from elswhere and never touched it and i was using as is on over 20 flows. The original poster must have made the typo on purpose to not let the led transparent but use this light gray color #423f3f instead. It was working as is but now it won't for unknown reasons. I just let the space between the ' ' empty and now it works like before.

<!DOCTYPE html>

<style>
:focus {
outline: 0;
}
md-led2{
    display: block;
	border-radius:80px;
	border:2px solid #666666;
	width: 16px; 
	height:16px;
	margin: 5px 0px 0px 5px; 	
	background: -webkit-radial-gradient(#9AF589, #42B821);
    text-align:center;	
 }

</style>
<p style="font-size:100%;text-align:center;margin: -2px;">1</p>
<md-led2
    ng-style="{background: msg.payload=='on' ?'':'#423f3f'}"
    
>
{{msg.payload == 'off' ? '' : ''}}
</md-led2>

Thanks.

0 Likes