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
Fix integration failed when freebox is configured in bridge mode #103221
Fix integration failed when freebox is configured in bridge mode #103221
Conversation
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.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Hey there @hacf-fr, @Quentame, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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.
Not linked to VMs access but hosts access.
Please update your comments and description accordingly.
OK thanks Co-authored-by: Quentame <polletquentin74@me.com>
OK thanks Co-authored-by: Quentame <polletquentin74@me.com>
Comments updates |
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.
You have to apply the same "try once and don't retry next" mechanism as supports_raid
and home_granted
do.
Otherwise, HA will try to update hosts everytime and will always get an error.
We better want to test if it succeed the first time to continue fetching next times.
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.
Just need to adjust the test, otherwise I'm good !
@@ -115,3 +115,21 @@ async def test_battery( | |||
assert hass.states.get("sensor.telecommande_niveau_de_batterie").state == "25" | |||
assert hass.states.get("sensor.ouverture_porte_niveau_de_batterie").state == "50" | |||
assert hass.states.get("sensor.detecteur_niveau_de_batterie").state == "75" | |||
|
|||
|
|||
async def test_get_hosts_list( |
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.
Not resolved.
Move this test to test_device_tracker.py
And you have to count number of devices linked to the router (--> router.devices
):
- 1 if in bridge mode : the router itself
- more than 1 if not
@Quentame if I add
|
@jflefebvre06 you did not understand my comment Do not count the call to the router instance but to the amount of devices generated by the function call The function call should normally be 1 at any test. My Discord ID : quentame |
Is there an example how to get the router ? |
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.
Test suggestions
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.
Should use device tracker platform for tests
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.
Nice, thanks 🥳
Breaking change
Proposed change
Allows freebox integration to work for users who have configured their router in bridge mode.
The problem is due to the fact that in bridge mode, access to the Host list is not implemented.
freebox_api.exceptions.HttpRequestError: Request failed (APIResponse: {"msg": "Erreur lors de la r\u00e9cup\u00e9ration de la liste des h\u00f4tes : Interface invalide", "success": false, "error_code": "nodev"})
Type of change
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
.To help with the load of incoming pull requests: