From bebb3b5712492da4fb66b34409677eb9260e1ded Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Fri, 25 Nov 2022 15:13:48 +0000 Subject: [PATCH] Added more logging for grow --- enviro/boards/grow.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/enviro/boards/grow.py b/enviro/boards/grow.py index 1c5e564..48158cc 100644 --- a/enviro/boards/grow.py +++ b/enviro/boards/grow.py @@ -5,6 +5,8 @@ from enviro import i2c from phew import logging +CHANNEL_NAMES = ['A', 'B', 'C'] + bme280 = BreakoutBME280(i2c, 0x77) ltr559 = BreakoutLTR559(i2c) @@ -83,12 +85,15 @@ def water(moisture_levels): # determine a duration to run the pump for duration = round((targets[i] - moisture_levels[i]) / 25, 1) + logging.info(f"> sensor {CHANNEL_NAMES[i]} below moisture target {targets[i]} (currently at {int(moisture_levels[i])}).") + if config.auto_water: - logging.info(f"> running pump {i} for {duration} second (currently at {int(moisture_levels[i])}, target {targets[i]})") + logging.info(f" - running pump {CHANNEL_NAMES[i]} for {duration} second(s)") pump_pins[i].value(1) time.sleep(duration) pump_pins[i].value(0) else: + logging.info(f" - playing beep") for j in range(0, i + 1): drip_noise() time.sleep(0.5)