pimoroni / grow-python

Python libs for controlling the Grow HATs
MIT License
55 stars 44 forks source link

Beeping even when mute button pressed #13

Open tramcrazy opened 3 years ago

tramcrazy commented 3 years ago

When I press the mute button on the HAT to stop the beeping, it often starts beeping again a few seconds later. Sometimes, I have to press the mute button three times to make it stop beeping, and often it'll start again after an undetermined amount of time. Is this a 'feature' or a bug?

Gadgetoid commented 3 years ago

This is a feature, if the soil is dry enough that it gets to the alarm level then it'll incessantly beep until it's watered again.

Perhaps it should silence until the level crosses above the alarm level (plus some buffer) and drops back below again :thinking:

Right now the only condition for triggering the alarm is that the saturation has fallen below the warning level: https://github.com/pimoroni/grow-python/blob/bc5fec56c69fdef26f9f47660df3d892a377a04c/examples/monitor.py#L773

IIRC (it's been a while since I touched this code!) pressing the alarm button twice will silence the alarm outright.

tramcrazy commented 3 years ago

Yes, having it silence until it goes above the alarm level sounds like a good idea. Perhaps I'll leave this issue open for now (unless you want to close it) so that people know about this.

Gadgetoid commented 3 years ago

Sure leave it open, I've added to my TODO list.