Closed yaks11 closed 1 month ago
That's... odd. That variable is always initiailized to None when there's no errors. If you're seeing that error, everyone should be.
Aha, this happens when the HMS printe error clears. This code was recently fixed for another error it had but the fixed code now fails a different way because it was never valid in the first place to try and use the error list when it's empty (None).
Fixed with #634
Describe the bug
I noticed that the following error will occur in Home Assistant log when I'm printing a 3D model.
2024-10-24 14:19:02.982 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback BambuDataUpdateCoordinator.event_handler_internal('event_print_error') (None) Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/config/custom_components/bambu_lab/coordinator.py", line 109, in event_handler_internal self._update_print_error() File "/config/custom_components/bambu_lab/coordinator.py", line 194, in _update_print_error if 'Code' in device.print_error.error: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable
To Reproduce
I installed this Bambu Labs addon in Home Assistant and started to notice this error happening in the log file.
Expected Behaviour
Is there a way for the addon to handle this error or is there some sort of configuration I need to setup?
What device are you using?
P1S
Diagnostic Output
Log Extracts
Other Information
No response