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

tap_action executed despite being in lock state #688

Closed
2 tasks done
arifroni opened this issue Apr 26, 2023 · 6 comments
Closed
2 tasks done

tap_action executed despite being in lock state #688

arifroni opened this issue Apr 26, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@arifroni
Copy link

arifroni commented Apr 26, 2023

Checklist

  • I updated the card to the latest version available
  • I cleared the cache of my browser

Describe the bug
When I press the button, whether it is locked or not locked, tap_action executes.

Version of the card
Version: 3.5

To Reproduce
This is the configuration I used:

- type: custom:button-card
  entity: sensor.deebot_kajer_beti_ronbot_queue
  icon: mdi:play-pause
  name: '[[[ if (entity.state === "") return "Select Rooms"; else return "Start Clean" ]]]'
  aspect_ratio: 2.6/1
  triggers_update: 
    - vacuum.kajer_beti_ronbot
  lock:
    enabled: |
      [[[ 
        return !entity.state || 
          entity.state.length === 0 ||
          states['vacuum.kajer_beti_ronbot'].state !== 'docked'
      ]]]
    exemptions: []
  tap_action:
    action: call-service
    # service: script.deebot_clean
    service: notify.persistent_notification
    service_data:
      message: msg
      title: title
  styles:
    icon:
      - width: 1.8em
    card:
      - color: var(--disabled-text-color)
    lock:
      - color: var(--primary-text-color)
      - width: 2em
  state:
    - operator: template
      value: |
        [[[ return states['vacuum.kajer_beti_ronbot'].state === 'returning' ]]]
      name: Returning...
      icon: mdi:toilet
      spin: true
    - operator: template
      value: |
        [[[ return states['vacuum.kajer_beti_ronbot'].state !== 'docked' ]]]
      name: Cleaning...
      icon: mdi:cog
      spin: true
    - operator: template
      value: |
        [[[ return (entity.state || entity.state.length > 0) ]]]
      styles:
        card:
          - color: var(--text-color)
        icon:
          - color: var(--text-color)

Screenshots
msedge_2023-04-26_15-33-48

Expected behavior
When the icon is locked, i expect nothing happens when i click the button

Desktop (please complete the following information):

  • Browser: Microsoft Edge
  • Version 112.0.1722.58

Home Assistant 2023.5.2
Supervisor 2023.04.1
Operating System 10.1
Frontend 20230503.3 - latest

@arifroni arifroni added the bug Something isn't working label Apr 26, 2023
@ASNNetworks
Copy link

Perhaps bug is associated because you also have

    exemptions: []

Allthough it's empty, perhaps that's what causes he bug to exempt everything? Try it with that part removed. I have latest button-card and never had this issue, have multiple locked buttons.

Also good to state the HA version you are using. Could also be a HA frontend change that breaks it.

@arifroni
Copy link
Author

Perhaps bug is associated because you also have

    exemptions: []

Allthough it's empty, perhaps that's what causes he bug to exempt everything? Try it with that part removed. I have latest button-card and never had this issue, have multiple locked buttons.

Also good to state the HA version you are using. Could also be a HA frontend change that breaks it.

Tried without the exemptions part, didn't work.
Added the HA version.

For me, it was also working fine. not sure when it got broken :(

@ASNNetworks
Copy link

ASNNetworks commented May 11, 2023

Perhaps bug is associated because you also have

    exemptions: []

Allthough it's empty, perhaps that's what causes he bug to exempt everything? Try it with that part removed. I have latest button-card and never had this issue, have multiple locked buttons.
Also good to state the HA version you are using. Could also be a HA frontend change that breaks it.

Tried without the exemptions part, didn't work. Added the HA version.

For me, it was also working fine. not sure when it got broken :(

Seeing as how you're running HA 2023.5.2, most likely that's where it got broken. Sadly the frontend update that came with 2023.5.x has broken multiple things, like z-index. Which causes the lock to show above popups and dialogs now as well. Chances are this also broke the way the lock functions, since the z-index has changed.

I updated to 2023.5.2 yesterday and after seeing the z-index issues with browser_mod and button-card I reverted to 2023.4.6 for the time being.

@ktownsend-personal
Copy link

ktownsend-personal commented May 19, 2023

Sadly the frontend update that came with 2023.5.x has broken multiple things, like z-index. Which causes the lock to show above popups and dialogs now as well. Chances are this also broke the way the lock functions, since the z-index has changed.

I did some digging with the browser debug window and determined that there was a crucial css variable missing in my theme to ensure a proper z-index of the dialog.

I added this to my theme:

      dialog-z-index: 100
      mdc-dialog-z-index: 100

The first one is what did it, but both were missing.

@RomRider
Copy link
Collaborator

Could you please try the latest beta?
I can't seem to reproduce with it.

@arifroni
Copy link
Author

I am with the latest version 3.5.0. I removed the lock icon style. and now it is working fine. I am unsure whether it relates to browser mod or some other modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants