DBuit / light-popup-card

Lovelace card to use as custom pop-up for light in homekit style
168 stars 38 forks source link

Non Admin users can no longer activate scenes without adding the new action code. #64

Open MrKuenning opened 3 years ago

MrKuenning commented 3 years ago

First of all thank for you a fantastic Home Assistant addon.

After updating to 0.5 all users in my house that are not Home Assistant admins can no longer activate any of the buttons below the slider.

Logs show this error. hacsfiles/light-popup-card/light-popup-card.js:4002:31 Uncaught TypeError: Cannot add property action, object is not extensible

The change log says that exsisting services dont need to be changed to work, but that seems to only be for admin users. Because once I added the action call service line it now works for all users.

That brings me to the second thing I wanted to point out. The example code says to use action:call-service with no spaces.

Here is the section from the readme.

actions:
  - action:call-service
    service: scene.turn_on
    service_data:
      entity_id: scene.energie
    color: "#8BCBDD"
    name: energie
  - action:call-service
    service: homeassistant.toggle
    service_data:
      entity_id: light.voordeurlicht
    name: voordeur
    icon: mdi:lightbulb
  - action: fire-dom-event
    name: test
    browser_mod:
      command: popup
      title: 'My Title'
      card:
        type: 'custom:mini-graph-card'
        entities:
          - weather.weersverwachting

However my config errors out when I don't insert a space between action: and call-service.

After modifying all of my slider configs with action: call-service all of my home users can use the lights normally again.

TL:DR - Configs need to be changed to allow non-admin users to still use lighting presets and documentation for the scene seems to be incorrect.

windos2k commented 3 years ago

Great find, your solution solved my problems.