Villhellm / lovelace-animated-background

Animated backgrounds for lovelace
195 stars 61 forks source link

Per user filter stopped working #20

Closed SeLLeRoNe closed 4 years ago

SeLLeRoNe commented 4 years ago

Your Animated Background configuration

animated_background:
  default_url: /local/animated_backgrounds/sunny.html
  included_users:
    - Andrea Iannucci
  included_devices:
    - windows
  entity: "weather.dark_sky"
  state_url:
    'sunny': /local/animated_backgrounds/sunny.html
    'partlycloudy': /local/animated_backgrounds/cloudy.html
    'cloudy': /local/animated_backgrounds/cloudy.html
    'mostlycloudy': /local/animated_backgrounds/mostlycloudy.html
    'clear-night': /local/animated_backgrounds/night.html
    'fog': /local/animated_backgrounds/fog.html

Version of Home Assistant : 0.109.3 "Latest" is not a version number. Please provide the actual version number.

Describe the bug A clear and concise description of what the bug is. The "inlcude_user" filter I believe stopped working from last release

Browser console log Post anything related to animated-background.js

animated-background.js:193 Uncaught TypeError: Cannot read property 'user' of null
    at enabled (animated-background.js:193)
    at animated-background.js:244
enabled @ animated-background.js:193
(anonymous) @ animated-background.js:244

To Reproduce Steps to reproduce the behavior:

  1. Filter Animated Background to be used by a specific user only (haven't tried the exclude part)
  2. Open Lovelace

Expected behavior A clear and concise description of what you expected to happen. The specified user should be the only able to see the animate background

Desktop (please complete the following information):

Smartphone (please complete the following information):

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Villhellm commented 4 years ago

Thanks for being my unintended beta tester for these features. I'm still working on getting a complete test environment setup, so you've been very helpful in catching these.

Newest release should fix it

SeLLeRoNe commented 4 years ago

No worries at all :)

Testing now, I'll get back to you asap.

SeLLeRoNe commented 4 years ago

Ok, now I see the background but my log file is flooded with: hacsfiles/lovelace-animated-background/animated-background.js:193:93 Uncaught TypeError: Cannot read property 'user' of null

SeLLeRoNe commented 4 years ago

One more note, I tried to open HA directly on a dashboard that doesn't have the animated_background config, I got the same error in the logs, as if it was trying to load it anyway

Villhellm commented 4 years ago

Hmm, are you sure you cleared your browser cache? It shouldn't get that far if the object is null

SeLLeRoNe commented 4 years ago

Sorry, I had other instances of the page open and those were causing the issue! Closed everything and re-opened HA and now errors are gone ;)

Thanks

Villhellm commented 4 years ago

No worries, it actually made me notice some redundancies that could be removed.