itemValue-expression within sendCmd does not work

Hi there,

I have a button with a click-action to send a command and the value to send is evaluated with itemValue. Sadly this does not seem to work:

<button ng-click="sendCmd('ccu2_schalter_State', {{ itemValue('ccu2_schalter_State') == 'ON' ? 'OFF' : 'ON' }})"></button>

Am I missing something? I tried to put the whole itemValue-expression into apostrophes, but it did not change anything.

Best regards,
cyb

I do not know why the above does not work.

Workaround is to split it into two if-conditions:

<div ng-if="itemValue('ccu2_schalter_State') == 'ON'">
<button ng-click="sendCmd('ccu2_schalter_State', 'OFF')">
</div
<div ng-if="itemValue('ccu2_schalter_State') !== 'ON'">
<button ng-click="sendCmd('ccu2_schalter_State', 'ON')">
</div>

But actually not that nice…