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

Fix type stub for async_unsubscribe_topics #130864

Closed
wants to merge 1 commit into from

Conversation

TurnrDev
Copy link

@TurnrDev TurnrDev commented Nov 18, 2024

Breaking change

Proposed change

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 fixes an issue introduced in #118092 (9be829ba) where async_unsubscribe_topics became a partial for async_prepare_subscribe_topics, but async_prepare_subscribe_topics expects new_state not sub_state - a typing stub was added but was not updated to reflect the new name for the keyword argument. This meant that anything that used async_unsubscribe_topics with keyword arguments has been broken since 2024.6.0b0 - this doesn't fix that, but instead adjusts the stub so people can at least know it's different.

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 @emontnemery, @jbouwh, @bdraco, mind taking a look at this pull request as it has been labeled with an integration (mqtt) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of mqtt 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 mqtt 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.

@jbouwh
Copy link
Contributor

jbouwh commented Nov 18, 2024

I suggest we correct the signature for async_prepare_subscribe_topics

@jbouwh jbouwh mentioned this pull request Nov 18, 2024
19 tasks
@TurnrDev
Copy link
Author

But things use async_prepare_subscribe_topics too, also by keyword argument

@jbouwh
Copy link
Contributor

jbouwh commented Nov 18, 2024

But things use async_prepare_subscribe_topics too, also by keyword argument

#130866

May be: But the consequent name is sub_state. MQTT used it as a positional argument does and does not use the parameter as a keyword argument.

If you known of certain integrations that would break, then we could contact the maintainers. I think changing to new_state will have a higher breaking chance then switching back back to sub_state. In fact the current subscription state is input. The supplied topics will determine the new subscription state.

@TurnrDev
Copy link
Author

Cool, I am happy to search github and fix any broken third party integrations :)

@jbouwh
Copy link
Contributor

jbouwh commented Nov 18, 2024

Cool, I am happy to search github and fix any broken third party integrations :)

I think #130866 should take away the confusion, do you agree?

@TurnrDev
Copy link
Author

It sure can! I've left a question on the PR

@TurnrDev
Copy link
Author

Cool, I'm happy for that. I'll close this PR and send out some PRs to integrations which I know use async_unsubscribe_topics or async_prepare_subscribe_topics

@TurnrDev TurnrDev closed this Nov 18, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2024
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.

4 participants