python-wled
python-wled copied to clipboard
possible key error exception
While troubleshooting an issue, I've stumbled upon this erroneous check:
https://github.com/frenck/python-wled/blob/e427bd63eb960ab66d379fd070780ed476215d16/src/wled/models.py#L713C13-L713C50
If the key is not in the dict (k not in data), accessing that non-existent key (and data[k]) will throw an KeyError exception.
I assume it should be like
if any(
k not in data or data[k] is None
for k in ("effects", "palettes", "info", "state")
):
cheers!