Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to hide indicator value and show only icon #64

Open
zarebski-m opened this issue Jan 20, 2022 · 1 comment
Open

Option to hide indicator value and show only icon #64

zarebski-m opened this issue Jan 20, 2022 · 1 comment

Comments

@zarebski-m
Copy link

I would like to create an indicator that displays only icon, without the value. This makes sense for binary sensors. In my case I'd like a window indicator that changes the icon, without state value displayed:

indicators:
  window:
    source:
      entity: binary_sensor.bedroom_windows
    icon:
      template: |
        (value) => value === 'off' 
          ? 'mdi:window-closed' 
          : 'mdi:window-open'
      style: |
        (value) => value === 'off' 
          ? {} 
          : { color: 'blue' }

This works fine but it still displays sensor value next to the icon (on or off). I would like to hide the value completely and have just the icon indicator.

image
image

@jesseklm
Copy link

Solved with #121.

Yours would look like this:

indicators:
  window:
    source:
      entity: binary_sensor.bedroom_windows
    icon:
      template: |
        (value) => value === 'off' 
          ? 'mdi:window-closed' 
          : 'mdi:window-open'
      style: |
        (value) => value === 'off' 
          ? {} 
          : { color: 'blue' }
    value:
      style: |
        () => ({display: 'none'})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants