meteocat 0.1.51 → 1.0.2

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,29 @@
1
+ ## [1.0.2](https://github.com/figorr/meteocat/compare/v1.0.1...v1.0.2) (2025-01-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 1.0.2 ([8ec865b](https://github.com/figorr/meteocat/commit/8ec865b4d09e802bd489bc527dbfa74de5084cb7))
7
+ * include CONFIG_SCHEMA ([8911de2](https://github.com/figorr/meteocat/commit/8911de29c1804c63b79780f0bb057fdf3681eaec))
8
+
9
+ ## [1.0.1](https://github.com/figorr/meteocat/compare/v1.0.0...v1.0.1) (2025-01-04)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * 1.0.1 ([c2f56d7](https://github.com/figorr/meteocat/commit/c2f56d7243649cf48ce1a1d84761c05762832e8c))
15
+ * fix directions translation key ([3545d7c](https://github.com/figorr/meteocat/commit/3545d7cee8662462de4a3ed3c164d9d4a7e5e854))
16
+ * fix hacs.json file removing iot_class ([03d3db0](https://github.com/figorr/meteocat/commit/03d3db08beb94a5d7c92aa0960a6ff627256e88a))
17
+ * fix order in manifest.json ([434e3d5](https://github.com/figorr/meteocat/commit/434e3d50a5369a5a7c9deda0130a691d5e71b991))
18
+ * fix wind direction translation keys ([3a73291](https://github.com/figorr/meteocat/commit/3a73291d803b72890d627eeb5814be17d22ab6b4))
19
+
20
+ ## [1.0.0](https://github.com/figorr/meteocat/compare/v0.1.51...v1.0.0) (2025-01-04)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * 1.0.0 ([a1ec6cf](https://github.com/figorr/meteocat/commit/a1ec6cf411dcb208eeb153b00b73bf9f766d7f23))
26
+
1
27
  ## [0.1.51](https://github.com/figorr/meteocat/compare/v0.1.50...v0.1.51) (2025-01-04)
2
28
 
3
29
 
@@ -1,12 +1,14 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import logging
4
+ import voluptuous as vol
4
5
  from pathlib import Path
5
6
  from homeassistant import core
6
7
  from homeassistant.config_entries import ConfigEntry
7
8
  from homeassistant.core import HomeAssistant
8
9
  from homeassistant.exceptions import HomeAssistantError
9
10
  from homeassistant.helpers.entity_platform import async_get_platforms
11
+ from homeassistant.helpers import config_validation as cv
10
12
 
11
13
  from .coordinator import (
12
14
  MeteocatSensorCoordinator,
@@ -25,7 +27,28 @@ from .const import DOMAIN, PLATFORMS
25
27
  _LOGGER = logging.getLogger(__name__)
26
28
 
27
29
  # Versión
28
- __version__ = "1.0.0"
30
+ __version__ = "1.0.2"
31
+
32
+ # Definir el esquema de configuración CONFIG_SCHEMA
33
+ CONFIG_SCHEMA = vol.Schema(
34
+ {
35
+ DOMAIN: vol.Schema(
36
+ {
37
+ vol.Required("api_key"): cv.string,
38
+ vol.Required("town_name"): cv.string,
39
+ vol.Required("town_id"): cv.string,
40
+ vol.Optional("variable_name", default="temperature"): cv.string,
41
+ vol.Optional("station_name"): cv.string,
42
+ vol.Optional("station_id"): cv.string,
43
+ vol.Optional("province_name"): cv.string,
44
+ vol.Optional("province_id"): cv.string,
45
+ vol.Optional("region_name"): cv.string,
46
+ vol.Optional("region_id"): cv.string,
47
+ }
48
+ )
49
+ },
50
+ extra=vol.ALLOW_EXTRA,
51
+ )
29
52
 
30
53
  def safe_remove(path: Path, is_folder: bool = False):
31
54
  """Elimina de forma segura un archivo o carpeta si existe."""
@@ -4,10 +4,10 @@
4
4
  "codeowners": ["@figorr"],
5
5
  "config_flow": true,
6
6
  "dependencies": ["persistent_notification", "http"],
7
- "iot_class": "cloud_polling",
8
7
  "documentation": "https://github.com/figorr/meteocat",
8
+ "iot_class": "cloud_polling",
9
9
  "issue_tracker": "https://github.com/figorr/meteocat/issues",
10
10
  "loggers": ["meteocatpy"],
11
11
  "requirements": ["meteocatpy==0.0.17", "packaging>=20.3", "wrapt>=1.14.0"],
12
- "version": "1.0.0"
12
+ "version": "1.0.2"
13
13
  }
@@ -719,8 +719,8 @@ class MeteocatSensor(CoordinatorEntity[MeteocatSensorCoordinator], SensorEntity)
719
719
  return "Unknown" # Retorna "Unknown" si el valor no es un número válido
720
720
 
721
721
  directions = [
722
- "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE",
723
- "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW", "N",
722
+ "north", "north_northeast", "northeast", "east_northeast", "east", "east_southeast", "southeast", "south_southeast",
723
+ "south", "south_southwest", "southwest", "west_southwest", "west", "west_northwest", "northwest", "north_northwest", "north",
724
724
  ]
725
725
  index = round(degree / 22.5) % 16
726
726
  return directions[index]
@@ -31,22 +31,22 @@
31
31
  "wind_direction": {
32
32
  "name": "Wind Direction",
33
33
  "state": {
34
- "N": "NN",
35
- "NNE": "NNE",
36
- "NE": "NE",
37
- "ENE": "ENE",
38
- "E": "E",
39
- "ESE": "ESE",
40
- "SE": "SE",
41
- "SSE": "SSE",
42
- "S": "S",
43
- "SSW": "SSW",
44
- "SW": "SW",
45
- "WSW": "WSW",
46
- "W": "W",
47
- "WNW": "WNW",
48
- "NW": "NW",
49
- "NNW": "NNW",
34
+ "north": "N",
35
+ "north_northeast": "NNE",
36
+ "northeast": "NE",
37
+ "east_northeast": "ENE",
38
+ "east": "E",
39
+ "east_southeast": "ESE",
40
+ "southeast": "SE",
41
+ "south_southeast": "SSE",
42
+ "south": "S",
43
+ "south_southwest": "SSW",
44
+ "southwest": "SW",
45
+ "west_southwest": "WSW",
46
+ "west": "W",
47
+ "west_northwest": "WNW",
48
+ "northwest": "NW",
49
+ "north_northwest": "NNW",
50
50
  "unknown": "Unknown"
51
51
  },
52
52
  "state_attributes": {
@@ -31,22 +31,22 @@
31
31
  "wind_direction": {
32
32
  "name": "Vent Direcció",
33
33
  "state": {
34
- "N": "NN",
35
- "NNE": "NNE",
36
- "NE": "NE",
37
- "ENE": "ENE",
38
- "E": "E",
39
- "ESE": "ESE",
40
- "SE": "SE",
41
- "SSE": "SSE",
42
- "S": "S",
43
- "SSW": "SSO",
44
- "SW": "SO",
45
- "WSW": "OSO",
46
- "W": "O",
47
- "WNW": "ONO",
48
- "NW": "NO",
49
- "NNW": "NNO",
34
+ "north": "N",
35
+ "north_northeast": "NNE",
36
+ "northeast": "NE",
37
+ "east_northeast": "ENE",
38
+ "east": "E",
39
+ "east_southeast": "ESE",
40
+ "southeast": "SE",
41
+ "south_southeast": "SSE",
42
+ "south": "S",
43
+ "south_southwest": "SSO",
44
+ "southwest": "SO",
45
+ "west_southwest": "OSO",
46
+ "west": "O",
47
+ "west_northwest": "ONO",
48
+ "northwest": "NO",
49
+ "north_northwest": "NNO",
50
50
  "unknown": "Desconegut"
51
51
  },
52
52
  "state_attributes": {
@@ -31,22 +31,22 @@
31
31
  "wind_direction": {
32
32
  "name": "Wind Direction",
33
33
  "state": {
34
- "N": "NN",
35
- "NNE": "NNE",
36
- "NE": "NE",
37
- "ENE": "ENE",
38
- "E": "E",
39
- "ESE": "ESE",
40
- "SE": "SE",
41
- "SSE": "SSE",
42
- "S": "S",
43
- "SSW": "SSW",
44
- "SW": "SW",
45
- "WSW": "WSW",
46
- "W": "W",
47
- "WNW": "WNW",
48
- "NW": "NW",
49
- "NNW": "NNW",
34
+ "north": "N",
35
+ "north_northeast": "NNE",
36
+ "northeast": "NE",
37
+ "east_northeast": "ENE",
38
+ "east": "E",
39
+ "east_southeast": "ESE",
40
+ "southeast": "SE",
41
+ "south_southeast": "SSE",
42
+ "south": "S",
43
+ "south_southwest": "SSW",
44
+ "southwest": "SW",
45
+ "west_southwest": "WSW",
46
+ "west": "W",
47
+ "west_northwest": "WNW",
48
+ "northwest": "NW",
49
+ "north_northwest": "NNW",
50
50
  "unknown": "Unknown"
51
51
  },
52
52
  "state_attributes": {
@@ -31,22 +31,22 @@
31
31
  "wind_direction": {
32
32
  "name": "Viento Dirección",
33
33
  "state": {
34
- "N": "NN",
35
- "NNE": "NNE",
36
- "NE": "NE",
37
- "ENE": "ENE",
38
- "E": "E",
39
- "ESE": "ESE",
40
- "SE": "SE",
41
- "SSE": "SSE",
42
- "S": "S",
43
- "SSW": "SSO",
44
- "SW": "SO",
45
- "WSW": "OSO",
46
- "W": "O",
47
- "WNW": "ONO",
48
- "NW": "NO",
49
- "NNW": "NNO",
34
+ "north": "N",
35
+ "north_northeast": "NNE",
36
+ "northeast": "NE",
37
+ "east_northeast": "ENE",
38
+ "east": "E",
39
+ "east_southeast": "ESE",
40
+ "southeast": "SE",
41
+ "south_southeast": "SSE",
42
+ "south": "S",
43
+ "south_southwest": "SSO",
44
+ "southwest": "SO",
45
+ "west_southwest": "OSO",
46
+ "west": "O",
47
+ "west_northwest": "ONO",
48
+ "northwest": "NO",
49
+ "north_northwest": "NNO",
50
50
  "unknown": "Desconocido"
51
51
  },
52
52
  "state_attributes": {
@@ -1,2 +1,2 @@
1
1
  # version.py
2
- __version__ = "1.0.0"
2
+ __version__ = "1.0.2"
package/hacs.json CHANGED
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "name": "Meteocat",
3
- "render_readme": true,
4
- "iot_class": "cloud_polling"
3
+ "render_readme": true
5
4
  }
6
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meteocat",
3
- "version": "0.1.51",
3
+ "version": "1.0.2",
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 = "1.0.0"
3
+ version = "1.0.2"
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"