meteocat 2.3.0 → 3.1.0

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 (37) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +8 -2
  2. package/.github/ISSUE_TEMPLATE/config.yml +7 -0
  3. package/.github/ISSUE_TEMPLATE/improvement.md +39 -0
  4. package/.github/ISSUE_TEMPLATE/new_function.md +41 -0
  5. package/.github/labels.yml +63 -0
  6. package/.github/workflows/autocloser.yaml +11 -9
  7. package/.github/workflows/close-on-label.yml +48 -0
  8. package/.github/workflows/force-sync-labels.yml +18 -0
  9. package/.github/workflows/release.yml +1 -31
  10. package/.github/workflows/sync-gitlab.yml +17 -4
  11. package/.github/workflows/sync-labels.yml +21 -0
  12. package/.releaserc +21 -0
  13. package/AUTHORS.md +1 -0
  14. package/CHANGELOG.md +58 -1
  15. package/README.md +81 -6
  16. package/custom_components/meteocat/__init__.py +51 -41
  17. package/custom_components/meteocat/config_flow.py +52 -3
  18. package/custom_components/meteocat/const.py +3 -0
  19. package/custom_components/meteocat/coordinator.py +188 -2
  20. package/custom_components/meteocat/manifest.json +1 -1
  21. package/custom_components/meteocat/options_flow.py +61 -3
  22. package/custom_components/meteocat/sensor.py +305 -254
  23. package/custom_components/meteocat/strings.json +61 -15
  24. package/custom_components/meteocat/translations/ca.json +67 -22
  25. package/custom_components/meteocat/translations/en.json +61 -15
  26. package/custom_components/meteocat/translations/es.json +61 -15
  27. package/custom_components/meteocat/version.py +1 -1
  28. package/custom_components/meteocat/weather.py +1 -1
  29. package/hacs.json +1 -1
  30. package/images/daily_forecast_2_alerts.png +0 -0
  31. package/images/regenerate_assets.png +0 -0
  32. package/images/setup_options.png +0 -0
  33. package/images/system_options.png +0 -0
  34. package/package.json +1 -1
  35. package/pyproject.toml +1 -1
  36. package/scripts/update_version.sh +22 -0
  37. package/.github/workflows/close-duplicates.yml +0 -57
@@ -34,9 +34,9 @@
34
34
  }
35
35
  },
