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

palettes:null = complete failure to initialize #123506

Closed
igorsantos07 opened this issue Aug 10, 2024 · 3 comments · Fixed by #123746
Closed

palettes:null = complete failure to initialize #123506

igorsantos07 opened this issue Aug 10, 2024 · 3 comments · Fixed by #123746
Assignees

Comments

@igorsantos07
Copy link
Contributor

The problem

This is the same as #96456 and #88429, which has been closed for staleness - what doesn't mean the issue is not relevant.

When WLED can't report palettes because it's running on a simpler device (Aircoookie/WLED#1974), the integration will completely fail to initialize, and keep trying every minute or so.
It should gracefully "downgrade" to an empty palette list and throw a log warning, given the WLED instance is completely usable otherwise. This suggestion was already made on the previous issue, which had great research by @sowbug (tagging him in case he still wants to follow up).

What version of Home Assistant Core has the issue?

core-2024.8.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

WLED

Link to integration documentation on our website

https://www.home-assistant.io/integrations/wled/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Traceback (most recent call last):
  File "<string>", line 29, in __mashumaro_from_dict__
AttributeError: 'NoneType' object has no attribute 'items'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/wled/coordinator.py", line 112, in _async_update_data
    device = await self.wled.update()
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/wled/wled.py", line 268, in update
    self._device = Device.from_dict(data)
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 31, in __mashumaro_from_dict__
mashumaro.exceptions.InvalidFieldValue: Field "palettes" of type dict[int, Palette] in Device has invalid value None

Additional information

Going to http://my-wled-instance/json shows the following:

{"state":{"on":true,"bri":128,"transition":7,"ps":-1,"pl":-1,"nl":{"on":false,"dur":60,"mode":1,"tbri":0,"rem":4294967295},"udpn":{"send":false,"recv":true,"sgrp":1,"rgrp":1},"lor":0,"mainseg":0,"seg":[{"id":0,"start":0,"stop":4,"len":4,"grp":1,"spc":0,"of":0,"on":false,"frz":false,"bri":255,"cct":127,"set":0,"n":"Esquerda","col":[[255,224,160],[184,255,168],[0,8,255]],"fx":27,"sx":128,"ix":128,"pal":2,"c1":128,"c2":128,"c3":16,"sel":true,"rev":false,"mi":false,"o1":false,"o2":false,"o3":false,"si":0,"m12":1},{"id":1,"start":4,"stop":7,"len":3,"grp":1,"spc":0,"of":0,"on":false,"frz":false,"bri":255,"cct":127,"set":0,"n":"Porta-lápis","col":[[255,224,160],[184,255,168],[0,8,255]],"fx":27,"sx":128,"ix":128,"pal":2,"c1":128,"c2":128,"c3":16,"sel":true,"rev":false,"mi":false,"o1":false,"o2":false,"o3":false,"si":0,"m12":1},{"id":2,"start":7,"stop":10,"len":3,"grp":1,"spc":0,"of":0,"on":false,"frz":false,"bri":255,"cct":127,"set":0,"n":"Relógio","col":[[255,224,160],[184,255,168],[0,8,255]],"fx":27,"sx":128,"ix":128,"pal":2,"c1":128,"c2":128,"c3":16,"sel":true,"rev":false,"mi":false,"o1":false,"o2":false,"o3":false,"si":0,"m12":1},{"id":3,"start":10,"stop":14,"len":4,"grp":1,"spc":0,"of":0,"on":false,"frz":false,"bri":255,"cct":127,"set":0,"n":"Gaveteiro","col":[[255,224,160],[184,255,168],[0,8,255]],"fx":27,"sx":128,"ix":128,"pal":2,"c1":128,"c2":128,"c3":16,"sel":true,"rev":false,"mi":false,"o1":false,"o2":false,"o3":false,"si":0,"m12":1},{"id":4,"start":14,"stop":16,"len":2,"grp":1,"spc":0,"of":0,"on":false,"frz":false,"bri":255,"cct":127,"set":0,"n":"Saleiro","col":[[255,224,160],[184,255,168],[0,8,255]],"fx":27,"sx":128,"ix":128,"pal":2,"c1":128,"c2":128,"c3":16,"sel":true,"rev":false,"mi":false,"o1":false,"o2":false,"o3":false,"si":0,"m12":1},{"id":5,"start":16,"stop":20,"len":4,"grp":1,"spc":0,"of":0,"on":false,"frz":false,"bri":255,"cct":127,"set":0,"n":"Direita","col":[[255,224,160],[0,0,0],[0,0,0]],"fx":27,"sx":128,"ix":128,"pal":0,"c1":128,"c2":128,"c3":16,"sel":true,"rev":false,"mi":false,"o1":false,"o2":false,"o3":false,"si":0,"m12":1}]},"info":{"ver":"0.15.0-b2","vid":2404100,"cn":"Kōsen","leds":{"count":20,"pwr":0,"fps":24,"maxpwr":0,"maxseg":16,"bootps":16,"seglc":[1,1,1,1,1,1],"lc":1,"rgbw":false,"wv":0,"cct":0},"str":false,"name":"WLED Escritório","udpport":21324,"simplifiedui":false,"live":false,"liveseg":-1,"lm":"","lip":"","ws":1,"fxcount":187,"palcount":71,"cpalcount":0,"maps":[{"id":0}],"wifi":{"bssid":"3C:84:6A:F9:9F:0A","rssi":-71,"signal":58,"channel":9},"fs":{"u":40,"t":1024,"pmt":1723253501},"ndc":1,"arch":"esp8266","core":"3.1.2","clock":80,"flash":4,"lwip":2,"freeheap":18056,"uptime":909,"time":"2024-8-9, 22:43:58","opt":79,"brand":"WLED","product":"FOSS","mac":"4cebd6d9dd2c","ip":"192.168.24.147"},"effects":["Solid","Blink","Breathe","Wipe","Wipe Random","Random Colors","Sweep","Dynamic","Colorloop","Rainbow","Scan","Scan Dual","Fade","Theater","Theater Rainbow","Running","Saw","Twinkle","Dissolve","Dissolve Rnd","Sparkle","Sparkle Dark","Sparkle+","Strobe","Strobe Rainbow","Strobe Mega","Blink Rainbow","Android","Chase","Chase Random","Chase Rainbow","Chase Flash","Chase Flash Rnd","Rainbow Runner","Colorful","Traffic Light","Sweep Random","Chase 2","Aurora","Stream","Scanner","Lighthouse","Fireworks","Rain","Tetrix","Fire Flicker","Gradient","Loading","Rolling Balls","Fairy","Two Dots","Fairytwinkle","Running Dual","RSVD","Chase 3","Tri Wipe","Tri Fade","Lightning","ICU","Multi Comet","Scanner Dual","Stream 2","Oscillate","Pride 2015","Juggle","Palette","Fire 2012","Colorwaves","Bpm","Fill Noise","Noise 1","Noise 2","Noise 3","Noise 4","Colortwinkles","Lake","Meteor","Meteor Smooth","Railway","Ripple","Twinklefox","Twinklecat","Halloween Eyes","Solid Pattern","Solid Pattern Tri","Spots","Spots Fade","Glitter","Candle","Fireworks Starburst","Fireworks 1D","Bouncing Balls","Sinelon","Sinelon Dual","Sinelon Rainbow","Popcorn","Drip","Plasma","Percent","Ripple Rainbow","Heartbeat","Pacifica","Candle Multi","Solid Glitter","Sunrise","Phased","Twinkleup","Noise Pal","Sine","Phased Noise","Flow","Chunchun","Dancing Shadows","Washing Machine","Rotozoomer","Blends","TV Simulator","Dynamic Smooth","Spaceships","Crazy Bees","Ghost Rider","Blobs","Scrolling Text","Drift Rose","Distortion Waves","Soap","Octopus","Waving Cell","Pixels","Pixelwave","Juggles","Matripix","Gravimeter","Plasmoid","Puddles","Midnoise","Noisemeter","Freqwave","Freqmatrix","GEQ","Waterfall","Freqpixels","RSVD","Noisefire","Puddlepeak","Noisemove","Noise2D","Perlin Move","Ripple Peak","Firenoise","Squared Swirl","RSVD","DNA","Matrix","Metaballs","Freqmap","Gravcenter","Gravcentric","Gravfreq","DJ Light","Funky Plank","RSVD","Pulser","Blurz","Drift","Waverly","Sun Radiation","Colored Bursts","Julia","RSVD","RSVD","RSVD","Game Of Life","Tartan","Polar Lights","Swirl","Lissajous","Frizzles","Plasma Ball","Flow Stripe","Hiphotic","Sindots","DNA Spiral","Black Hole","Wavesins","Rocktaves","Akemi"],"palettes":null}
@home-assistant
Copy link

Hey there @frenck, mind taking a look at this issue as it has been labeled with an integration (wled) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of wled can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign wled Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


wled documentation
wled source
(message by IssueLinks)

@frenck
Copy link
Member

frenck commented Aug 12, 2024

palettes":null

That is an odd value to have, but... thanks for reporting! Will take a look

@frenck frenck changed the title palettes:null = complete failure to initialize (third try) palettes:null = complete failure to initialize Aug 12, 2024
@frenck frenck mentioned this issue Aug 12, 2024
19 tasks
@igorsantos07
Copy link
Contributor Author

Yep! It seems mostly a bug in WLED, but that otherwise doesn't completely block usage.
Thanks! Anxious to test it out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants