core icon indicating copy to clipboard operation
core copied to clipboard

Allow exposing entities not in the entity registry to assistants

Open emontnemery opened this issue 2 years ago • 11 comments

Proposed change

Allow exposing entities not in the entity registry to assistants

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

To help with the load of incoming pull requests:

emontnemery avatar May 02 '23 13:05 emontnemery

Hey there @home-assistant/cloud, mind taking a look at this pull request as it has been labeled with an integration (google_assistant) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of google_assistant 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 google_assistant Removes the current integration label and assignees on the pull request, add the integration domain after the command.

home-assistant[bot] avatar May 02 '23 13:05 home-assistant[bot]

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (homeassistant) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homeassistant 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 homeassistant Removes the current integration label and assignees on the pull request, add the integration domain after the command.

home-assistant[bot] avatar May 02 '23 13:05 home-assistant[bot]

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

Code owner commands

Code owners of cloud 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 cloud Removes the current integration label and assignees on the pull request, add the integration domain after the command.

home-assistant[bot] avatar May 02 '23 13:05 home-assistant[bot]

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (switch_as_x) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of switch_as_x 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 switch_as_x Removes the current integration label and assignees on the pull request, add the integration domain after the command.

home-assistant[bot] avatar May 02 '23 13:05 home-assistant[bot]

Hey there @home-assistant/core, @synesthesiam, mind taking a look at this pull request as it has been labeled with an integration (conversation) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of conversation 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 conversation Removes the current integration label and assignees on the pull request, add the integration domain after the command.

home-assistant[bot] avatar May 02 '23 13:05 home-assistant[bot]

Hey there @home-assistant/cloud, @ochlocracy, @jbouwh, mind taking a look at this pull request as it has been labeled with an integration (alexa) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of alexa 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 alexa Removes the current integration label and assignees on the pull request, add the integration domain after the command.

home-assistant[bot] avatar May 02 '23 13:05 home-assistant[bot]

If all assistants are marked as "not exposed", like this one:

image

Should it be removed from the storage collection instead?

The frontend doesn't show this one anymore at this point. The exact same happens when removing the entity from the frontend.

(can be a later / smaller cleanup thought)

frenck avatar May 02 '23 16:05 frenck

Getting:

home-assistant/core/homeassistant/components/google_assistant/report_state.py:66: RuntimeWarning: coroutine 'CloudGoogleConfig.should_expose' was never awaited
  if not google_config.should_expose(new_state):
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

bramkragten avatar May 02 '23 17:05 bramkragten

If all assistants are marked as "not exposed", like this one:

image

Should it be removed from the storage collection instead?

The frontend doesn't show this one anymore at this point. The exact same happens when removing the entity from the frontend.

(can be a later / smaller cleanup thought)

No, in case the user has enabled automatic expose of supported entities, the choice to not expose an entity needs to be stored.

emontnemery avatar May 02 '23 17:05 emontnemery

No, in case the user has enabled automatic expose of supported entities, the choice to not expose an entity needs to be stored.

In that case, we have a frontend issue @bramkragten, if the case described above is true, it should also show up as such in the UI? Right now, there is no difference in the UI between the choice made to automatic expose or explicitly disabled expose in that case.

frenck avatar May 02 '23 17:05 frenck

No, in case the user has enabled automatic expose of supported entities, the choice to not expose an entity needs to be stored.

In that case, we have a frontend issue @bramkragten, if the case described above is true, it should also show up as such in the UI? Right now, there is no difference in the UI between the choice made to automatic expose or explicitly disabled expose in that case.

The UI shows exposed entities, and the list shows the exposed entities, what's the problem?

emontnemery avatar May 02 '23 17:05 emontnemery

So I can now expose mt LimitlessLED lights (need to use the bottom right + Expose Entities option and they are there but image And the message is not supported by this assistant

DavidFW1960 avatar May 02 '23 23:05 DavidFW1960