iantrich / restriction-card

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

Duration parameter without effect #82

Closed iridium2001 closed 4 months ago

iridium2001 commented 1 year ago

Checklist:

Release with the issue: 1.2.7

Last working release (if known):

Browser and Operating System: Edge, Version 110.0.1587.50 (64-Bit) Home Assistant Core 2023.2.5

Description of problem:

Duration parameter does not have any effect. Does not cause an error, but seems to be always 5 seconds. Irrespective if set to e.g. 1 or 10 seconds.

type: custom:restriction-card card: show_name: true show_icon: true type: button tap_action: action: toggle entity: light.licht_eg restrictions: pin: code: 1234 duration: 2

Javascript errors shown in the web inspector (if applicable):

Additional information:

Fusseldieb commented 8 months ago

I just tried it, and it seems to work fine.

ildar170975 commented 7 months ago

@iridium2001 The code you posted is not properly formatted. Always place a code inside triple "`". Otherwise it is impossible to analyse (we can only guess where indents were placed). You should have checked YOURSELF after posting how the post is displayed.

Regarding the issue. Please test this code:

type: custom:restriction-card
action: hold
duration: 10
card:
  type: entities
  entities:
    - entity: input_boolean.test_boolean

It works as intended with a 10 seconds delay.

Or this example (close to yours) which also works OK:

type: custom:restriction-card
action: hold
duration: 2
card:
  show_name: true
  show_icon: true
  type: button
  tap_action:
    action: toggle
  entity: input_boolean.test_boolean
restrictions:
  pin:
    code: 1234

Please confirm if you still observe the bug, otherwise the issue will be closed.

ildar170975 commented 4 months ago

No feedback from OP for more than 2 months. Closing.