meteocat 3.2.0 → 4.0.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.
- package/.github/ISSUE_TEMPLATE/bug_report.md +45 -45
- package/.github/ISSUE_TEMPLATE/config.yml +8 -8
- package/.github/ISSUE_TEMPLATE/improvement.md +39 -39
- package/.github/ISSUE_TEMPLATE/new_function.md +41 -41
- package/.github/labels.yml +63 -63
- package/.github/workflows/autocloser.yaml +27 -27
- package/.github/workflows/close-on-label.yml +48 -48
- package/.github/workflows/force-sync-labels.yml +18 -18
- package/.github/workflows/hassfest.yaml +13 -13
- package/.github/workflows/publish-zip.yml +67 -67
- package/.github/workflows/release.yml +41 -41
- package/.github/workflows/stale.yml +63 -63
- package/.github/workflows/sync-gitlab.yml +107 -107
- package/.github/workflows/sync-labels.yml +21 -21
- package/.github/workflows/validate.yaml +16 -16
- package/.pre-commit-config.yaml +37 -37
- package/.releaserc +37 -37
- package/AUTHORS.md +13 -13
- package/CHANGELOG.md +954 -932
- package/README.md +207 -207
- package/conftest.py +11 -11
- package/custom_components/meteocat/__init__.py +298 -298
- package/custom_components/meteocat/condition.py +63 -63
- package/custom_components/meteocat/config_flow.py +613 -613
- package/custom_components/meteocat/const.py +132 -132
- package/custom_components/meteocat/helpers.py +58 -58
- package/custom_components/meteocat/manifest.json +25 -25
- package/custom_components/meteocat/options_flow.py +287 -287
- package/custom_components/meteocat/strings.json +1058 -1058
- package/custom_components/meteocat/translations/ca.json +1058 -1058
- package/custom_components/meteocat/translations/en.json +1058 -1058
- package/custom_components/meteocat/translations/es.json +1058 -1058
- package/custom_components/meteocat/version.py +1 -1
- package/custom_components/meteocat/weather.py +218 -218
- package/filetree.py +48 -48
- package/filetree.txt +79 -79
- package/hacs.json +8 -8
- package/info.md +11 -11
- package/package.json +22 -22
- package/poetry.lock +3222 -3222
- package/pyproject.toml +68 -68
- package/requirements.test.txt +3 -3
- package/setup.cfg +64 -64
- package/setup.py +10 -10
- package/tests/bandit.yaml +17 -17
- package/tests/conftest.py +19 -19
- package/tests/test_init.py +9 -9
package/README.md
CHANGED
|
@@ -1,208 +1,208 @@
|
|
|
1
|
-
# Meteocat for Home Assistant
|
|
2
|
-

