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

Add example how to remove config entry from device #2165

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mib1185
Copy link
Contributor

@mib1185 mib1185 commented May 8, 2024

Proposed change

This adds an example how to remove a config entry from a device registry entry.

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Removed stale or deprecated documentation

Additional information

  • This PR fixes or closes issue: fixes #
  • Link to relevant existing code or pull request:

# do what ever you need to do before

device_reg = dr.async_get(self.hass)
device_reg.async_update_device(
Copy link
Member

Choose a reason for hiding this comment

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

Missing return I think


device_reg = dr.async_get(self.hass)
device_reg.async_update_device(
device_entry.id, remove_config_entry_id=config_entry.entry_id
Copy link
Member

Choose a reason for hiding this comment

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

This is done by the helper if we return True so the integration shouldn't do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahhh ... wasn't aware of this when reading the docs :+1 i'll check if some improvements should be done, so it becomes more clear

@home-assistant
Copy link

home-assistant bot commented May 8, 2024

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 May 8, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants