DavidR
(David Read)
1
I have been using this snippet as part of a setpoint widget, but it doesn’t work when the Item is Number:Temperature
<button class="btn" ng-click="sendCmd('MorningTemperature', +itemState('MorningTemperature')+0.1)"><span class="glyphicon glyphicon-plus" style="color: red"></span></button>
Does anyone know the correct syntax?
DavidR
(David Read)
2
Anyone?
Perhaps I worded the question badly.
In a template, I know how to get the number part of a Number:Temperature item with
{{’%.1f’ | sprintf:itemState(‘MorningTemperature’).split(’ ')[0]}}
but I now want to take that value, add 0.1 to it, and set the item
My html/angular skills are sadly lacking. Can anyone help, or hint to where to look.
ysc
(Yannick Schaus)
3
Maybe this?
ng-click="sendCmd('MorningTemperature', +itemState('MorningTemperature').split(' ')[0]+0.1)"
1 Like
DavidR
(David Read)
4
Well, that’s embarrassing. It works perfectly.
I think that is what I tried first of all, but must have mistyped something.
Thanks Yannick.
1 Like