pimoroni / fanshim-python

Python library for the Fan SHIM for Raspberry Pi
https://shop.pimoroni.com/products/fan-shim
MIT License
295 stars 85 forks source link

Switch 'bounce' or odd behaviour #79

Closed colindomoney closed 4 years ago

colindomoney commented 4 years ago

I've installed the latest version of fanshim-python and am using automatic.py. I see some unusual behaviour - if I set to manual mode and try and toggle I can turn the fan on and then it turns off straight away. It's almost like there's a switch bounce, like it gets two presses. I can put verbose mode on and see the 'enabled' value changes from False to True but then back to False. Also the toggle between manual and automatic is sometimes behaving in a random way - it switches then switches back. Every works fine if I used the manual commands to toggle the fan - it's something to do with the button handling in the code I think. About a year ago I installed this on a device and it all worked fine so I know I'm using it correctly.