pimoroni / enviro

MIT License
101 stars 79 forks source link

Remove repetition in storage of rain-trigger record #203

Open rtyley opened 9 months ago

rtyley commented 9 months ago

Both startup() and check_trigger() were using identical code to append a new entry to the rain.txt trigger log (introduced with https://github.com/pimoroni/enviro/pull/55) when a trigger pulse from the rain sensor is detected - this refactor introduces a new store_rain_trigger_record() method, meaning the code only needs to be in one place.