36
36
  "options": {
37
- "step":{
37
+ "step": {
38
38
  "init": {
39
- "description": "Configura el API Key, los límites de la API y regenera los archivos en 'assets'.",
39
+ "description": "Configura la clave API, los límites de la API, regenera los archivos de 'assets' o actualiza las coordenadas.",
40
40
  "title": "Opciones de configuración",
41
41
  "data": {
42
42
  "option": "Opciones"
@@ -50,6 +50,14 @@
50
50
  "description": "Configura los límites de la API.",
51
51
  "title": "Límites de la API"
52
52
  },
53
+ "update_coordinates": {
54
+ "description": "Introduce nuevas coordenadas. Coordenadas actuales: latitud {current_latitude}, longitud {current_longitude}.",
55
+ "title": "Actualizar coordenadas",
56
+ "data": {
57
+ "latitude": "Latitud",
58
+ "longitude": "Longitud"
59
+ }
60
+ },
53
61
  "confirm_regenerate_assets": {
54
62
  "description": "Regenera los archivos de 'assets'.",
55
63
  "title": "Regenera 'assets'",
@@ -61,7 +69,8 @@
61
69
  "error": {
62
70
  "cannot_connect": "Error de conexión. Error al comprobar la nueva API Key.",
63
71
  "unknown": "Error desconocido al comprobar la nueva API Key.",
64
- "invalid_limit": "Límite no válido. El límite debe ser un número positivo."
72
+ "invalid_limit": "Límite no válido. El límite debe ser un número positivo.",
73
+ "invalid_coordinates": "Las coordenadas deben estar dentro del rango de Cataluña (latitud: 40.5 a 42.5, longitud: 0.1 a 3.3)."
65
74
  }
66
75
  },
67
76
  "selector": {
@@ -69,7 +78,8 @@
69
78
  "options": {
70
79
  "update_api_and_limits": "Actualizar API Key y límites.",
71
80
  "update_limits_only": "Actualizar API límites.",
72
- "regenerate_assets": "Regenerar archivos de 'assets'."
81
+ "regenerate_assets": "Regenerar archivos de 'assets'.",
82
+ "update_coordinates": "Actualizar coordenadas (latitud y longitud)."
73
83
  }
74
84
  }
75
85
  },
@@ -269,7 +279,7 @@
269
279
  "cloud_cloud": {
270
280
  "name": "Nube-Nube"
271
281
  },
272
- "cloud_ground_neg":{
282
+ "cloud_ground_neg": {
273
283
  "name": "Nube-Tierra Negativo"
274
284
  },
275
285
  "cloud_ground_pos": {
@@ -283,7 +293,7 @@
283
293
  "cloud_cloud": {
284
294
  "name": "Nube-Nube"
285
295
  },
286
- "cloud_ground_neg":{
296
+ "cloud_ground_neg": {
287
297
  "name": "Nube-Tierra Negativo"
288
298
  },
289
299
  "cloud_ground_pos": {
@@ -533,7 +543,8 @@
533
543
  "wind_35": "Racha máxima > 35 m/s",
534
544
  "wind_30": "Racha máxima > 30 m/s",
535
545
  "wind_25": "Racha máxima > 25 m/s",
536
- "wind_20": "Racha máxima > 20 m/s"
546
+ "wind_20": "Racha máxima > 20 m/s",
547
+ "unknown": "Desconocido"
537
548
  }
538
549
  },
539
550
  "peligro": {
@@ -572,7 +583,8 @@
572
583
  "hail_2_cm": "Granizo de diámetro > 2 cm",
573
584
  "microburst": "Reventón",
574
585
  "intensity_40_30": "Intensidad > 40 mm / 30 minutos",
575
- "intensity_20_30": "Intensidad > 20 mm / 30 minutos"
586
+ "intensity_20_30": "Intensidad > 20 mm / 30 minutos",
587
+ "unknown": "Desconocido"
576
588
  }
577
589
  },
578
590
  "peligro": {
@@ -610,7 +622,8 @@
610
622
  "state": {
611
623
  "microburst": "Reventón",
612
624
  "rain_200_24": "Acumulada > 200 mm /24 horas",
613
- "rain_100_24": "Acumulada > 100 mm /24 horas"
625
+ "rain_100_24": "Acumulada > 100 mm /24 horas",
626
+ "unknown": "Desconocido"
614
627
  }
615
628
  },
616
629
  "peligro": {
@@ -649,7 +662,8 @@
649
662
  "microburst": "Reventón",
650
663
  "tornadoes": "Tornados o mangas marinas",
651
664
  "waves_4": "Olas > 4.00 metros (mar brava)",
652
- "waves_2_50": "Olas > 2.50 metros (mar temporal)"
665
+ "waves_2_50": "Olas > 2.50 metros (mar temporal)",
666
+ "unknown": "Desconocido"
653
667
  }
654
668
  },
655
669
  "peligro": {
@@ -686,7 +700,8 @@
686
700
  "name": "Umbral",
687
701
  "state": {
688
702
  "cold_very_intense": "Frío muy intenso",
689
- "cold_intense": "Frío intenso"
703
+ "cold_intense": "Frío intenso",
704
+ "unknown": "Desconocido"
690
705
  }
691
706
  },
692
707
  "peligro": {
@@ -723,7 +738,8 @@
723
738
  "name": "Umbral",
724
739
  "state": {
725
740
  "heat_very_intense": "Calor muy intenso",
726
- "heat_intense": "Calor intenso"
741
+ "heat_intense": "Calor intenso",
742
+ "unknown": "Desconocido"
727
743
  }
728
744
  },
729
745
  "peligro": {
@@ -760,7 +776,8 @@
760
776
  "name": "Umbral",
761
777
  "state": {
762
778
  "heat_night_very_intense": "Calor nocturno muy intenso",
763
- "heat_night_intense": "Calor nocturno intenso"
779
+ "heat_night_intense": "Calor nocturno intenso",
780
+ "unknown": "Desconocido"
764
781
  }
765
782
  },
766
783
  "peligro": {
@@ -806,7 +823,8 @@
806
823
  "thickness_5_at_300": "grosor > 5 cm en cotas inferiores a 300 metros",
807
824
  "thickness_5_at_600": "grosor > 5 cm en cotas superiores a 600 metros hasta 800 metros",
808
825
  "thickness_2_at_300": "grosor > 2 cm en cotas superiores a 300 metros hasta 600 metros",
809
- "thickness_0_at_300": "grosor ≥ 0 cm en cotas inferiores a 300 metros"
826
+ "thickness_0_at_300": "grosor ≥ 0 cm en cotas inferiores a 300 metros",
827
+ "unknown": "Desconocido"
810
828
  }
811
829
  },
812
830
  "peligro": {
@@ -816,7 +834,35 @@
816
834
  "name": "Nivel"
817
835
  }
818
836
  }
837
+ },
838
+ "sunrise": {
839
+ "name": "Amanecer",
840
+ "state_attributes": {
841
+ "friendly_time": {
842
+ "name": "Hora"
843
+ }
844
+ }
845
+ },
846
+ "sunset": {
847
+ "name": "Atardecer",
848
+ "state_attributes": {
849
+ "friendly_time": {
850
+ "name": "Hora"
851
+ }
852
+ }
853
+ },
854
+ "sun_file_status": {
855
+ "name": "Archivo Sol",
856
+ "state": {
857
+ "updated": "Actualizado",
858
+ "obsolete": "Obsoleto"
859
+ },
860
+ "state_attributes": {
861
+ "update_date": {
862
+ "name": "Fecha"
863
+ }
864
+ }
819
865
  }
