pmsensor
Advanced tools
+2
-2
| Metadata-Version: 1.1 | ||
| Name: pmsensor | ||
| Version: 0.3 | ||
| Summary: Library to read data from environment ensors | ||
| Version: 0.4 | ||
| Summary: Library to read data from environment sensors | ||
| Home-page: https://github.com/open-homeautomation/pmsensor | ||
@@ -6,0 +6,0 @@ Author: Daniel Matuschek |
| Metadata-Version: 1.1 | ||
| Name: pmsensor | ||
| Version: 0.3 | ||
| Summary: Library to read data from environment ensors | ||
| Version: 0.4 | ||
| Summary: Library to read data from environment sensors | ||
| Home-page: https://github.com/open-homeautomation/pmsensor | ||
@@ -6,0 +6,0 @@ Author: Daniel Matuschek |
@@ -16,2 +16,12 @@ """" | ||
| result = read_mh_z19_with_temperature(serial_device) | ||
| if result is None: | ||
| return None | ||
| ppm, temp = result | ||
| return ppm | ||
| def read_mh_z19_with_temperature(serial_device): | ||
| """ Read the CO2 PPM concenration and temperature from a MH-Z19 sensor""" | ||
| logger = logging.getLogger(__name__) | ||
@@ -29,3 +39,3 @@ | ||
| timeout = 2 | ||
| res = -1 | ||
| res = None | ||
| ser.write(MZH19_READ) | ||
@@ -37,3 +47,3 @@ while not finished: | ||
| timeout, len(sbuf)) | ||
| return {} | ||
| return None | ||
@@ -46,3 +56,3 @@ if ser.inWaiting() > 0: | ||
| res = sbuf[2]*256 + sbuf[3] | ||
| res = (sbuf[2]*256 + sbuf[3], sbuf[4] - 40) | ||
| logger.debug("Finished reading data %s", sbuf) | ||
@@ -49,0 +59,0 @@ finished = True |
+2
-2
| from setuptools import setup, find_packages | ||
| setup(name='pmsensor', | ||
| version='0.3', | ||
| description='Library to read data from environment ensors', | ||
| version='0.4', | ||
| description='Library to read data from environment sensors', | ||
| url='https://github.com/open-homeautomation/pmsensor', | ||
@@ -7,0 +7,0 @@ author='Daniel Matuschek', |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
10738
2.79%259
2.78%