|
|
3
|
-
[](https://opensource.org/licenses/Apache-2.0)
|
|
4
|
-
[](https://pypi.org/project/meteocat)
|
|
5
|
-
[](https://github.com/hacs/integration)
|
|
6
|
-
[](https://github.com/figorr/meteocat/actions/workflows/validate.yaml)
|
|
7
|
-
[](https://github.com/figorr/meteocat/actions/workflows/release.yml)
|
|
8
|
-

|
|
9
|
-

|
|
10
|
-

|
|
11
|
-
[](#-breaking-changes---upgrade-to-3x)
|
|
12
|
-
|
|
13
|
-
This is a project to obtain meteorological data from the Meteocat API inside the Home Assistant environment.
|
|
14
|
-
|
|
15
|
-
All the data is property of Meteocat ("Servei Meteorològic de Catalunya"). This project is only a tool to offer an easy and secure access to the meteorological data provided by the "Servei Meteorològic de Catalunya" API, so you can use the data for your personal use.
|
|
16
|
-
|
|
17
|
-
Commercial use of this project or the data obtained from the API is not allowed without prior permission from the author, in case of the project, or from the "Servei Meteorològic de Catalunya" in the case of the data provided by the API.
|
|
18
|
-
|
|
19
|
-
**NOTE:** Meteocat API requires to use an API_KEY, you should ask to (https://apidocs.meteocat.gencat.cat/documentacio/acces-ciutada-i-administracio/)
|
|
20
|
-
|
|
21
|
-
# Credits
|
|
22
|
-
|
|
23
|
-
This is a personal project.
|
|
24
|
-
|
|
25
|
-
**Authors:**
|
|
26
|
-
- [Figorr](https://github.com/figorr)
|
|
27
|
-
|
|
28
|
-
**Contributors:**
|
|
29
|
-
- [mcasellas](https://github.com/mcasellas) – contributed [c505f27](https://github.com/figorr/meteocat/commit/c505f27) - Improve Catalan translations
|
|
30
|
-
|
|
31
|
-
## ⚠️ Breaking changes - Upgrade to 3.0.0 or later coming from prior versions
|
|
32
|
-
|
|
33
|
-
Version **3.0.0 and later** introduces a **breaking change** in how entities are identified.
|
|
34
|
-
|
|
35
|
-
### ⚠️ What this affects
|
|
36
|
-
- This affects any update **from a version prior to 3.0.0** to **any version 3.x or later**.
|
|
37
|
-
- Entities now use **`town_id`** instead of `region_id` in their `unique_id`.
|
|
38
|
-
- This change allows multiple integration entries that share the same `region_id` but different towns.
|
|
39
|
-
|
|
40
|
-
### ✅ Recommended upgrade procedure
|
|
41
|
-
To avoid issues with duplicated or unavailable entities:
|
|
42
|
-
|
|
43
|
-
1. **Uninstall** the existing integration (v2.x).<br>
|
|
44
|
-
🔗 See [Uninstallation Guide](https://github.com/figorr/meteocat/wiki/Uninstallation) for the proper way of removing prior versions.
|
|
45
|
-
2. **Restart** Home Assistant.
|
|
46
|
-
3. **Install v3.0.0 or later** and configure the integration again.
|
|
47
|
-
|
|
48
|
-
### 🚨 If you update directly
|
|
49
|
-
If you update without uninstalling first:
|
|
50
|
-
|
|
51
|
-
- Old entities will remain as **Unavailable**.
|
|
52
|
-
- New entities will be created (sometimes with a suffix like `2`).
|
|
53
|
-
- You may need to manually **remove old entities** and update your automations, dashboards, or scripts to point to the new entities.
|
|
54
|
-
|
|
55
|
-
### 📑 Additional notes
|
|
56
|
-
|
|
57
|
-
- This change affects all entity types, including **sensors, diagnostic sensors, and alerts**.
|
|
58
|
-
- Always backup your **Home Assistant configuration** before performing major upgrades.
|
|
59
|
-
|
|
60
|
-
## Installation
|
|
61
|
-
|
|
62
|
-
#### HACS - Install using the custom repository method.
|
|
63
|
-
|
|
64
|
-
1. First of all you need to add a custom repository like [this](https://hacs.xyz/docs/faq/custom_repositories/).
|
|
65
|
-
1. Then download the integration from HACS.
|
|
66
|
-
1. Restart Home Assistant.
|
|
67
|
-
1. Go to `Settings > Devices & Services`
|
|
68
|
-
1. Click `+ Add Integration`
|
|
69
|
-
1. Search for `Meteocat` and follow the configuration instructions
|
|
70
|
-
|
|
71
|
-
#### HACS - Install from the store
|
|
72
|
-
1. Go to `HACS`
|
|
73
|
-
1. Search for `Meteocat` and add it to HACS
|
|
74
|
-
1. Restart Home Assistant
|
|
75
|
-
1. Go to `Settings > Devices & Services`
|
|
76
|
-
1. Click `+ Add Integration`
|
|
77
|
-
1. Search for `Meteocat` and follow the configuration instructions
|
|
78
|
-
|
|
79
|
-
#### Manually
|
|
80
|
-
Copy the `custom_components/meteocat` folder into the config folder.
|
|
81
|
-
|
|
82
|
-
## Configuration
|
|
83
|
-
To add a Meteocat Device, go to `Configuration > Integrations` in the UI. Then click the `+` button and from the list of integrations select Meteocat. You will then be prompted to enter your API Key.
|
|
84
|
-
|
|
85
|
-

|
|
86
|
-
|
|
87
|
-
After submitting your API Key you will either be prompted to pick a town from the list as shown below.
|
|
88
|
-
|
|
89
|
-

|
|
90
|
-
|
|
91
|
-
Once you pick the town you will be prompted to pick a station from the list. These are the nearest stations to the picked town.
|
|
92
|
-
|
|
93
|
-

|
|
94
|
-
|
|
95
|
-
Then you will be asked to set the API limits from your plan.
|
|
96
|
-
|
|
97
|
-

|
|
98
|
-
|
|
99
|
-
Then you will be asked to pick an area for the device.
|
|
100
|
-
|
|
101
|
-

|
|
102
|
-
|
|
103
|
-
If the device is added successfully it should appear as shown.
|
|
104
|
-
|
|
105
|
-

|
|
106
|
-
|
|
107
|
-
This device will then have the entities shown below. The sensors are translated to your system language (according to tranlation folder: en, es, ca). Or English by default.
|
|
108
|
-
|
|
109
|
-

|
|
110
|
-
|
|
111
|
-

|
|
112
|
-
|
|
113
|
-
## Changing Units
|
|
114
|
-
|
|
115
|
-
To change units select one of the entities and open the more info dialog and click the cog in the top right. This will bring up the settings for the entity. Then select `Unit of Measurement`, and a dropdown will appear where you can select the units you want.
|
|
116
|
-
|
|
117
|
-

|
|
118
|
-
|
|
119
|
-
## Options
|
|
120
|
-
|
|
121
|
-
Once the integration is installed, you can reconfigure some parameters without having to remove and reinstall Meteocat.
|
|
122
|
-
|
|
123
|
-
Go to:
|
|
124
|
-
`Settings > Devices & Services > Meteocat > Configure`
|
|
125
|
-
|
|
126
|
-
You will see three available options:
|
|
127
|
-
|
|
128
|
-
- **Update API Key and limits**
|
|
129
|
-
Allows you to change the API Key and update all API plan limits at the same time.
|
|
130
|
-
|
|
131
|
-
- **Update limits only**
|
|
132
|
-
Allows you to adjust only the API plan limits, keeping the same API Key.
|
|
133
|
-
|
|
134
|
-
- **Regenerate assets**
|
|
135
|
-
If for any reason some files in the `assets` folder (`towns.json`, `stations.json`, `variables.json`, `symbols.json`, or `stations_<town_id>.json`) are missing or outdated, you can regenerate them directly from the options menu.
|
|
136
|
-
> ℹ️ If the Meteocat API is not available at that moment, the integration will still start, and you can retry regeneration later.
|
|
137
|
-
|
|
138
|
-
- **Update coordinates and elevation**
|
|
139
|
-
Change the default station coordinates and elevation that were set during the first setup. So you can use your location coordinates and elevation for more accurate sun and moon data.
|
|
140
|
-
|
|
141
|
-
### Accessing the Options Menu
|
|
142
|
-
|
|
143
|
-
You can access the Options Menu in two ways, both inside the integration:
|
|
144
|
-
|
|
145
|
-
- **Setup Options**
|
|
146
|
-
|
|
147
|
-

|
|
148
|
-
|
|
149
|
-
- **System Options**
|
|
150
|
-
|
|
151
|
-

|
|
152
|
-
|
|
153
|
-
Once you are inside, you will see the following options:
|
|
154
|
-
|
|
155
|
-

|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
## Uninstallation
|
|
159
|
-
|
|
160
|
-
To correctly uninstall the integration:
|
|
161
|
-
|
|
162
|
-
- If you are upgrading due to **breaking changes**, remove all configured entries from
|
|
163
|
-
**Settings > Devices & Services > Integrations**, restart Home Assistant, and reinstall the new version.
|
|
164
|
-
- If you want to **completely remove Meteocat**, after removing the entries and restarting, also uninstall the integration from **HACS > Integrations**.
|
|
165
|
-
|
|
166
|
-
👉 For detailed steps with screenshots, check the [Uninstallation Guide](https://github.com/figorr/meteocat/wiki/Uninstallation).
|
|
167
|
-
|
|
168
|
-
## Custom Meteocat Card available
|
|
169
|
-
|
|
170
|
-
Meteocat integration has its own weather card.
|
|
171
|
-
|
|
172
|
-
To install the card, please follow the instructions from its own repository, [🎫 Meteocat Card](https://github.com/figorr/meteocat-card).
|
|
173
|
-
|
|
174
|
-

|
|
175
|
-
|
|
176
|
-
# Documentation
|
|
177
|
-
|
|
178
|
-
For more detailed information about:
|
|
179
|
-
- Installation and configuration
|
|
180
|
-
- Usage examples
|
|
181
|
-
- Extra attributes in sensors
|
|
182
|
-
- Known issues and troubleshooting
|
|
183
|
-
|
|
184
|
-
please visit the [📖 Meteocat Wiki](https://github.com/figorr/meteocat/wiki).
|
|
185
|
-
|
|
186
|
-
# Contributing
|
|
187
|
-
|
|
188
|
-
1. [Check for open features/bugs](https://github.com/figorr/meteocat/issues)
|
|
189
|
-
or [initiate a discussion on one](https://github.com/figorr/meteocat/issues/new/choose).
|
|
190
|
-
2. [Fork the repository](https://github.com/figorr/meteocat/fork).
|
|
191
|
-
3. Install the dev environment: `make init`.
|
|
192
|
-
4. Enter the virtual environment: `pipenv shell`
|
|
193
|
-
5. Code your new feature or bug fix.
|
|
194
|
-
6. Write a test that covers your new functionality.
|
|
195
|
-
7. Update `README.md` with any new documentation.
|
|
196
|
-
8. Run tests and ensure 100% code coverage for your contribution: `make coverage`
|
|
197
|
-
9. Ensure you have no linting errors: `make lint`
|
|
198
|
-
10. Ensure you have typed your code correctly: `make typing`
|
|
199
|
-
11. Add yourself to `AUTHORS.md`.
|
|
200
|
-
12. Submit a pull request!
|
|
201
|
-
|
|
202
|
-
# License
|
|
203
|
-
|
|
204
|
-
[Apache-2.0](LICENSE). By providing a contribution, you agree the contribution is licensed under Apache-2.0.
|
|
205
|
-
|
|
206
|
-
# API Reference
|
|
207
|
-
|
|
1
|
+
# Meteocat for Home Assistant
|
|
2
|
+

|
|
3
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
4
|
+
[](https://pypi.org/project/meteocat)
|
|
5
|
+
[](https://github.com/hacs/integration)
|
|
6
|
+
[](https://github.com/figorr/meteocat/actions/workflows/validate.yaml)
|
|
7
|
+
[](https://github.com/figorr/meteocat/actions/workflows/release.yml)
|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+
[](#-breaking-changes---upgrade-to-3x)
|
|
12
|
+
|
|
13
|
+
This is a project to obtain meteorological data from the Meteocat API inside the Home Assistant environment.
|
|
14
|
+
|
|
15
|
+
All the data is property of Meteocat ("Servei Meteorològic de Catalunya"). This project is only a tool to offer an easy and secure access to the meteorological data provided by the "Servei Meteorològic de Catalunya" API, so you can use the data for your personal use.
|
|
16
|
+
|
|
17
|
+
Commercial use of this project or the data obtained from the API is not allowed without prior permission from the author, in case of the project, or from the "Servei Meteorològic de Catalunya" in the case of the data provided by the API.
|
|
18
|
+
|
|
19
|
+
**NOTE:** Meteocat API requires to use an API_KEY, you should ask to (https://apidocs.meteocat.gencat.cat/documentacio/acces-ciutada-i-administracio/)
|
|
20
|
+
|
|
21
|
+
# Credits
|
|
22
|
+
|
|
23
|
+
This is a personal project.
|
|
24
|
+
|
|
25
|
+
**Authors:**
|
|
26
|
+
- [Figorr](https://github.com/figorr)
|
|
27
|
+
|
|
28
|
+
**Contributors:**
|
|
29
|
+
- [mcasellas](https://github.com/mcasellas) – contributed [c505f27](https://github.com/figorr/meteocat/commit/c505f27) - Improve Catalan translations
|
|
30
|
+
|
|
31
|
+
## ⚠️ Breaking changes - Upgrade to 3.0.0 or later coming from prior versions
|
|
32
|
+
|
|
33
|
+
Version **3.0.0 and later** introduces a **breaking change** in how entities are identified.
|
|
34
|
+
|
|
35
|
+
### ⚠️ What this affects
|
|
36
|
+
- This affects any update **from a version prior to 3.0.0** to **any version 3.x or later**.
|
|
37
|
+
- Entities now use **`town_id`** instead of `region_id` in their `unique_id`.
|
|
38
|
+
- This change allows multiple integration entries that share the same `region_id` but different towns.
|
|
39
|
+
|
|
40
|
+
### ✅ Recommended upgrade procedure
|
|
41
|
+
To avoid issues with duplicated or unavailable entities:
|
|
42
|
+
|
|
43
|
+
1. **Uninstall** the existing integration (v2.x).<br>
|
|
44
|
+
🔗 See [Uninstallation Guide](https://github.com/figorr/meteocat/wiki/Uninstallation) for the proper way of removing prior versions.
|
|
45
|
+
2. **Restart** Home Assistant.
|
|
46
|
+
3. **Install v3.0.0 or later** and configure the integration again.
|
|
47
|
+
|
|
48
|
+
### 🚨 If you update directly
|
|
49
|
+
If you update without uninstalling first:
|
|
50
|
+
|
|
51
|
+
- Old entities will remain as **Unavailable**.
|
|
52
|
+
- New entities will be created (sometimes with a suffix like `2`).
|
|
53
|
+
- You may need to manually **remove old entities** and update your automations, dashboards, or scripts to point to the new entities.
|
|
54
|
+
|
|
55
|
+
### 📑 Additional notes
|
|
56
|
+
|
|
57
|
+
- This change affects all entity types, including **sensors, diagnostic sensors, and alerts**.
|
|
58
|
+
- Always backup your **Home Assistant configuration** before performing major upgrades.
|
|
59
|
+
|
|
60
|
+
## Installation
|
|
61
|
+
|
|
62
|
+
#### HACS - Install using the custom repository method.
|
|
63
|
+
|
|
64
|
+
1. First of all you need to add a custom repository like [this](https://hacs.xyz/docs/faq/custom_repositories/).
|
|
65
|
+
1. Then download the integration from HACS.
|
|
66
|
+
1. Restart Home Assistant.
|
|
67
|
+
1. Go to `Settings > Devices & Services`
|
|
68
|
+
1. Click `+ Add Integration`
|
|
69
|
+
1. Search for `Meteocat` and follow the configuration instructions
|
|
70
|
+
|
|
71
|
+
#### HACS - Install from the store
|
|
72
|
+
1. Go to `HACS`
|
|
73
|
+
1. Search for `Meteocat` and add it to HACS
|
|
74
|
+
1. Restart Home Assistant
|
|
75
|
+
1. Go to `Settings > Devices & Services`
|
|
76
|
+
1. Click `+ Add Integration`
|
|
77
|
+
1. Search for `Meteocat` and follow the configuration instructions
|
|
78
|
+
|
|
79
|
+
#### Manually
|
|
80
|
+
Copy the `custom_components/meteocat` folder into the config folder.
|
|
81
|
+
|
|
82
|
+
## Configuration
|
|
83
|
+
To add a Meteocat Device, go to `Configuration > Integrations` in the UI. Then click the `+` button and from the list of integrations select Meteocat. You will then be prompted to enter your API Key.
|
|
84
|
+
|
|
85
|
+

|
|
86
|
+
|
|
87
|
+
After submitting your API Key you will either be prompted to pick a town from the list as shown below.
|
|
88
|
+
|
|
89
|
+

|
|
90
|
+
|
|
91
|
+
Once you pick the town you will be prompted to pick a station from the list. These are the nearest stations to the picked town.
|
|
92
|
+
|
|
93
|
+

|
|
94
|
+
|
|
95
|
+
Then you will be asked to set the API limits from your plan.
|
|
96
|
+
|
|
97
|
+

|
|
98
|
+
|
|
99
|
+
Then you will be asked to pick an area for the device.
|
|
100
|
+
|
|
101
|
+

|
|
102
|
+
|
|
103
|
+
If the device is added successfully it should appear as shown.
|
|
104
|
+
|
|
105
|
+

|
|
106
|
+
|
|
107
|
+
This device will then have the entities shown below. The sensors are translated to your system language (according to tranlation folder: en, es, ca). Or English by default.
|
|
108
|
+
|
|
109
|
+

|
|
110
|
+
|
|
111
|
+

|
|
112
|
+
|
|
113
|
+
## Changing Units
|
|
114
|
+
|
|
115
|
+
To change units select one of the entities and open the more info dialog and click the cog in the top right. This will bring up the settings for the entity. Then select `Unit of Measurement`, and a dropdown will appear where you can select the units you want.
|
|
116
|
+
|
|
117
|
+

|
|
118
|
+
|
|
119
|
+
## Options
|
|
120
|
+
|
|
121
|
+
Once the integration is installed, you can reconfigure some parameters without having to remove and reinstall Meteocat.
|
|
122
|
+
|
|
123
|
+
Go to:
|
|
124
|
+
`Settings > Devices & Services > Meteocat > Configure`
|
|
125
|
+
|
|
126
|
+
You will see three available options:
|
|
127
|
+
|
|
128
|
+
- **Update API Key and limits**
|
|
129
|
+
Allows you to change the API Key and update all API plan limits at the same time.
|
|
130
|
+
|
|
131
|
+
- **Update limits only**
|
|
132
|
+
Allows you to adjust only the API plan limits, keeping the same API Key.
|
|
133
|
+
|
|
134
|
+
- **Regenerate assets**
|
|
135
|
+
If for any reason some files in the `assets` folder (`towns.json`, `stations.json`, `variables.json`, `symbols.json`, or `stations_<town_id>.json`) are missing or outdated, you can regenerate them directly from the options menu.
|
|
136
|
+
> ℹ️ If the Meteocat API is not available at that moment, the integration will still start, and you can retry regeneration later.
|
|
137
|
+
|
|
138
|
+
- **Update coordinates and elevation**
|
|
139
|
+
Change the default station coordinates and elevation that were set during the first setup. So you can use your location coordinates and elevation for more accurate sun and moon data.
|
|
140
|
+
|
|
141
|
+
### Accessing the Options Menu
|
|
142
|
+
|
|
143
|
+
You can access the Options Menu in two ways, both inside the integration:
|
|
144
|
+
|
|
145
|
+
- **Setup Options**
|
|
146
|
+
|
|
147
|
+

|
|
148
|
+
|
|
149
|
+
- **System Options**
|
|
150
|
+
|
|
151
|
+

|
|
152
|
+
|
|
153
|
+
Once you are inside, you will see the following options:
|
|
154
|
+
|
|
155
|
+

|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## Uninstallation
|
|
159
|
+
|
|
160
|
+
To correctly uninstall the integration:
|
|
161
|
+
|
|
162
|
+
- If you are upgrading due to **breaking changes**, remove all configured entries from
|
|
163
|
+
**Settings > Devices & Services > Integrations**, restart Home Assistant, and reinstall the new version.
|
|
164
|
+
- If you want to **completely remove Meteocat**, after removing the entries and restarting, also uninstall the integration from **HACS > Integrations**.
|
|
165
|
+
|
|
166
|
+
👉 For detailed steps with screenshots, check the [Uninstallation Guide](https://github.com/figorr/meteocat/wiki/Uninstallation).
|
|
167
|
+
|
|
168
|
+
## Custom Meteocat Card available
|
|
169
|
+
|
|
170
|
+
Meteocat integration has its own weather card.
|
|
171
|
+
|
|
172
|
+
To install the card, please follow the instructions from its own repository, [🎫 Meteocat Card](https://github.com/figorr/meteocat-card).
|
|
173
|
+
|
|
174
|
+

|
|
175
|
+
|
|
176
|
+
# Documentation
|
|
177
|
+
|
|
178
|
+
For more detailed information about:
|
|
179
|
+
- Installation and configuration
|
|
180
|
+
- Usage examples
|
|
181
|
+
- Extra attributes in sensors
|
|
182
|
+
- Known issues and troubleshooting
|
|
183
|
+
|
|
184
|
+
please visit the [📖 Meteocat Wiki](https://github.com/figorr/meteocat/wiki).
|
|
185
|
+
|
|
186
|
+
# Contributing
|
|
187
|
+
|
|
188
|
+
1. [Check for open features/bugs](https://github.com/figorr/meteocat/issues)
|
|
189
|
+
or [initiate a discussion on one](https://github.com/figorr/meteocat/issues/new/choose).
|
|
190
|
+
2. [Fork the repository](https://github.com/figorr/meteocat/fork).
|
|
191
|
+
3. Install the dev environment: `make init`.
|
|
192
|
+
4. Enter the virtual environment: `pipenv shell`
|
|
193
|
+
5. Code your new feature or bug fix.
|
|
194
|
+
6. Write a test that covers your new functionality.
|
|
195
|
+
7. Update `README.md` with any new documentation.
|
|
196
|
+
8. Run tests and ensure 100% code coverage for your contribution: `make coverage`
|
|
197
|
+
9. Ensure you have no linting errors: `make lint`
|
|
198
|
+
10. Ensure you have typed your code correctly: `make typing`
|
|
199
|
+
11. Add yourself to `AUTHORS.md`.
|
|
200
|
+
12. Submit a pull request!
|
|
201
|
+
|
|
202
|
+
# License
|
|
203
|
+
|
|
204
|
+
[Apache-2.0](LICENSE). By providing a contribution, you agree the contribution is licensed under Apache-2.0.
|
|
205
|
+
|
|
206
|
+
# API Reference
|
|
207
|
+
|
|
208
208
|
[See the docs 📚](https://apidocs.meteocat.gencat.cat/section/informacio-general/).
|
package/conftest.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
from homeassistant.core import HomeAssistant
|
|
3
|
-
from pytest_homeassistant_custom_component.common import mock_component
|
|
4
|
-
from homeassistant.setup import async_setup_component
|
|
5
|
-
|
|
6
|
-
@pytest.fixture(autouse=True)
|
|
7
|
-
async def auto_enable_custom_integrations(hass: HomeAssistant):
|
|
8
|
-
"""Enable custom integrations."""
|
|
9
|
-
mock_component(hass, "meteocat")
|
|
10
|
-
await async_setup_component(hass, 'meteocat', {})
|
|
11
|
-
yield
|
|
1
|
+
import pytest
|
|
2
|
+
from homeassistant.core import HomeAssistant
|
|
3
|
+
from pytest_homeassistant_custom_component.common import mock_component
|
|
4
|
+
from homeassistant.setup import async_setup_component
|
|
5
|
+
|
|
6
|
+
@pytest.fixture(autouse=True)
|
|
7
|
+
async def auto_enable_custom_integrations(hass: HomeAssistant):
|
|
8
|
+
"""Enable custom integrations."""
|
|
9
|
+
mock_component(hass, "meteocat")
|
|
10
|
+
await async_setup_component(hass, 'meteocat', {})
|
|
11
|
+
yield
|