iantrich / restriction-card

🔒 Apply restrictions to Lovelace cards
MIT License
254 stars 22 forks source link

No state color with state_color: true set on card #60

Closed emufan closed 2 years ago

emufan commented 2 years ago

Checklist:

Description of problem:

If you use state_color: true an restrict an entity row, the state color is not shown anymore and always --paper-item-icon-color is set instead of --paper-item-active-icon-color if active and used without restriction.

type: entities
entities:
  - type: custom:restriction-card
    row: true
    card:
      entity: cover.rolladen_kinderzimmer
      name: Kinderzimmer
    restrictions:
      confirm:
        text: Schalter aktivieren?
    condition:
      entity: switch.shelly_hausturklingel_klingelstatus
      value: 'off'
state_color: true

With restriction card on row image

Without restriction card on row in same state image

type: entities
entities:
  - cover.rolladen_kinderzimmer
state_color: true
iantrich commented 2 years ago

I think you'll need to add it to the individual row's config under card

emufan commented 2 years ago

You are right. Tested. Working. Thought, that it is inherited as for the not restricted rows. But this way is fine as well.