UedaTakeyuki / mh-z19

Read CO2 concentration from mh-z19 sensor on the Raspberry Pi & handle it. Detect Raspberry Pi model automatically and read the value from an appropriate serial device.
MIT License
185 stars 37 forks source link

Fix querying of pimodel #43

Closed jannismoeller closed 2 years ago

jannismoeller commented 2 years ago

Currently the conditions pimodel == "3 Model B" or pimodel == "4 Model B" never are true, as pimodel is assigned the reference to function getrpimodel.model instead of its return value. I guess it never was an issue, because '/dev/serial0' usually exists and takes precedence on these pi models (?) I only noticed the problem because I forgot to pass access to '/dev/serial0' to a docker container.

UedaTakeyuki commented 2 years ago

Hi jannismoeller,

Thank you for pointing out the long-time hidden issue I've overlooked. It's degraded about 2 years ago. I really appreciate your fix, Thank you!