pyastroweatherio 0.43.1.dev4__tar.gz → 0.43.1.dev6__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.
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/PKG-INFO +1 -1
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio/client.py +21 -15
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio/const.py +1 -1
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio.egg-info/PKG-INFO +1 -1
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/setup.py +1 -1
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/LICENSE +0 -0
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/README.md +0 -0
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio/__init__.py +0 -0
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio/dataclasses.py +0 -0
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio/errors.py +0 -0
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio/helper_functions.py +0 -0
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio.egg-info/SOURCES.txt +0 -0
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio.egg-info/dependency_links.txt +0 -0
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio.egg-info/requires.txt +0 -0
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio.egg-info/top_level.txt +0 -0
- {pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/setup.cfg +0 -0
|
@@ -287,7 +287,7 @@ class AstroWeather:
|
|
|
287
287
|
|
|
288
288
|
utc_to_local_diff = self._astro_routines.utc_to_local_diff()
|
|
289
289
|
_LOGGER.debug("UTC to local diff: %s", str(utc_to_local_diff))
|
|
290
|
-
_LOGGER.debug("Forecast length: %s", str(len(self._weather_data_seventimer)))
|
|
290
|
+
_LOGGER.debug("Forecast length 7timer: %s", str(len(self._weather_data_seventimer)))
|
|
291
291
|
|
|
292
292
|
# Met.no
|
|
293
293
|
metno_index = -1
|
|
@@ -429,6 +429,7 @@ class AstroWeather:
|
|
|
429
429
|
|
|
430
430
|
start_indexes = []
|
|
431
431
|
# Find start index for two nights and store the indexes
|
|
432
|
+
_LOGGER.debug("Forecast data length: %s", str(len(self._forecast_data)))
|
|
432
433
|
for idx, row in enumerate(self._forecast_data):
|
|
433
434
|
if row.forecast_time.hour % 24 == sun_next_rising.hour and len(start_indexes) == 0:
|
|
434
435
|
start_indexes.append(0)
|
|
@@ -543,16 +544,7 @@ class AstroWeather:
|
|
|
543
544
|
- self._calm_weight
|
|
544
545
|
)
|
|
545
546
|
)
|
|
546
|
-
|
|
547
|
-
# "Calc condition cloudcover: %d(%d), seeing %d(%d), transparency: %d(%d), condition %d",
|
|
548
|
-
# cloudcover,
|
|
549
|
-
# self._cloudcover_weight,
|
|
550
|
-
# seeing,
|
|
551
|
-
# self._seeing_weight,
|
|
552
|
-
# transparency,
|
|
553
|
-
# self._transparency_weight,
|
|
554
|
-
# condition,
|
|
555
|
-
# )
|
|
547
|
+
|
|
556
548
|
return condition
|
|
557
549
|
|
|
558
550
|
async def calc_dewpoint2m(self, rh2m, temp2m):
|
|
@@ -624,8 +616,18 @@ class AstroWeather:
|
|
|
624
616
|
json_data_astro = await self.async_request_seventimer("astro", "get")
|
|
625
617
|
astro_dataseries = json_data_astro.get("dataseries", {})
|
|
626
618
|
|
|
627
|
-
|
|
628
|
-
|
|
619
|
+
if astro_dataseries != {}:
|
|
620
|
+
self._weather_data_seventimer = astro_dataseries
|
|
621
|
+
self._weather_data_seventimer_init = json_data_astro.get("init")
|
|
622
|
+
else:
|
|
623
|
+
# Fake 7timer weather data if service is broken
|
|
624
|
+
# This eliminates consideration of seeing, transparency, and lifted_index
|
|
625
|
+
self._seeing_weight = 0
|
|
626
|
+
self._transparency_weight = 0
|
|
627
|
+
self._weather_data_seventimer = []
|
|
628
|
+
for index in range(0, 20):
|
|
629
|
+
self._weather_data_seventimer.append({"timepoint": index * 3, "seeing": 0, "transparency": 0, "lifted_index": 0})
|
|
630
|
+
self._weather_data_seventimer_init = datetime.now().strftime("%Y%m%d%H")
|
|
629
631
|
else:
|
|
630
632
|
_LOGGER.debug("Using cached data for 7Timer")
|
|
631
633
|
|
|
@@ -668,9 +670,13 @@ class AstroWeather:
|
|
|
668
670
|
|
|
669
671
|
return data
|
|
670
672
|
except asyncio.TimeoutError as tex:
|
|
671
|
-
|
|
673
|
+
_LOGGER.error(f"Request to endpoint timed out: {tex}")
|
|
674
|
+
return {}
|
|
675
|
+
# raise RequestError(f"Request to endpoint timed out: {tex}") from None
|
|
672
676
|
except ClientError as err:
|
|
673
|
-
|
|
677
|
+
_LOGGER.error(f"Error requesting data: {err}")
|
|
678
|
+
return {}
|
|
679
|
+
# raise RequestError(f"Error requesting data: {err}") from None
|
|
674
680
|
|
|
675
681
|
finally:
|
|
676
682
|
if not use_running_session:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Constant Definitions for AstroWeather."""
|
|
2
2
|
|
|
3
|
-
BASE_URL_SEVENTIMER = "https://www.7timer.
|
|
3
|
+
BASE_URL_SEVENTIMER = "https://www.7timer.info2/bin/api.pl"
|
|
4
4
|
BASE_URL_MET = "https://api.met.no/weatherapi/locationforecast/2.0/complete"
|
|
5
5
|
HEADERS = {"User-Agent": "AstroWeather github.com/mawinkler/astroweather"}
|
|
6
6
|
STIMER_OUTPUT = "json"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio/dataclasses.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio/helper_functions.py
RENAMED
|
File without changes
|
{pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{pyastroweatherio-0.43.1.dev4 → pyastroweatherio-0.43.1.dev6}/pyastroweatherio.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|