From 7a978853a8d19e3d66f3ce6007e9f85d471f06a1 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 29 Nov 2023 00:36:25 +0300 Subject: [PATCH] get serial device from environment --- src/AirQualityMonitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AirQualityMonitor.py b/src/AirQualityMonitor.py index 73d0b21..21bf5ab 100644 --- a/src/AirQualityMonitor.py +++ b/src/AirQualityMonitor.py @@ -12,7 +12,7 @@ redis_client = redis.StrictRedis(host=os.environ.get('REDIS_HOST'), port=6379, d class AirQualityMonitor(): def __init__(self): - self.ser = serial.Serial('/dev/ttyUSB0') + self.ser = serial.Serial(os.environ.get('SERIAL_DEVICE','/dev/ttyUSB0')) def get_measurement(self): self.data = []