Skip to content

Commit

Permalink
Make openweathermap service less fussy about response
Browse files Browse the repository at this point in the history
Also updated the documentation, mentioning that user names should not
contain spaces.

Signed-off-by: Jim Easterbrook <jim@jim-easterbrook.me.uk>
  • Loading branch information
jim-easterbrook committed Nov 19, 2015
1 parent 9c065ac commit f461de0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/doc/guides/integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,21 @@ Open Weather Map
lat = 51.501
long = -0.142
alt = 10
user = Elizabeth Windsor
user = ElizabethWindsor
password = corgi
id = Buck House
template = default

[logged]
services = ['openweathermap', 'underground']

When choosing a user name you should avoid spaces (and probably non-ascii characters as well).
Having a space in your user name causes strange "internal server error" responses from the server.

The default behaviour is to use your user name to identify the weather station.
However, it's possible for a user to have more than one weather station, so there is an optional ``name`` parameter in the API that can be used to identify the station.
This appears as ``id`` in ``weather.ini``.
Make sure you don't choose a name that is already in use.
Make sure you choose a name that is not already in use.

PWS Weather
^^^^^^^^^^^
Expand Down
6 changes: 3 additions & 3 deletions src/pywws/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '15.11.0.dev1336'
_release = '1336'
_commit = 'e6e28b9'
__version__ = '15.11.1.dev1337'
_release = '1337'
_commit = '9c065ac'
2 changes: 1 addition & 1 deletion src/pywws/services/openweathermap.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
url = http://openweathermap.org/data/post
catchup = 7
interval = 0
result = ['{"message":"","cod":"200","id":"\d{5}"}$']
result = ['.*"cod":"200".*$']
use get = False
auth_type = basic

Expand Down

0 comments on commit f461de0

Please sign in to comment.