8000 Record current IQS state for AVM FRITZ!SmartHome by mib1185 · Pull Request #131363 · home-assistant/core · GitHub
[go: up one dir, main page]

Skip to content

Record current IQS state for AVM FRITZ!SmartHome #131363

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

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

mib1185
Copy link
Contributor
@mib1185 mib1185 commented Nov 23, 2024

Proposed change

SSIA

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link

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

Code owner commands

Code owners of fritzbox 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 fritzbox Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@epenet
Copy link
Contributor
epenet commented Nov 23, 2024

Note: hassfest failure is not unrelated...

@epenet epenet marked this pull request as draft November 23, 2024 14:35
@mib1185
Copy link
Contributor Author
mib1185 commented Nov 23, 2024

interesting - didn't get this hassfest error in my dev-container 🤔

@mib1185
Copy link
Contributor Author
mib1185 commented Nov 23, 2024

CI error ist fixed - but still keep it as draft, since there are some small docs improvements pending, which were already considered for this.

@mib1185 mib1185 marked this pull request as ready for review November 23, 2024 16:19
@mib1185 mib1185 requested a review from a team as a code owner November 23, 2024 16:19
dynamic-devices: done
entity-category: done
entity-device-class: done
entity-disabled-by-default: done
Copy link
Member

Choose a reason for hiding this comment

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

nothing is though, double check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean set it to exempt because nothing is disabled by default?

@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.

@home-assistant home-assistant bot marked this pull request as draft November 26, 2024 00:39
@mib1185 mib1185 changed the title Add quality scale to AVM FRITZ!SmartHome Record current IQS state for AVM FRITZ!SmartHome Nov 26, 2024
Copy link
Member
@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

Left a full review of the integration. Some are opinionated comments and not a blocker. But let's set everything to todo that still has to be done and get this merged so we can improve from there

comment: only set for sensors, yet
runtime-data: done
test-before-configure: done
test-before-setup: done
Copy link
Member

Choose a reason for hiding this comment

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

So with the coordinator, would it make sense to refactor to use _async_setup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have an own async_setup in the coordinator, as we need to do a first data fetch and afterwards run the internal cleanup - this flow wouldn't be possible when using the _asnyc_setup as it is called at the beginning of async_config_entry_first_refresh, those can't contain any actions which needs already fetched data

runtime-data: done
test-before-configure: done
test-before-setup: done
unique-config-entry: done
Copy link
Member

Choose a reason for hiding this comment

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

To verify, users can add the same device twice with 2 accounts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, only one config entry per device

test-coverage: done

# Gold
devices: done
Copy link
Member

Choose a reason for hiding this comment

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

What are those template devices in button.py? Should we link them to the main device with via_device?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these templates are scripts defined in the fritzbox itself and with the button entities you can trigger/start them. so they aren't necessarily linked to a single device

appropriate-polling: done
brands: done
common-modules: done
config-flow-test-coverage: done
Copy link
Member

Choose a reason for hiding this comment

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

Can we finish test_user_auth_failed and test_user_not_succesful?

Copy link
Member

Choose a reason for hiding this comment

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

Also test_ssdp_auth_failed and test_ssdp_not_successful?

appropriate-polling: done
brands: done
common-modules: done
config-flow-test-coverage: done
Copy link
Member

Choose a reason for hiding this comment

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

test_user_already_configured would be nicer if we added a mock config entry instead of doing the flow twice

appropriate-polling: done
brands: done
common-modules: done
config-flow-test-coverage: done
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way we can prevent a reconfigure happening to a different device? Comparing the device list or something?

appropriate-polling: done
brands: done
common-modules: done
config-flow-test-coverage: done
Copy link
Member

Choose a reason for hiding this comment

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

We should avoid having if statements in the test_ssdp tests

status: todo
comment: not set at the moment, we use a coordinator
reauthentication-flow: done
test-coverage: done
Copy link
Member

Choose a reason for hiding this comment

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

I personally find that the test_coordinator.py tests are more test_init.py tests

@epenet epenet mentioned this pull request Dec 17, 2024
19 tasks

This comment was marked as outdated.

@github-actions github-actions bot added the stale label Feb 15, 2025
@mib1185 mib1185 removed the stale label Feb 16, 2025

This comment was marked as outdated.

@github-actions github-actions bot added the stale label Apr 17, 2025
@mib1185
Copy link
Contributor Author
mib1185 commented Apr 17, 2025

Definitely not stale 😬

@github-actions github-actions bot removed the stale label Apr 17, 2025
@mib1185 mib1185 marked this pull request as ready for review April 17, 2025 17:33
@home-assistant home-assistant bot requested a review from joostlek April 17, 2025 17:33
entity-translations: done
exception-translations: done
icon-translations: done
reconfiguration-flow: done
Copy link
Contributor

Choose a reason for hiding this comment

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

While you have a reconfigure flow in fritzbox, it doesn't allow to reconfigure the username and password. Somebody needs to wait for the reauthentication flow to kick in or delete and reconfigure the config entry once again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the reconfiguration flow is not intended to update credentials, that's the intention for the reauth flow

Copy link
Contributor

Choose a reason for hiding this comment

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

Currently the documentation mentions that it should not be used for reauthentication, but the quality scale actually says it should be included. Something needs to be changed to make it clearer and while it's being looked in what, I guess we're both right.

Copy link
Contributor Author
@mib1185 mib1185 May 29, 2025

Choose a reason for hiding this comment

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

The IQS rule about the reconfiguration says, that an integration should ideally inform the user, that a re-authentication is needed - this is done by the re-auth-flow. Only when we can't detect wrong credentials, then we need to provide to change them via the reconfiguration flow

Copy link
Contributor
@silamon silamon left a comment

Choose a reason for hiding this comment

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

There are still a few open questions above in the pull request, review can continue and probably merge can happen when these are resolved.

@home-assistant home-assistant bot marked this pull request as draft May 29, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0