Fix rounding, clear alarm after sounding

This commit is contained in:
Phil Howard
2020-09-04 10:47:36 +01:00
parent 8c9a3d0be1
commit 3ccacba140

View File

@@ -473,6 +473,7 @@ class ChannelEditView(ChannelView, EditView):
"min": 0,
"max": 1.0,
"mode": "float",
"round": 2,
"format": lambda value: f"{value * 100:0.2f}%",
"help": "Saturation at which alarm is triggered",
},
@@ -490,6 +491,7 @@ class ChannelEditView(ChannelView, EditView):
"min": 1,
"max": 27,
"mode": "float",
"round": 2,
"format": lambda value: f"{value:0.2f}Hz",
"help": "Frequency for fully saturated soil",
},
@@ -500,6 +502,7 @@ class ChannelEditView(ChannelView, EditView):
"min": 1,
"max": 27,
"mode": "float",
"round": 2,
"format": lambda value: f"{value:0.2f}Hz",
"help": "Frequency for fully dried soil",
},
@@ -733,6 +736,8 @@ class Alarm(View):
).start()
self._time_last_beep = time.time()
self._triggered = False
def render(self, position=(0, 0)):
x, y = position
# Draw the snooze icon- will be pulsing red if the alarm state is True