8000 Add WS API for removing a config entry from a device by emontnemery · Pull Request #66188 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add WS API for removing a config entry from a device #66188

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

Merged
merged 11 commits into from
Feb 21, 2022

Conversation

emontnemery
Copy link
Contributor
@emontnemery emontnemery commented Feb 9, 2022

Proposed change

Add WS API for removing a config entry from a device

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)
  • 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
  • The code has been formatted using Black (black --fast 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.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

8000

@@ -388,6 +412,7 @@ def entry_json(entry: config_entries.ConfigEntry) -> dict:
"source": entry.source,
"state": entry.state.value,
"supports_options": supports_options,
"supports_remove_device": entry.supports_remove_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.

We may not want to include this in all responses, we should maybe do an entry_json_extended with all flags.

Copy link
Member

Choose a reason for hiding this comment

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

Why not always include it?

Copy link
Contributor Author
@emontnemery emontnemery Feb 9, 2022

Choose a reason for hiding this comment

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

@bramkragten suggested it adds unwanted overhead to keep adding flags to the responses, many of which are only used in some special cases by the frontend. In this case, we only need to know this on the device screen.

Copy link
Member

Choose a reason for hiding this comment

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

Ok.

Copy link
Member

Choose a reason for hiding this comment

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

Device Registry is always kept in memory when HA is running. We should probably propose a slim version and use that in many places in the UI.

@MartinHjelmare
Copy link
Member

Looks good! Before we merge here we should have a frontend PR that is approved so we know that the frontend has what it needs.

@emontnemery
Copy link
Contributor Author

Frontend PR: home-assistant/frontend#11716

@MartinHjelmare
Copy link
Member

We should also document the new integration interface in the dev docs somewhere. Probably on the device registry page and perhaps at least a link somewhere in building an integration?

@emontnemery
Copy link
Contributor Author

Documentation PR: home-assistant/developers.home-assistant#1215

perhaps at least a link somewhere in building an integration

That sounds good, not sure where to add the link though?
We should probably list up other optional features such as diagnostics in the same place?

@MartinHjelmare
Copy link
Member
MartinHjelmare commented Feb 18, 2022

Yeah, maybe add a new page "Extra Features" under "Building Integrations"?

Going off topic: I think that our split between the top level headers Architecture and Core are confusing. Many of the topic details described under Architecture are specific to Core. I'd like to move these details under Core and have a more comprehensive walk through there for how to build an integration. Only keep the broader picture under Architecture.

@MartinHjelmare MartinHjelmare marked this pull request as draft February 18, 2022 10:53
@MartinHjelmare
Copy link
Member

Merge as soon as frontend PR is ready.

@bramkragten
Copy link
Member

Frontend PR done

@MartinHjelmare MartinHjelmare marked this pull request as ready for review February 21, 2022 09:11
@MartinHjelmare MartinHjelmare merged commit c496748 into dev Feb 21, 2022
@MartinHjelmare MartinHjelmare deleted the config_entry_remove_from_device branch February 21, 2022 09:11
@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2022
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.

5 participants
0