Rename Open / Closed and Template widget "state"

ng-style + the ternary operator to the rescue:

<div 
     ng-style="{
      'background-color': itemValue('EG_Buero_Fenster_beide')=='OPEN' ? '#26FF33' : '#FF7373'
     }"
     class="template-container"
     style="top:0;bottom:0;left:0;right:0;position:absolute">
  <div class="template-contents">
    <widget-icon iconset="'eclipse-smarthome-classic'" icon="'window'"
     state="itemValue('EG_Buero_Fenster_beide')" size="100" center="true" />
  </div>
</div>

Also the widget-icon can pass the state to the icon API when using the ESH classic iconset, so the actual icon adapts to the state, and the icons are not colorized.

OPEN:

anything else:

4 Likes