Skip to content
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

Reduce Freebox router Raid warning to one occurence #98740

Conversation

fthiery
Copy link
Contributor

@fthiery fthiery commented Aug 21, 2023

Proposed change

#95242 added RAID info to disks attached to Freebox routers, but fail the integration to start for people without disks or RAID (with a generic error (APIResponse: {"msg": "Erreur interne", "success": false, "error_code": "internal_error"}), its fix #97696 added try-catch with a warn, but in the update function (causing thousands of warnings to appear in the logs). It should be at init, then use a boolean or other to not warn more.

This PR sets a boolean in case of failure so that subsequent calls are not done anymore.

Models that seemingly do not support raid enumeration are

  • Freebox Pop
  • Freebox Revolution

However, i believe that this kind of model-specific handling should be done at the underlying level, and opened a corresponding discussion here: hacf-fr/freebox-api#567

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]
  • I have followed the [perfect PR recommendations][perfect-pr]
  • The code has been formatted using Black (black --fast homeassistant tests)
  • [] Tests have been added to verify that the new code works.

@home-assistant
Copy link

Hey there @hacf-fr, @Quentame, mind taking a look at this pull request as it has been labeled with an integration (freebox) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of freebox can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign freebox Removes the current integration label and assignees on the pull request, add the integration domain after the command.

@fthiery
Copy link
Contributor Author

fthiery commented Aug 21, 2023

What bothers me is that the component supposed to abstract the router differences should be the library, not the HA component: https://github.com/hacf-fr/freebox-api

I opened a discussion there: hacf-fr/freebox-api#567

@MartinHjelmare MartinHjelmare changed the title consider Freebox router does not support Raid if the first enumeration failed Fix Freebox router Raid warning Aug 21, 2023
@home-assistant home-assistant bot marked this pull request as draft August 21, 2023 09:35
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@fthiery fthiery force-pushed the freebox-skip-raid-enumeration-if-unsupported branch 2 times, most recently from b58fd40 to a2f9800 Compare August 21, 2023 10:03
@fthiery fthiery changed the title Fix Freebox router Raid warning Reduce Freebox router Raid warning to one occurence Aug 21, 2023
@fthiery fthiery force-pushed the freebox-skip-raid-enumeration-if-unsupported branch from a2f9800 to b83cc99 Compare August 21, 2023 10:16
@fthiery fthiery marked this pull request as ready for review August 21, 2023 10:20
@fthiery fthiery force-pushed the freebox-skip-raid-enumeration-if-unsupported branch from b83cc99 to 32bcae8 Compare August 21, 2023 10:20
@fthiery
Copy link
Contributor Author

fthiery commented Aug 21, 2023

I ended up following the style introduced by the method update_home_devices which is exactly the same usecase.

@MartinHjelmare
Copy link
Member

Please don't amend or squash commits after review has started to make it easier for readers to track changes. Thanks!

@fthiery fthiery force-pushed the freebox-skip-raid-enumeration-if-unsupported branch from 32bcae8 to 9a4671d Compare August 21, 2023 11:20
@fthiery fthiery force-pushed the freebox-skip-raid-enumeration-if-unsupported branch from 9a4671d to 71253e1 Compare August 21, 2023 14:30
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MartinHjelmare MartinHjelmare added this to the 2023.8.4 milestone Aug 21, 2023
@MartinHjelmare MartinHjelmare merged commit c86565b into home-assistant:dev Aug 21, 2023
18 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 22, 2023
Copy link
Member

@Quentame Quentame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit late to approve, but still: approved 🎉

Thanks @fthiery !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Freebox: Unable to enumerate raid disks WARN appears more than 10000 times since 2023.8.1
4 participants