-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Add reboot button to velux gateway device #155547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
|
Hey there @Julius2342, @DeerMaximum, @pawlizio, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
draft until #155434 is merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a button entity to the Velux integration for rebooting the KLF 200 gateway and refactors the integration's data model to properly support device hierarchy. The main changes include introducing a VeluxData dataclass to store both the PyVLX instance and gateway device identifier, creating the gateway as a device in the device registry, and establishing proper device relationships (via_device) between child devices and the gateway.
Key changes:
- Added button platform with gateway reboot functionality
- Introduced
VeluxDatadataclass to wrap runtime data, replacing direct PyVLX storage - Created gateway device in device registry with proper metadata and version information
- Updated all platform files to use new runtime data structure and pass full config_entry instead of just entry_id
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/velux/__init__.py |
Introduces VeluxData dataclass, creates gateway device in registry, updates runtime_data structure |
homeassistant/components/velux/button.py |
Adds new button entity for gateway reboot with proper error handling |
homeassistant/components/velux/const.py |
Adds Platform.BUTTON to PLATFORMS list |
homeassistant/components/velux/entity.py |
Updates VeluxEntity to accept full config_entry and set via_device for device hierarchy |
homeassistant/components/velux/binary_sensor.py |
Updates to use new runtime_data structure and config_entry parameter |
homeassistant/components/velux/cover.py |
Updates to use new runtime_data structure and config_entry parameter |
homeassistant/components/velux/light.py |
Updates to use new runtime_data structure and config_entry parameter |
homeassistant/components/velux/scene.py |
Updates to use new runtime_data structure |
homeassistant/components/velux/strings.json |
Adds button entity translation and reboot_failed exception message, removes period from service description |
tests/components/velux/conftest.py |
Adds setup_integration fixture for cleaner test setup |
tests/components/velux/test_button.py |
Adds comprehensive tests for button entity setup and behavior |
tests/components/velux/test_binary_sensor.py |
Adds test verification for via_device relationship to gateway |
Comments suppressed due to low confidence (1)
homeassistant/components/velux/init.py:66
- The
async_reboot_gatewayservice handler is missing a docstring. According to the coding guidelines, all methods and functions require docstrings explaining their purpose.
async def async_reboot_gateway(service_call: ServiceCall) -> None:
await pyvlx.reboot_gateway()
| self._attr_device_info = { | ||
| "identifiers": {config_entry.runtime_data.gateway_device_id} | ||
| } |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
device_info should use the DeviceInfo class from homeassistant.helpers.device_registry instead of a plain dictionary for better type safety and consistency with the rest of the codebase.
Co-authored-by: Copilot <[email protected]>
Breaking change
Proposed change
This PR adds a reboot button to the KLF 200 gateway device. This allows us to deprecate and eventually remove the
velux.reboot_gatewayservice, making it more convenient for users to reboot their gateway (this was suggested in #155207 (comment) and sounds like a good idea).The PR depends on #155434 which introduces the gateway as its own device, it it followed up by #155549 (adds the service deprecation issue).
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: