meteocat 0.1.34 → 0.1.35

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.1.35](https://github.com/figorr/meteocat/compare/v0.1.34...v0.1.35) (2024-12-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 0.1.35 ([87adbc5](https://github.com/figorr/meteocat/commit/87adbc5c76941af1ff837f63920ca65164df38c2))
7
+ * fix station data json name ([2c411bd](https://github.com/figorr/meteocat/commit/2c411bd5d040d8c50bd00dae3c4b7858c049e522))
8
+
1
9
  ## [0.1.34](https://github.com/figorr/meteocat/compare/v0.1.33...v0.1.34) (2024-12-14)
2
10
 
3
11
 
@@ -14,7 +14,7 @@ from .const import DOMAIN, PLATFORMS
14
14
  _LOGGER = logging.getLogger(__name__)
15
15
 
16
16
  # Versión
17
- __version__ = "0.1.34"
17
+ __version__ = "0.1.35"
18
18
 
19
19
  def safe_remove(path: Path, is_folder: bool = False):
20
20
  """Elimina de forma segura un archivo o carpeta si existe."""
@@ -96,13 +96,23 @@ async def async_remove_entry(hass: HomeAssistant, entry: ConfigEntry) -> None:
96
96
  """Limpia cualquier dato adicional al desinstalar la integración."""
97
97
  _LOGGER.info(f"Eliminando datos residuales de la integración: {entry.entry_id}")
98
98
 
99
- # Definir las rutas de los archivos y carpetas a eliminar
99
+ # Definir las rutas base a eliminar
100
100
  custom_components_path = Path(hass.config.path("custom_components")) / DOMAIN
101
101
  assets_folder = custom_components_path / "assets"
102
102
  files_folder = custom_components_path / "files"
103
+
104
+ # Definir archivos relacionados a eliminar
103
105
  symbols_file = assets_folder / "symbols.json"
104
106
  variables_file = assets_folder / "variables.json"
105
- station_data_file = files_folder / "station_data.json"
107
+
108
+ # Obtener el `station_id` para identificar el archivo a eliminar
109
+ station_id = entry.data.get("station_id")
110
+ if not station_id:
111
+ _LOGGER.warning("No se encontró 'station_id' en la configuración. No se puede eliminar el archivo de datos de la estación.")
112
+ return
113
+
114
+ # Archivo JSON de la estación
115
+ station_data_file = files_folder / f"station_{station_id.lower()}_data.json"
106
116
 
107
117
  # Validar la ruta base
108
118
  if not custom_components_path.exists():
@@ -96,7 +96,11 @@ class MeteocatSensorCoordinator(DataUpdateCoordinator):
96
96
 
97
97
  # Determinar la ruta al archivo en la carpeta raíz del repositorio
98
98
  output_file = os.path.join(
99
- self.hass.config.path(), "custom_components", "meteocat", "files", "station_data.json"
99
+ self.hass.config.path(),
100
+ "custom_components",
101
+ "meteocat",
102
+ "files",
103
+ f"station_{self.station_id.lower()}_data.json"
100
104
  )
101
105
 
102
106
  # Guardar los datos en un archivo JSON
@@ -8,5 +8,5 @@
8
8
  "documentation": "https://gitlab.com/figorr/meteocat",
9
9
  "loggers": ["meteocatpy"],
10
10
  "requirements": ["meteocatpy==0.0.15", "packaging>=20.3", "wrapt>=1.14.0"],
11
- "version": "0.1.34"
11
+ "version": "0.1.35"
12
12
  }
@@ -1,2 +1,2 @@
1
1
  # version.py
2
- __version__ = "0.1.34"
2
+ __version__ = "0.1.35"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meteocat",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
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/meteocat)](https://pypi.org/project/meteocat)\r [![pipeline status](https://gitlab.com/figorr/meteocat/badges/master/pipeline.svg)](https://gitlab.com/figorr/meteocat/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 = "meteocat"
3
- version = "0.1.34"
3
+ version = "0.1.35"
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"