meteocatpy 0.0.13 → 0.0.14

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.0.14](https://github.com/figorr/meteocatpy/compare/v0.0.13...v0.0.14) (2024-12-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 0.0.14 ([56f4057](https://github.com/figorr/meteocatpy/commit/56f40575bfa985df9210119162c3857c19df36ba))
7
+ * remove cache ([991b274](https://github.com/figorr/meteocatpy/commit/991b27493ad3db5e0d05d3824b3ec45592275af7))
8
+
1
9
  ## [0.0.13](https://github.com/figorr/meteocatpy/compare/v0.0.12...v0.0.13) (2024-12-11)
2
10
 
3
11
 
@@ -7,7 +7,7 @@ from .exceptions import BadRequestError, ForbiddenError, TooManyRequestsError, I
7
7
  class MeteocatVariables:
8
8
  """Clase para interactuar con la lista de variables de la API de Meteocat."""
9
9
 
10
- def __init__(self, api_key: str, cache_dir: str = None):
10
+ def __init__(self, api_key: str):
11
11
  """
12
12
  Inicializa la clase MeteocatVariables.
13
13
 
@@ -20,23 +20,13 @@ class MeteocatVariables:
20
20
  "X-Api-Key": self.api_key,
21
21
  }
22
22
 
23
- # Configurar la ruta de caché
24
- self._cache_dir = os.path.join("custom_components", "meteocat", ".meteocat_cache")
25
- self._cache = Cache(self._cache_dir)
26
-
27
- async def get_variables(self, force_update=False):
23
+ async def get_variables(self):
28
24
  """
29
- Obtiene la lista de variables desde la API de Meteocat. Usa la caché si está disponible.
30
-
31
- Args:
32
- force_update (bool): Si es True, fuerza la actualización desde la API.
25
+ Obtiene la lista de variables desde la API de Meteocat.
33
26
 
34
27
  Returns:
35
28
  list: Datos de las variables.
36
29
  """
37
- # Verificar si las variables están en caché y no se solicita actualización forzada
38
- if not force_update and "variables" in self._cache:
39
- return self._cache["variables"]
40
30
 
41
31
  # Hacer la solicitud a la API para obtener las variables
42
32
  url = f"{BASE_URL}{VARIABLES_URL}"
@@ -45,7 +35,6 @@ class MeteocatVariables:
45
35
  async with session.get(url, headers=self.headers) as response:
46
36
  if response.status == 200:
47
37
  variables = await response.json()
48
- self._cache["variables"] = variables # Guardar en caché
49
38
  return variables
50
39
 
51
40
  # Gestionar errores según el código de estado
@@ -1,2 +1,2 @@
1
1
  # version.py
2
- __version__ = "0.0.13"
2
+ __version__ = "0.0.14"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meteocatpy",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\r [![Python version compatibility](https://img.shields.io/pypi/pyversions/meteocatpy)](https://pypi.org/project/meteocatpy)\r [![pipeline status](https://gitlab.com/figorr/meteocatpy/badges/master/pipeline.svg)](https://gitlab.com/figorr/meteocatpy/commits/master)",
5
5
  "main": "index.js",
6
6
  "directories": {
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "meteocatpy"
3
- version = "0.0.13"
3
+ version = "0.0.14"
4
4
  description = "Script para obtener datos meteorológicos de la API de Meteocat"
5
5
  authors = ["figorr <jdcuartero@yahoo.es>"]
6
6
  license = "Apache-2.0"