mirror of
https://github.com/pimoroni/grow-python
synced 2025-10-25 15:19:23 +00:00
Add watering settings to UI
This commit is contained in:
@@ -528,6 +528,13 @@ class ChannelEditView(ChannelView, EditView):
|
||||
"format": lambda value: "Yes" if value else "No",
|
||||
"help": "Enable/disable this channel",
|
||||
},
|
||||
{
|
||||
"title": "Auto Water",
|
||||
"prop": "auto_water",
|
||||
"mode": "bool",
|
||||
"format": lambda value: "Yes" if value else "No",
|
||||
"help": "Enable/disable watering",
|
||||
},
|
||||
{
|
||||
"title": "Wet Point",
|
||||
"prop": "wet_point",
|
||||
@@ -552,6 +559,39 @@ class ChannelEditView(ChannelView, EditView):
|
||||
"help": "Frequency for fully dried soil",
|
||||
"context": "hz",
|
||||
},
|
||||
{
|
||||
"title": "Pump Time",
|
||||
"prop": "pump_time",
|
||||
"inc": 0.05,
|
||||
"min": 0.05,
|
||||
"max": 2.0,
|
||||
"mode": "float",
|
||||
"round": 2,
|
||||
"format": lambda value: f"{value:0.2f}sec",
|
||||
"help": "Time to run pump"
|
||||
},
|
||||
{
|
||||
"title": "Pump Speed",
|
||||
"prop": "pump_speed",
|
||||
"inc": 0.05,
|
||||
"min": 0.05,
|
||||
"max": 1.0,
|
||||
"mode": "float",
|
||||
"round": 2,
|
||||
"format": lambda value: f"{value*100:0.0f}%",
|
||||
"help": "Speed of pump"
|
||||
},
|
||||
{
|
||||
"title": "Watering Delay",
|
||||
"prop": "watering_delay",
|
||||
"inc": 10,
|
||||
"min": 30,
|
||||
"max": 500,
|
||||
"mode": "int",
|
||||
"format": lambda value: f"{value:0.0f}sec",
|
||||
"help": "Delay between waterings"
|
||||
},
|
||||
|
||||
]
|
||||
EditView.__init__(self, image, options)
|
||||
ChannelView.__init__(self, image, channel)
|
||||
@@ -582,9 +622,9 @@ class Channel:
|
||||
title=None,
|
||||
water_level=0.5,
|
||||
warn_level=0.5,
|
||||
pump_speed=0.7,
|
||||
pump_time=0.7,
|
||||
watering_delay=30,
|
||||
pump_speed=0.5,
|
||||
pump_time=0.2,
|
||||
watering_delay=60,
|
||||
wet_point=0.7,
|
||||
dry_point=26.7,
|
||||
icon=None,
|
||||
@@ -880,6 +920,10 @@ class Config:
|
||||
"warn_level",
|
||||
"wet_point",
|
||||
"dry_point",
|
||||
"watering_delay",
|
||||
"auto_water",
|
||||
"pump_time",
|
||||
"pump_speed"
|
||||
]
|
||||
|
||||
self.general_settings = [
|
||||
|
||||
Reference in New Issue
Block a user