iantrich / restriction-card

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

Change "condition" to "conditions" allowing multiple conditions #22

Closed SeLLeRoNe closed 4 years ago

SeLLeRoNe commented 4 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] I would like to block the washing machine plug if the washing machine is in one of the active states, such as Washing, Drying, Warming Up and the ability to define the restriction type based on that. (ex. fully restricted if the condition are met, half restricted (double click) if they are not.

Describe the solution you'd like A clear and concise description of what you want to happen. Having the ability to select multiple condition would allow more control and flexibility:

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Using input_boolean with automations to define if the washing machine is "working" or not.

Additional context Add any other context or screenshots about the feature request here.

Code sample:

          - type: entities
            show_header_toggle: false
            entities:
              - type: "custom:restriction-card"
                restrictions:
                  block: true
                conditions:
                  - entity: input_select.washing_machine_status
                    value: "Warming Up"
                  - entity: input_select.washing_machine_status
                    value: "Washing"
                  - entity: input_select.washing_machine_status
                    value: "Drying"
                row: true
                card:
                  name: Washing Machine
                  entity: switch.washing_machine
                  state_color: true
                  tap_action:
                    action: none

Hope this is clear enough, thanks :)

iantrich commented 4 years ago

A template sensor is better suited for this, I do not want to put the onerous on the frontend for that.

SeLLeRoNe commented 4 years ago

I see, okay :)