artem-sedykh / mini-climate-card

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

Ability to disable hvac_mode and fan_mode icons #15

Closed divanikus closed 4 years ago

divanikus commented 4 years ago

Since now we can have buttons on the main view, it would be cool to be able to disable hvac_mode and fan_mode icons completelly. I mean just hide them.

Or maybe I'm missing something? image

My current setup is the following:

buttons:
  auto:
    icon: 'mdi:cached'
    location: main
    state:
      mapper: 'state => (state == ''heat_cool'' ? ''on'': ''off'')'
    toggle_action: >
      (state, entity, climate_entity) => this.call_service('climate',
      'set_hvac_mode', { entity_id: climate_entity.entity_id, hvac_mode:
      'heat_cool' })
  cool:
    icon: 'mdi:snowflake'
    location: main
    state:
      mapper: 'state => (state == ''cool'' ? ''on'': ''off'')'
    toggle_action: >
      (state, entity, climate_entity) => this.call_service('climate',
      'set_hvac_mode', { entity_id: climate_entity.entity_id, hvac_mode: 'cool'
      })
  dry:
    icon: 'mdi:water-percent'
    location: main
    state:
      mapper: 'state => (state == ''dry'' ? ''on'': ''off'')'
    toggle_action: >
      (state, entity, climate_entity) => this.call_service('climate',
      'set_hvac_mode', { entity_id: climate_entity.entity_id, hvac_mode: 'dry'
      })
  fan:
    icon: 'mdi:fan'
    location: main
    state:
      mapper: 'state => (state == ''fan_only'' ? ''on'': ''off'')'
    toggle_action: >
      (state, entity, climate_entity) => this.call_service('climate',
      'set_hvac_mode', { entity_id: climate_entity.entity_id, hvac_mode:
      'fan_only' })
  heat:
    icon: 'mdi:fire'
    location: main
    state:
      mapper: 'state => (state == ''heat'' ? ''on'': ''off'')'
    toggle_action: >
      (state, entity, climate_entity) => this.call_service('climate',
      'set_hvac_mode', { entity_id: climate_entity.entity_id, hvac_mode: 'heat'
      })
  power:
    icon: 'mdi:power'
    location: main
    toggle_action: "(\tstate, entity, climate_entity) => this.call_service('climate', 'set_hvac_mode', { entity_id: climate_entity.entity_id, hvac_mode: 'off' })\n"
entity: climate.konditsioner
secondary_info:
  type: fan-mode-dropdown
hvac_mode:
  change_action: >
    (selected, entity) => this.call_service('climate', 'set_hvac_mode', {
    entity_id: entity.entity_id, hvac_mode: selected })
  source:
    cool:
      icon: 'mdi:snowflake'
      name: Охлаждение
    dry:
      icon: 'mdi:water-percent'
      name: Осушение
    fan_only:
      icon: 'mdi:fan'
      name: Вентиляция
    heat:
      icon: 'mdi:fire'
      name: Обогрев
    heat_cool:
      icon: 'mdi:cached'
      name: Авто
    'off':
      icon: 'mdi:power'
      name: Выкл
type: 'custom:mini-climate'
divanikus commented 4 years ago

I've missed fan_mode.hide. So we just need hvac_mode.hide.

artem-sedykh commented 4 years ago

do it =)

divanikus commented 4 years ago

I can see config.hide in the HvacModeObject, but seems like it doesn't do anything. I'm not that good in JS unfortunatelly.

artem-sedykh commented 4 years ago

Yes, she is, but not processed

artem-sedykh commented 4 years ago

released v1.2.3

divanikus commented 4 years ago

Thanks!