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.
Files changed (25) hide show
  1. {e_data-1.2.21/e_data.egg-info → e_data-1.2.22}/PKG-INFO +1 -1
  2. {e_data-1.2.21 → e_data-1.2.22/e_data.egg-info}/PKG-INFO +1 -1
  3. {e_data-1.2.21 → e_data-1.2.22}/edata/connectors/datadis.py +4 -2
  4. {e_data-1.2.21 → e_data-1.2.22}/edata/helpers.py +21 -0
  5. {e_data-1.2.21 → e_data-1.2.22}/setup.py +1 -1
  6. {e_data-1.2.21 → e_data-1.2.22}/LICENSE +0 -0
  7. {e_data-1.2.21 → e_data-1.2.22}/MANIFEST.in +0 -0
  8. {e_data-1.2.21 → e_data-1.2.22}/README.md +0 -0
  9. {e_data-1.2.21 → e_data-1.2.22}/e_data.egg-info/SOURCES.txt +0 -0
  10. {e_data-1.2.21 → e_data-1.2.22}/e_data.egg-info/dependency_links.txt +0 -0
  11. {e_data-1.2.21 → e_data-1.2.22}/e_data.egg-info/requires.txt +0 -0
  12. {e_data-1.2.21 → e_data-1.2.22}/e_data.egg-info/top_level.txt +0 -0
  13. {e_data-1.2.21 → e_data-1.2.22}/edata/__init__.py +0 -0
  14. {e_data-1.2.21 → e_data-1.2.22}/edata/connectors/__init__.py +0 -0
  15. {e_data-1.2.21 → e_data-1.2.22}/edata/connectors/redata.py +0 -0
  16. {e_data-1.2.21 → e_data-1.2.22}/edata/const.py +0 -0
  17. {e_data-1.2.21 → e_data-1.2.22}/edata/definitions.py +0 -0
  18. {e_data-1.2.21 → e_data-1.2.22}/edata/processors/__init__.py +0 -0
  19. {e_data-1.2.21 → e_data-1.2.22}/edata/processors/base.py +0 -0
  20. {e_data-1.2.21 → e_data-1.2.22}/edata/processors/billing.py +0 -0
  21. {e_data-1.2.21 → e_data-1.2.22}/edata/processors/consumption.py +0 -0
  22. {e_data-1.2.21 → e_data-1.2.22}/edata/processors/maximeter.py +0 -0
  23. {e_data-1.2.21 → e_data-1.2.22}/edata/processors/utils.py +0 -0
  24. {e_data-1.2.21 → e_data-1.2.22}/edata/storage.py +0 -0
  25. {e_data-1.2.21 → e_data-1.2.22}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: e-data
3
- Version: 1.2.21
3
+ Version: 1.2.22
4
4
  Summary: Python library for managing spanish energy data from various web providers
5
5
  Home-page: https://github.com/uvejota/python-edata
6
6
  Author: VMG
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: e-data
3
- Version: 1.2.21
3
+ Version: 1.2.22
4
4
  Summary: Python library for managing spanish energy data from various web providers
5
5
  Home-page: https://github.com/uvejota/python-edata
6
6
  Author: VMG
@@ -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("Returning cached data")
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}
@@ -20,7 +20,7 @@ URL = "https://github.com/uvejota/python-edata"
20
20
  EMAIL = "vmayorg@outlook.es"
21
21
  AUTHOR = "VMG"
22
22
  REQUIRES_PYTHON = ">=3.6.0"
23
- VERSION = "1.2.21"
23
+ VERSION = "1.2.22"
24
24
 
25
25
  # What packages are required for this module to be executed?
26
26
  REQUIRED = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes