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

Customization is being ignored within paper-buttons-row #190

Closed
3 tasks done
drew1kun opened this issue Jun 14, 2020 · 7 comments
Closed
3 tasks done

Customization is being ignored within paper-buttons-row #190

drew1kun opened this issue Jun 14, 2020 · 7 comments

Comments

@drew1kun
Copy link

drew1kun commented Jun 14, 2020

Checklist

  • I'm running the latest version of CustomUI (Update guide) or using a specific release that is not marked as "Broken".
  • I tried to force-refresh (Ctrl+Shift+R / Ctrl+F5) the browser
  • (Optional, but recommended) I'm using Chrome or tried to reproduce the feature on Chrome.

Browser + Version:
Chrome Version 83.0.4103.61 (Official Build) (64-bit)

CustomUI version:
CustomUI: 20200520-adapted-for-HA110+

Home Assistant release (hass --version):
0.110.2

Problem-relevant configuration.yaml entries:

frontend:
  extra_module_url:
  - /local/custom_ui/state-card-custom-ui.js

homeassistant:
  customize_domain:
    climate:
      templates:
        icon_color: >
          if (state == 'heat_cool') return '#99AC18';
          if (state == 'heat') return '#F58019';
          if (state == 'cool') return '#268AD2';
          if (state == 'dry') return '#FFC100';
        icon: >
          if (state == 'heat_cool') return 'mdi:sync';
          if (state == 'heat') return 'mdi:fire';
          if (state == 'cool') return 'mdi:snowflake';
          if (state == 'dry') return 'mdi:water-percent';
          if (state == 'fan_only') return 'mdi:fan';
          return 'mdi:air-conditioner';

  customize:
    switch.all_climate_heat_cool:
      templates:
        icon_color: if (state == 'on') return '#99AC18';  # 'rgb(154, 171, 33)';  # Solarized Green
    switch.all_climate_heat:
      templates:
        icon_color: if (state == 'on') return '#F58019';  # 'rgb(245, 128, 25)';  # Orange
    switch.all_climate_cool:
      templates:
        icon_color: if (state == 'on') return '#268AD2';  # 'rgb(76, 154, 218)';  # Solarized Blue
    switch.all_climate_dry:
      templates:
        icon_color: if (state == 'on') return '#FFC100';  # 'rgb(248, 192, 30)';  # Solarized Yellow

ui-lovelace.yaml - comparison: entities card vs paper-buttons-row (within auto-entities card)

...
  - type: entities
    title: Climate
    entities:
    - climate.kitchen_ac
    - climate.bedroom_ac
    footer:
      type: buttons
      entities:
      - switch.all_climate_heat_cool
      - switch.all_climate_heat
      - switch.all_climate_cool
      - switch.all_climate_dry
      - switch.all_climate_power_off

  - type: custom:auto-entities
    card:
      type: entities
      title: Climate
      show_header_toggle: false
    entities:
    - climate.kitchen_ac
    - climate.bedroom_ac
    - type: custom:paper-buttons-row
      buttons:
      - entity: switch.all_climate_heat_cool
        name: false
      - entity: switch.all_climate_heat
        name: false
      - entity: switch.all_climate_cool
        name: false
      - entity: switch.all_climate_dry
        name: false
      - entity: switch.all_climate_power_off
        name: false
...

Result:

  • Entities card (the above) colorizes switches in accordance with the customization (snowflake is blue).
  • Auto-entities (the below) colorizes climate entities in accordance with the customization (snowflake is blue).
  • paper-buttons-row (the below row) seems to ignore the customization (snowflake is yellow).

Screen Shot 2020-06-14 at 1 26 39 PM

Problem-relevant Home Assistant log entries:


Any errors from browser Javascript console:


@drew1kun
Copy link
Author

tried to put the paper-buttons-row into entities card like so:

 title: Home Controls
  cards:
  - type: entities
    title: Climate
    entities:
    - climate.kitchen_ac
    - climate.bedroom_ac
    - type: custom:paper-buttons-row
      buttons:
      - entity: switch.all_climate_heat_cool
        name: false
      - entity: switch.all_climate_heat
        name: false
      - entity: switch.all_climate_cool
        name: false
      - entity: switch.all_climate_dry
        name: false
      - entity: switch.all_climate_power_off
        name: false
    footer:
      type: buttons
      entities:
      - switch.all_climate_heat_cool
      - switch.all_climate_heat
      - switch.all_climate_cool
      - switch.all_climate_dry
      - switch.all_climate_power_off

Same thing:
Screen Shot 2020-06-14 at 2 07 02 PM

So I guess there may be a problem with the paper-buttons-row

@drew1kun drew1kun changed the title Customization is being ignored within paper-buttons-row card Customization is being ignored within paper-buttons-row Jun 14, 2020
@Mariusthvdb
Copy link

Mariusthvdb commented Jun 14, 2020

don't use the https://github.com/jcwillox/lovelace-paper-buttons-row myself.
Did is customize icon_color: before?
I think Bram might have changed HA core on the paper-buttons, so maybe that is causing it? (not sure though...)

@drew1kun
Copy link
Author

hmm what would you use in this case then?

@Mariusthvdb
Copy link

Mariusthvdb commented Jun 14, 2020

fwiw Id use a core glance card for the moment.

btw, I can confirm the paper-buttons-row card doesnt use the icon_color, have quickly installed it in my test environment.

I have asked Bram #185 (comment)

Still, please let me know if this is new behavior? Did it change recently after an update?

@drew1kun
Copy link
Author

I see.. Sorry, I only created this setup today, so there is no way I can tell wether it worked properly on previous versions...

@Mariusthvdb
Copy link

maybe you can create an issue on my repo, since this one is no longer maintained.
https://github.com/Mariusthvdb/custom-ui

and reference this one., so you can close here.

@drew1kun
Copy link
Author

Ok, so closing this one then!

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