Add wet/dry points to settings

This commit is contained in:
Phil Howard
2020-08-27 13:47:12 +01:00
parent 3123e27939
commit e0330aafe6
4 changed files with 46 additions and 0 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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__
)

View File

@@ -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