hamsclientfork 0.2.9__tar.gz → 0.2.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hamsclientfork
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: Library to get data from meteo swiss
5
5
  Home-page: https://github.com/Rudd-O/hamsclientfork
6
6
  Author: websylv
@@ -325,9 +325,11 @@ class meteoSwissClient:
325
325
  _LOGGER.warning("Unable to find station name for : %s" % (stationId))
326
326
  return None
327
327
 
328
- def getGeoData(self, lat, lon):
328
+ def getGeoData(self, lat, lon, user_agent=None):
329
329
  s = requests.Session()
330
330
  s.headers.update(_HEADERS)
331
+ if user_agent:
332
+ s.headers.update({"User-Agent": user_agent})
331
333
 
332
334
  uri = (
333
335
  "https://nominatim.openstreetmap.org/reverse"
@@ -337,7 +339,7 @@ class meteoSwissClient:
337
339
  geoData_req = s.get(uri)
338
340
  try:
339
341
  geoData_req.raise_for_status()
340
- geoData = geoData_req.json
342
+ geoData = geoData_req.json()
341
343
  _LOGGER.debug("Got data from OpenStreetMap: %s" % (geoData))
342
344
  return geoData
343
345
  except Exception:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hamsclientfork
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: Library to get data from meteo swiss
5
5
  Home-page: https://github.com/Rudd-O/hamsclientfork
6
6
  Author: websylv
@@ -15,7 +15,7 @@ def read(filename):
15
15
 
16
16
  setup(
17
17
  name="hamsclientfork",
18
- version="0.2.9",
18
+ version="0.2.10",
19
19
  url="https://github.com/Rudd-O/hamsclientfork",
20
20
  license="MIT",
21
21
  author="websylv",
File without changes
File without changes