get serial device from environment

This commit is contained in:
raf 2023-11-29 00:36:25 +03:00
parent bc09a7f43f
commit 7a978853a8
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29

View file

@ -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 = []