Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upstream variable name change breaks input: SCD30 CircuitPython (fix also enclosed here) #963

Closed
AKAMEDIASYSTEM opened this issue Mar 26, 2021 · 1 comment

Comments

@AKAMEDIASYSTEM
Copy link
Sponsor

Please DO NOT OPEN AN ISSUE:

  • If your Mycodo version is not the latest release version, please update your device before submitting your issue (unless your issue is related to not being able to upgrade). Your problem might already be solved.
  • If your issue has been addressed before (i.e., duplicated issue), please ask in the original issue.

Please complete as many of the sections below, if applicable, to provide the most information that may help with investigating your issue. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help those providing assistance by reducing the time required to help you.

Describe the problem/bug

The CircuitPython SCD30 sensor input currently errors at every reading, saying there is no parameter called "eCO2". This is because Adafruit updated their library a few months ago, changing that variable name.

Versions:

  • Mycodo Version: current version, 8.9.2
  • Raspberry Pi Version: 3B+
  • Raspbian OS Version: Buster

Reproducibility

Please list specific setup details that are involved and the steps to reproduce the behavior:

  1. Connect SCD30 i2c sensor
  2. Install CircuitPython Dependency for SCD30
  3. Add sensor and activate input
  4. Check Daemon logs and see error:
    2021-03-26 10:24:15,292 - ERROR - mycodo.inputs.scd30_circuitpython_d830dda1 - InputModule raised an exception when taking a reading: 'SCD30' object has no attribute 'eCO2' Traceback (most recent call last): File "/var/mycodo-root/mycodo/inputs/base_input.py", line 128, in read self._measurements = self.get_measurement() File "/home/pi/Mycodo/mycodo/inputs/scd30_circuitpython.py", line 95, in get_measurement co2 = self.scd.eCO2 AttributeError: 'SCD30' object has no attribute 'eCO2'

Expected behavior

Sensor takes readings per normal

Additional context

I fixed this myself by editing one line of code, replacing "eCO2" with "CO2"
Here's the line:
https://github.com/kizniche/Mycodo/blob/master/mycodo/inputs/scd30_circuitpython.py#L95

Thanks for making Mycodo, it's awesome!

AKA

@kizniche
Copy link
Owner

Thanks, Adafruit! I love it when developers make breaking changes for no good reason.

Thanks for the bug report. I'll include the change in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants