You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add server choice to enum generation scripts and improve CozyTouch enums (#1965)
This pull request adds support for new device types and protocols, and
enhances the `utils/generate_enums.py` script by making the Overkiz
server configurable via a command-line argument. The main changes
include new enum values for Sonos protocol and Swimming Pool Roller
Shutter, as well as refactoring the enum generation functions to accept
a server parameter.
**Support for new device types and protocols:**
* Added `SONOS` to the `Protocol` enum in `pyoverkiz/enums/protocol.py`,
enabling support for Sonos Cloud Protocol.
* Added `SWIMMING_POOL_ROLLER_SHUTTER` to the `UIWidget` enum in
`pyoverkiz/enums/ui.py` and to the additional UI widgets in
`utils/generate_enums.py`, supporting this device type.
[[1]](diffhunk://#diff-368d6a95e10b422ae141b6d3169398def418a225f93d9077d460d25c0ee84c2dR404)
[[2]](diffhunk://#diff-19b8541931ee689b317ebeae0e939ee362e28975b186431fbbbdf93abf1ad1a3R37-R50)
* Added a comment for `MODBUSLINK` in the `ADDITIONAL_PROTOCOLS` list
for clarity.
**Enhancements to the enum generation script:**
* Refactored `utils/generate_enums.py` so that `generate_protocol_enum`,
`generate_ui_enums`, `generate_ui_profiles`, and `generate_all` accept a
`server` argument, allowing the Overkiz server to be specified at
runtime.
[[1]](diffhunk://#diff-19b8541931ee689b317ebeae0e939ee362e28975b186431fbbbdf93abf1ad1a3R37-R50)
[[2]](diffhunk://#diff-19b8541931ee689b317ebeae0e939ee362e28975b186431fbbbdf93abf1ad1a3L116-R127)
[[3]](diffhunk://#diff-19b8541931ee689b317ebeae0e939ee362e28975b186431fbbbdf93abf1ad1a3L244-R255)
[[4]](diffhunk://#diff-19b8541931ee689b317ebeae0e939ee362e28975b186431fbbbdf93abf1ad1a3L683-R718)
* Added command-line argument parsing with argparse, enabling users to
select the Overkiz server via the `--server` flag.
[[1]](diffhunk://#diff-19b8541931ee689b317ebeae0e939ee362e28975b186431fbbbdf93abf1ad1a3R7)
[[2]](diffhunk://#diff-19b8541931ee689b317ebeae0e939ee362e28975b186431fbbbdf93abf1ad1a3L683-R718)
Copy file name to clipboardExpand all lines: docs/contribute.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,37 @@ uv run pytest
36
36
uv run prek run --all-files
37
37
```
38
38
39
+
## Enum generation
40
+
41
+
Several enum files in `pyoverkiz/enums/` are **auto-generated** — do not edit them manually. The generator script (`utils/generate_enums.py`) fetches reference data from the Overkiz API and merges it with commands/state values found in local fixture files.
OVERKIZ_USERNAME="your@email.com" OVERKIZ_PASSWORD="your-password" uv run utils/generate_enums.py
51
+
```
52
+
53
+
By default the script connects to `somfy_europe`. Pass `--server` to use a different one (e.g. `atlantic_cozytouch`, `thermor_cozytouch`):
54
+
55
+
```bash
56
+
uv run utils/generate_enums.py --server atlantic_cozytouch
57
+
```
58
+
59
+
The generated files are automatically formatted with `ruff`.
60
+
61
+
Some protocols and widgets only exist on specific servers. These are hardcoded at the top of the script (`ADDITIONAL_PROTOCOLS`, `ADDITIONAL_WIDGETS`) and merged in automatically.
0 commit comments