From 7ba0833d1ff8346a694149648c4b1ceb19bef6f0 Mon Sep 17 00:00:00 2001 From: jerick Date: Mon, 28 Nov 2022 15:56:02 -0500 Subject: [PATCH] Pass sensor through run() --- mqtt/tempSensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mqtt/tempSensor.py b/mqtt/tempSensor.py index 188aa24..8a7036d 100644 --- a/mqtt/tempSensor.py +++ b/mqtt/tempSensor.py @@ -88,7 +88,7 @@ def publish(client, temp, humidity): time.sleep(5.0) -def run(): +def run(sensor): # We first check if a libgpiod process is running. If yes, we kill it! for proc in psutil.process_iter(): if proc.name() == 'libgpiod_pulsein' or proc.name() == 'libgpiod_pulsei': @@ -101,4 +101,4 @@ def run(): publish(client, temp, humidity) if __name__ == '__main__': - run() \ No newline at end of file + run(sensor) \ No newline at end of file