iantrich / restriction-card

🔒 Apply restrictions to Lovelace cards
MIT License
270 stars 23 forks source link

Follow new "state-*-color" themes vars (HA 2022.12) #79

Closed chemelli74 closed 1 year ago

chemelli74 commented 1 year ago

Is your feature request related to a problem? Please describe. After 2022.12 there are new themes colors: "state-*-color". Card should be updated to reflect those.

Describe the solution you'd like Add the "state-*-color" as default colors.

Describe alternatives you've considered None found

Additional context Current behaviour:

image

ildar170975 commented 1 year ago

How the restriction-card is supposed to be updated for new state-*-color vars? These vars are currently used by Entities card, for instance, they have nothing with the restriction-card. Not to mention a fact that these theme vars are NOT officially supported by HA - i.e. "today these vars are present in HA, tomorrow not".

chemelli74 commented 1 year ago

Using the following code in autoentities:

    - entity_id: cover.tapparella_cucina
      state: open
      options:
        secondary_info: position
    - entity_id: cover.tapparella_cucina
      state: open
      options:
        type: custom:restriction-card
        restrictions:
          pin:
            code: 5686
        condition:
          entity: cover.tapparella_cucina
          value: open
        row: true
        card:
          entity: this.entity_id
          secondary_info: position

makes the icons color as shown above. So I would say that colors are not honored by this custom card. Or am I wrong ?

Simone

ildar170975 commented 1 year ago

Using the following code in autoentities:

Why testing this issue inside 3 layers of custom cards? Try with only one card - type: entity - with your cover entity.

chemelli74 commented 1 year ago

Fixed my code, was enough to add state_color to the nested card.

Simone