iantrich / restriction-card

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

No longer working on Homeassistant 2023.7.3 on iOS #98

Closed dgrnbrg closed 11 months ago

dgrnbrg commented 11 months ago

Checklist:

Release with the issue: 2023.7.3

Last working release (if known): 2023.5.x

Browser and Operating System: home assistant iOS app

Description of problem:

The restrictions work fine in Safari and Chrome on my laptop, and the restrictions even work in safari on iOS. They only fail to work (the lock isn't shown & I can immediately click) in the home assistant app.

ildar170975 commented 11 months ago

No code = no issue. Post a minimal code which does not work & may be easily reproduced.

dgrnbrg commented 11 months ago

type: custom:mod-card
style: |
  restriction-card {
    --restriction-lock-icon-size: 18px;
    --restriction-lock-margin-left: 95%;
  }
card:
  type: custom:restriction-card
  action: tap
  unlocked_icon: mdi:lock-off-outline
  duration: 2
  card:
    type: custom:mushroom-cover-card
    entity: cover.garage_door
    show_buttons_control: false

Looks like

image

But it should have the restriction visible. On the safari browser, for instance, it looks like:

image

It's specifically in the home assistant app that the card doesn't seem to work.

ildar170975 commented 11 months ago
  1. Test with a STANDARD card first, not with a custom mushroom one, and w/o any other custom plugins like card-mod.
  2. This code works fine in iOS 15.x:
    type: custom:mod-card
    style: |
    restriction-card {
    --restriction-lock-icon-size: 12px;
    --restriction-lock-margin-left: 95%;
    }
    card:
    type: custom:restriction-card
    action: tap
    unlocked_icon: mdi:lock-off-outline
    duration: 2
    card:
    type: entities
    entities:
      - entity: switch.test_switch
dgrnbrg commented 11 months ago

I've tested with a STANDARD card.

This code does not work on the HomeAssistant app with HA 2023.7.3 and iOS 16.1.1:

type: custom:restriction-card
action: tap
unlocked_icon: mdi:lock-off-outline
duration: 2
card:
  type: entity
  entity: cover.garage_door
  show_buttons_control: false
ildar170975 commented 11 months ago
  1. (unrelated) The show_buttons_control option does not exist for entity card.
  2. Your code works in iOS 15.x (2023.8.0): image
    type: custom:restriction-card
    action: tap
    unlocked_icon: mdi:lock-off-outline
    duration: 2
    card:
    type: entity
    entity: cover.test_garage_door

    Check if your iOS device has a custom theme. Also, reset frontend cache.