820
866
  }
821
867
  }
822
- }
868
+ }
@@ -1 +1 @@
1
- __version__ = ""
1
+ __version__ = "3.1.0"
@@ -107,7 +107,7 @@ class MeteocatWeatherEntity(CoordinatorEntity, WeatherEntity):
107
107
  @property
108
108
  def unique_id(self) -> str:
109
109
  """Return the unique ID of the entity."""
110
- return f"weather.{DOMAIN}_{self._station_id}"
110
+ return f"weather.{DOMAIN}_{self._town_id}"
111
111
 
112
112
  @property
113
113
  def condition(self) -> Optional[str]:
package/hacs.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "Meteocat",
3
- "homeassistant": "2025.8.3",
3
+ "homeassistant": "2025.9.3",
4
4
  "hide_default_branch": true,
5
5
  "render_readme": true,
6
6
  "zip_release": true,
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meteocat",
3
- "version": "2.3.0",
3
+ "version": "3.1.0",
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 = ""
3
+ version = "3.1.0"
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"
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ version="$1"
5
+
6
+ # pyproject.toml
7
+ sed -i "s/^version = \".*\"/version = \"$version\"/" pyproject.toml
8
+
9
+ # manifest.json
10
+ jq --arg ver "$version" '.version = $ver' custom_components/meteocat/manifest.json > tmp.json && mv tmp.json custom_components/meteocat/manifest.json
11
+
12
+ # version.py
13
+ echo "__version__ = \"$version\"" > custom_components/meteocat/version.py
14
+
15
+ # __init__.py
16
+ sed -i "s/^__version__ = \".*\"/__version__ = \"$version\"/" custom_components/meteocat/__init__.py
17
+
18
+ # package.json
19
+ jq --arg ver "$version" '.version = $ver' package.json > tmp.json && mv tmp.json package.json
20
+
21
+ # package-lock.json
22
+ jq --arg ver "$version" '.version = $ver | .packages[""].version = $ver' package-lock.json > tmp.json && mv tmp.json package-lock.json
@@ -1,57 +0,0 @@
1
- name: Close duplicate issues
2
-
3
- on:
4
- issues:
5
- types:
6
- - labeled
7
-
8
- jobs:
9
- close-duplicate:
10
- runs-on: ubuntu-latest
11
- if: github.event.label.name == 'duplicate'
12
- steps:
13
- - name: Extract linked issue number
14
- id: extract
15
- run: |
16
- body="${{ github.event.issue.body }}"
17
- # Convertimos a minúsculas para que el match sea insensible a mayúsculas
18
- lower=$(echo "$body" | tr '[:upper:]' '[:lower:]')
19
-
20
- # Buscamos "closed as duplicate of #123" o "duplicate of #123"
21
- if [[ "$lower" =~ closed[[:space:]]+as[[:space:]]+duplicate[[:space:]]+of[[:space:]]+#([0-9]+) ]]; then
22
- echo "number=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
23
- elif [[ "$lower" =~ duplicate[[:space:]]+of[[:space:]]+#([0-9]+) ]]; then
24
- echo "number=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
25
- fi
26
-
27
- - name: Close issue
28
- if: steps.extract.outputs.number != ''
29
- uses: peter-evans/close-issue@v2
30
- with:
31
- issue-number: ${{ github.event.issue.number }}
32
- comment: |
33
- Closed as duplicate of #${{ steps.extract.outputs.number }}.
34
- Please follow the discussion there.
35
-
36
- - name: Update title
37
- if: steps.extract.outputs.number != ''
38
- uses: actions-ecosystem/action-edit-issue@v1
39
- with:
40
- github_token: ${{ secrets.GITHUB_TOKEN }}
41
- issue_number: ${{ github.event.issue.number }}
42
- title: "[Duplicate] ${{ github.event.issue.title }}"
43
-
44
- - name: Remove duplicate label
45
- if: steps.extract.outputs.number != ''
46
- uses: actions-ecosystem/action-remove-labels@v1
47
- with:
48
- github_token: ${{ secrets.GITHUB_TOKEN }}
49
- issue_number: ${{ github.event.issue.number }}
50
- labels: duplicate
51
-
52
- - name: Lock conversation
53
- if: steps.extract.outputs.number != ''
54
- uses: dessant/lock-threads@v4
55
- with:
56
- github-token: ${{ secrets.GITHUB_TOKEN }}
57
- issue-lock-reason: "resolved"