ph1p / ikea-led-obegraensad

ESP32/Arduino hack for the ikea OBEGRÄNSAD led wall lamp
MIT License
610 stars 85 forks source link

fix: weather negative temps #76

Closed ahuber21 closed 11 months ago

ahuber21 commented 11 months ago

The weather plugin crashes on negative temperatures as it is forwarding negative temperature values to drawNumbers(), where we're accessing smallNumbers[numbers.at(i)]. With numbers.at(i) being negative, the resulting instruction (e.g. smallNumbers[-1]) will crash the device.

The actual fix is provided in 22314b2cef3e9e88240fde68d2a15ccaa03642f8, but I also changed the EOL from CRLF to LF, which is why the entire file was rewritten in bf71d1db226d9647777896144e58056a7ee7be1d. Feel free to cherry-pick.

ph1p commented 11 months ago

Thank you very much! :) Could you please check the formatting as everything in the file has changed. After that I will merge the fix

ahuber21 commented 11 months ago

I didn't change the formatting. Or do you see any problems? If you prefer I revert the line ending change.

ph1p commented 11 months ago

Hmm, really strange. The problem is that no one can see the changes you've made, because every single line has changed. Can you maybe force push it without your newline changes?

ahuber21 commented 11 months ago

That's why I added two separate commits. One with the code change, one with the line ending change. But now it's just the code change. Hope that helps :)

ph1p commented 11 months ago

Ah :) Thank you! Merged