e-data 1.2.21__tar.gz → 1.2.22__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.
- {e_data-1.2.21/e_data.egg-info → e_data-1.2.22}/PKG-INFO +1 -1
- {e_data-1.2.21 → e_data-1.2.22/e_data.egg-info}/PKG-INFO +1 -1
- {e_data-1.2.21 → e_data-1.2.22}/edata/connectors/datadis.py +4 -2
- {e_data-1.2.21 → e_data-1.2.22}/edata/helpers.py +21 -0
- {e_data-1.2.21 → e_data-1.2.22}/setup.py +1 -1
- {e_data-1.2.21 → e_data-1.2.22}/LICENSE +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/MANIFEST.in +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/README.md +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/e_data.egg-info/SOURCES.txt +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/e_data.egg-info/dependency_links.txt +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/e_data.egg-info/requires.txt +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/e_data.egg-info/top_level.txt +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/__init__.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/connectors/__init__.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/connectors/redata.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/const.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/definitions.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/processors/__init__.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/processors/base.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/processors/billing.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/processors/consumption.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/processors/maximeter.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/processors/utils.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/edata/storage.py +0 -0
- {e_data-1.2.21 → e_data-1.2.22}/setup.cfg +0 -0
|
@@ -160,7 +160,7 @@ class DatadisConnector:
|
|
|
160
160
|
try:
|
|
161
161
|
with open(cache_file, encoding="utf8") as cache:
|
|
162
162
|
return json.load(cache)
|
|
163
|
-
except FileNotFoundError:
|
|
163
|
+
except (FileNotFoundError, json.decoder.JSONDecodeError):
|
|
164
164
|
return None
|
|
165
165
|
|
|
166
166
|
def _get_token(self):
|
|
@@ -234,7 +234,9 @@ class DatadisConnector:
|
|
|
234
234
|
if not ignore_recent_queries and self._is_recent_query(url + params):
|
|
235
235
|
_cache = self._get_cache_for_query(url + params)
|
|
236
236
|
if _cache is not None:
|
|
237
|
-
_LOGGER.info(
|
|
237
|
+
_LOGGER.info(
|
|
238
|
+
"Returning cached response for '%s'", url + anonym_params
|
|
239
|
+
)
|
|
238
240
|
return _cache
|
|
239
241
|
return []
|
|
240
242
|
|
|
@@ -746,3 +746,24 @@ class EdataHelper:
|
|
|
746
746
|
|
|
747
747
|
if last_month is not None:
|
|
748
748
|
self.attributes["last_month_€"] = last_month.get("value_eur", None)
|
|
749
|
+
|
|
750
|
+
def reset(self):
|
|
751
|
+
"""Reset in-mem objects."""
|
|
752
|
+
|
|
753
|
+
self.data = EdataData(
|
|
754
|
+
supplies=[],
|
|
755
|
+
contracts=[],
|
|
756
|
+
consumptions=[],
|
|
757
|
+
maximeter=[],
|
|
758
|
+
pvpc=[],
|
|
759
|
+
consumptions_daily_sum=[],
|
|
760
|
+
consumptions_monthly_sum=[],
|
|
761
|
+
cost_hourly_sum=[],
|
|
762
|
+
cost_daily_sum=[],
|
|
763
|
+
cost_monthly_sum=[],
|
|
764
|
+
)
|
|
765
|
+
|
|
766
|
+
for attr in ATTRIBUTES:
|
|
767
|
+
self.attributes[attr] = None
|
|
768
|
+
|
|
769
|
+
self.last_update = {x: datetime(1970, 1, 1) for x in self.data}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|