-
Notifications
You must be signed in to change notification settings - Fork 16
aoilfx.py throws errors repeatedly when used in Home Assistant #46
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
Comments
If it helps, this happens when a Beam or Z changes the number of zones it has from the amount it had at discovery. |
Yes, that helps. I guess it can happen if you plug/unplug a segment while the light is already connected? I can have a look at fixing this but it will be some days before I have the time. |
I do not have a device I could test with... Would a simple try/except work as a quick fix? |
I'm away for the weekend but I can test when I'm back home on Sunday evening. |
…be. NOT TESTED. Do not have compatible device to test.
re looking at it, I may need to fill the gap with something before append'ing |
…nd to index i. Fill interval with valid 8000 value, abeit probably incorrect. NOT TESTED. Do not have compatible device to test.
Someone please test.... Do change the number of zones dynamically to check how bad the fix is ;) |
BTW still need a way to shorten the color_zone list... not sure how that should be done. |
Looks like the try/except block should fix the immediate issue (and hopefully not uncover a larger issue). I'll try installing/testing over the weekend if I can figure out how. If there's a specific program or set of commands you'd like me to run to test, let me know, otherwise I'll try installing per the README and plug and unplug lights to see if I can break anything. |
To get the fixed version, you need to get this git repo and do from within. I did the minimum testing i.e. checking that my Lifx could be reached and controlled) |
Any feedback on this? |
I just pushed the fix to the embedded copy of aiolifx I ship with my modified LIFX integration at https://github.com/Djelibeybi/ha-lifx-beta/releases/tag/v2.3-alpha -- this will allow for additional feedback. |
Thanks Avi. I don't have a great way to reproduce the issue since I only see it through Home Assistant. Is there a way for me to try the beta version of the Lifx integration without blowing up my HA setup (I'm running a HassOS box on a Raspberry Pi 4)? |
Sure, just add the repo via HACS (if you're running it) or clone the repo somewhere and copy the |
Seems to have solved it for me. I've had two Beams drop segments since making the change but without the usual error log storm. |
@Djelibeybi Sounds good. Any issue? Are things working when you add back segments (if that is possible that is ;) Can you fully control the device after some segments were dropped? We shall wait a few day to get some feedback before I push this as a new release to PyPi. |
@frawau everything seems to work fine for me, but I agree we should wait a few more days. I tend not to control my multizone devices at the zone level, so I'm not sure if it's functional to that level. |
I haven't heard (or seen) any negative feedback for this change, so if you can push a new version to PyPi, I'm happy to submit the corresponding update to the LIFX integration for HA (unless someone else wants to do it). |
Pushed 0.7.1 to PyPi. |
Could you please tag 0.7.1 here on GitHub and update the changelog accordingly? The Home Assistant folks review that sort of thing for a pure dependency update. |
Just did. Can we close this issue now? |
Yep, this can be closed: home-assistant/core#67721 |
Hi -
I'm tracking down an issue in Home Assistant's Lifx integration (which uses aiolifx under the hood), and in some circumstances, the
resp_set_multizonemultizone
inaiolifx/aiolifx.py
is getting an index out of bounds error at line 1084: https://github.com/frawau/aiolifx/blob/7ba0a3775e273ac878f286e9685939f8fa19da70/aiolifx/aiolifx.py#L1084This, unfortunately, causes Home Assistant to fill the disk with error messages in the log file as fast as it can.
It seems that
resp_set_multizonemultizone
shouldn't be throwing an error - not sure if it needs to validate incoming data or if there's an off-by-one error or somesuch, and unfortunately my Python isn't strong enough to debug, so I'm creating this issue in the hopes that someone can add some more graceful error handling inresp_set_multizonemultizone
.Here's a stack trace from the call in Home Assistant (note the call to
resp_set_multizonemultizone
at the bottom.Thanks!
Grant
The text was updated successfully, but these errors were encountered: