adpeace / thermostat

Control for Danfoss TP7000 and similar thermostats/RX receiver
https://andyhacks.com
MIT License
14 stars 5 forks source link

Don't skip padding bit if it isn't present #2

Closed mhp closed 2 years ago

mhp commented 2 years ago

I tried your code on my Danfoss system, and found that the extra padding bit you discovered isn't present. By removing the extra shifting before consistency checking, I was able to receive the messages from my thermostat without problems. Maybe I've got a slightly different thermostat, or the firmware has been fixed in this version.

This PR makes the extra shifting optional. If the second half of the message looks plausible without shifting, then don't shift. I believe this approach is compatible with both packet formats.

Thanks for writing this code, and the accompanying blog posts!

adpeace commented 2 years ago

Looks good to me, thank you for the PR!