OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Bug in weather_level_adj.py plugin Reply To: Bug in weather_level_adj.py plugin

#34776

Ian
Participant

Shawn

To clarify. The plugin normally retrieves Wunderground data as part of a main loop which executes on an hourly basis.  The main loop however is in a Try: Except: structure and it is in the Except: condition that the self_sleep(60) statement occurs. Perhaps the author assumed that any error would be in the call to retrieve the data, and that retrying every 60 seconds would soon fix the problem? However the Except: catches all errors, and this particular one (the float problem) would not resolve itself until it rained next!

It would be possible to improve the error checking, but I doubt there is a lot of point. Changing this particular self_sleep(60) to self_sleep(1800) ensures that you don’t exceed your Wunderground limits for retrievals in the event of as yet unanticipated errors. Your safe_float suggestion fixes the problem I encountered in an elegant manner.

Regards

Ian