Last active
August 22, 2021 10:08
-
-
Save tanatana/660367d8f308d487d3f6eae6b3b173b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import time | |
from CO2Meter import * | |
parser = argparse.ArgumentParser() | |
parser.add_argument("--local", default="___") | |
parser.add_argument("--path") | |
args = parser.parse_args() | |
sensor = CO2Meter("/dev/hidraw0") | |
time.sleep(5) | |
data = {} | |
data = sensor.get_data() | |
now = int(time.time()) | |
print("CO2Mini.co2ppm.{}\t{:.2f}\t{}".format(args.local, data.get("co2", 0), now)) | |
print("CO2Mini.temperature.{}\t{:.2f}\t{}".format(args.local, data.get("temperature", 0), now)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment