Rimco/OSPy

error in Weather-based Rain Delay + Weather-based Water Level?

Closed this issue · 6 comments

Hi,
I have a clone of OSPy https://github.com/Rimco/OSPy and I have a problem in modules Weather-based Rain Delay + Weather-based Water Level. Please do not know where is the mistake?
"internal server error"

Checking rain status...
Traceback (most recent call last):
File "/home/pi/OSPy/web/application.py", line 239, in process
return self.handle()
File "/home/pi/OSPy/web/application.py", line 230, in handle
return self._delegate(fn, self.fvars, args)
File "/home/pi/OSPy/web/application.py", line 420, in _delegate
return handle_class(cls)
File "/home/pi/OSPy/web/application.py", line 396, in handle_class
return tocall(*args)
File "/home/pi/OSPy/plugins/weather_adj.py", line 163, in GET
weather_to_delay()
File "/home/pi/OSPy/plugins/weather_adj.py", line 24, in weather_to_delay
weather = get_weather_data() if data['weather_provider'] == "yahoo" else get_wunderground_weather_data()
File "/home/pi/OSPy/plugins/weather_adj.py", line 91, in get_wunderground_weather_data
lid = get_wunderground_lid()
File "/home/pi/OSPy/plugins/weather_adj.py", line 60, in get_wunderground_lid
lid = "zmw:" + data['RESULTS'][0]['zmw']
IndexError: list index out of range

Thank you for your help Martin Pihrt

Looking at the error it seems that WUnderground didn't return a location ID.
Please check your options to verify your location. "City, County" should work.

I'll leave the issue open to improve the plugins such that they won't crash.

hi,
Thanks you for your help. yes I was wrong desired location.
PS: maybe treat bug in the plugin when it is entered wrong location (which prevent internal server error).

I've added more new plugins for your branch OSPy: https://github.com/martinpihrt/OSPy

Thank you Martin Pihrt

If your plugins are compatible with my master you might consider putting
them in a pull-request. Then I can integrate them easily. Eventually, my
OSPy version should contain all functionality such that it can replace the
original OSPi.

Regards,
Rimco

Plugins are ready, but do not know how to pull (do not know much github)
I did not spoil anything :-(

Martin

It seems you've managed to send a pull request, I'll have a look at it in a
moment:)

Thank you very much for composing in your code, make me watch new releases.
Thank you very much to all the project work.
Martin