diff --git a/examples/README.md b/examples/README.md index 23f7b1e..88a6e3b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -37,6 +37,8 @@ channel1: warn_level: 0.2 pump_speed: 0.7 pump_time: 0.7 + wet_point: 0.7 + dry_point: 27.6 auto_water: False icon: icons/flat-4.png channel2: @@ -44,12 +46,16 @@ channel2: warn_level: 0.2 pump_speed: 0.7 pump_time: 0.7 + wet_point: 0.7 + dry_point: 27.6 auto_water: False channel3: water_level: 0.8 warn_level: 0.2 pump_speed: 0.7 pump_time: 0.7 + wet_point: 0.7 + dry_point: 27.6 auto_water: False general: alarm_enable: True @@ -65,6 +71,8 @@ Grow has three channels which are separated into the sections `channel1`, `chann * `pump_speed` - The speed at which the pump should be run (from 0.0 low speed to 1.0 full speed) * `pump_time` - The time that the pump should run for (in seconds) * `auto_water` - Whether to run the attached pump (True to auto-water, False for manual watering) +* `wet_point` - Value for the sensor in saturated soil (in Hz) +* `dry_point` - Value for the sensor in totally dry soil (in Hz) * `icon` - Optional icon image for the channel, see the icons directory for images. ## General Settings diff --git a/examples/advanced/moisture.py b/examples/advanced/moisture.py new file mode 100644 index 0000000..c377eb1 --- /dev/null +++ b/examples/advanced/moisture.py @@ -0,0 +1,23 @@ +import time + +from grow.moisture import Moisture + + +print("""moisture.py - Print out sensor reading in Hz + +Press Ctrl+C to exit! + +""") + + +m1 = Moisture(1) +m2 = Moisture(2) +m3 = Moisture(3) + +while True: + print(f"""1: {m1.moisture} +2: {m2.moisture} +3: {m3.moisture} +""") + time.sleep(1.0) + diff --git a/examples/grow-monitor-and-water.py b/examples/grow-monitor-and-water.py index 40abf6a..c50d095 100644 --- a/examples/grow-monitor-and-water.py +++ b/examples/grow-monitor-and-water.py @@ -40,6 +40,8 @@ class Channel: pump_speed=0.7, pump_time=0.7, watering_delay=30, + wet_point=0.7, + dry_point=26.7, icon=None, auto_water=False, ): @@ -52,10 +54,15 @@ class Channel: self.pump_speed = pump_speed self.pump_time = pump_time self.watering_delay = watering_delay + self.wet_point = wet_point + self.dry_point = dry_point self.last_dose = time.time() self.icon = icon self.alarm = False + self.sensor.set_wet_point(wet_point) + self.sensor.set_dry_point(dry_point) + def indicator_color(self, value, r=None): if r is None: r = self.bar_colours @@ -95,6 +102,8 @@ Water level: {water_level} Pump speed: {pump_speed} Pump time: {pump_time} Delay: {watering_delay} +Wet point: {wet_point} +Dry point: {dry_point} """.format( **self.__dict__ ) diff --git a/examples/settings.yml b/examples/settings.yml index a17f1d1..0df3b9e 100644 --- a/examples/settings.yml +++ b/examples/settings.yml @@ -1,10 +1,16 @@ channel1: warn_level: 0.2 icon: icons/flat-4.png + wet_point: 2.5 + dry_point: 27.6 channel2: warn_level: 0.2 + wet_point: 2.5 + dry_point: 27.6 channel3: warn_level: 0.2 + wet_point: 2.5 + dry_point: 27.6 general: alarm_enable: True alarm_interval: 1.0