Skip to content

fix Celsius spelling #36

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

Merged
merged 1 commit into from
Jun 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions adafruit_sgp30.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,16 @@ def set_iaq_humidity(self, gramsPM3): # pylint: disable=invalid-name
buffer += arr
self._run_profile(["iaq_set_humidity", [0x20, 0x61] + buffer, 0, 0.01])

def set_iaq_relative_humidity(self, celcius, relative_humidity):
def set_iaq_relative_humidity(self, celsius, relative_humidity):
"""
Set the humidity in g/m3 for eCo2 and TVOC compensation algorithm.
The absolute humidity is calculated from the temperature and relative
humidity (as a percentage).
The absolute humidity is calculated from the temperature (Celsius)
and relative humidity (as a percentage).
"""
numerator = ((relative_humidity / 100) * 6.112) * exp(
(17.62 * celcius) / (243.12 + celcius)
(17.62 * celsius) / (243.12 + celsius)
)
denominator = 273.15 + celcius
denominator = 273.15 + celsius

humidity_grams_pm3 = 216.7 * (numerator / denominator)
self.set_iaq_humidity(humidity_grams_pm3)
Expand Down