Refactor Velux integration#42773
Refactor Velux integration#42773pawlizio wants to merge 13 commits intohome-assistant:devfrom pawlizio:Velux2
Conversation
|
Hey there @Julius2342, mind taking a look at this pull request as its been labeled with an integration ( |
|
Two quick general comments:
|
Added referenced and corrected the Type of Change description, YAML to ConfigEntry was already included, so no breaking change. |
epenet
left a comment
There was a problem hiding this comment.
I also suggest that you split this into 3 PR?
- one for the config flow (this will most likely take longest to review)
- one for adding tilt functionnality
- one for reboot gateway
Also, config_flow requires 100% test coverage so you will need to update .coveragerc with the list of files, and build some actual tests for the config_flow:
homeassistant/components/velux/*
homeassistant/components/velux/cover.py
homeassistant/components/velux/scene.py
Note: I'm just a contributor not an official reviewer
| { | ||
| "config": { | ||
| "abort": { | ||
| "already_configured_device": "[%key:common::config_flow::error::already_configured_device%]", |
There was a problem hiding this comment.
The translation files (en.json) should have the strings in plain text - only the strings.json should have the translation keys, also for easy of review I suggest that the order of the strings matches between the en.json and strings.json
| "already_configured_device": "[%key:common::config_flow::error::already_configured_device%]", | |
| "already_configured": "The device has already been configured.", |
There was a problem hiding this comment.
I updated the translation file by using python3 -m script.translations develop. The order is changed automatically.
|
Ref #42895 |
|
@pawlizio did you see my note about test coverage? It is compulsory to have tests which cover the whole of the config_flow and until you have that the config_flow will never get merged into the core. |
|
@epenet: Yes I saw, but not sure when I'll find the time to learn how to write that unit tests and finally to do it. I'm not a professional software developer, so it will take me some time which I do not have now. For the moment I'm fine with my custom component
|
@mtdcr The reboot function is already included in this pull request: core/homeassistant/components/velux/__init__.py Lines 45 to 48 in a81e9fe So if this would be integrated first, #43198 should be closed. If #43198 will be merged first it will cause a conflict which needs to be resolved. Can this be solved by a rebase? I created #43198 because I assume such small pull request will be integrated much faster and I'm not sure if this one will ever be merged due to missing unit tests. |
Yes, that's what I meant. Rebasing will probably cause a conflict, which you will have to solve manually, but the result will be a PR without the reboot part. If you'll face difficulties, I can try to assist. Just ping me by mail then (obi at saftware dot de). The same procedure should be followed when splitting out tilt functionality. In the meantime, you can mark this PR as work in progress by prefixing the title with
I think I'll be able to help with the unit tests later this year. I'm interested in the conversion to config flow, because it allows to start Home Assistant with the Velux gateway being offline (or still being busy rebooting). |
|
Not stale 😬 |
|
This is the one that has been automatically generated https://github.com/home-assistant/core/blob/dev/script/scaffold/templates/config_flow/tests/test_config_flow.py Please use that as a basis for your tests. |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
🥷 |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
I would still very much appreciate seeing this PR in HA |
|
Same here |
|
To not just +1 this, I am happy to financially contribute to the person implementing this, either via GitHub sponsorship or open collective. If more people follow, there should be enough incentive for someone to pick this up. |
|
Side note: I have been using this PR for some months now, without any issues. How can we support the process? |
Do you still need to reboot the gateway? On boot or on restart? |
|
Actually I have 3 automations that restart the gateway:
To clarify my statement: To me this PR has introduced no new issues but improved the experience in HA |
|
Can you post those automations? |
|
Here you go. velux_reboot_and_reconnect_at_night.txt |
|
For me it is always unpredictable if the Velux gateway is available after a restart of HA. Is there a reason why the pull request does not get merged? |
|
There seems to be an issue when pyvlx disconnects before disabling the house monitor. But I believe these are issues that should be discussed over at pyvlx, not here in the PR |
|
@pawlizio I just saw that you have deleted the branch, could you kindly tell us if you are still on to this? |
strange, i cant download those 3 files? |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Proposed change
Config Flow added for Velux component
Tilt functionality added for Velux cover
Workaround for #34844 by providing a reboot_gateway service
Type of change
Example entry for
configuration.yaml:Additional information
Checklist
black --fast 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..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: