artem-sedykh / mini-climate-card

Minimalistic climate card for Home Assistant Lovelace UI
MIT License
281 stars 19 forks source link

Indicator Mapper for Icon an Source #91

Closed Olum-hack closed 2 years ago

Olum-hack commented 2 years ago

Hello, I have a problem with the mapper of an indicator:

tur:
  icon:
    template: >
      (value) => (value === 'Zu' ? 'mdi:door-closed' : 'mdi:door-open')
  source: 
    values:
      'on': 'Offen'
      'off': 'Zu'
    entity: binary_sensor.eg_luftung_kuchentur
    mapper: value => this.source.values[value]
  tap_action: more-info

I have to put the mapped values in the template of the icon. Is that correct? Or should the value of the icon separate to the value of the source?

regevbr commented 2 years ago

the mapped one - so what you did is correct. You can check it very quickly...