-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
Correct expose_by_default interaction with expose_domains #17745
Conversation
Based on the documentation here: https://www.home-assistant.io/components/google_assistant/#expose_by_default it seems that expose_by_default means all devices should be exposed unless explicitly set to false, and that regardless if this is set domains in exposed_domains should be exposed.
Hi @glentakahashi, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
Unclear to me whether this is actually needed or not, but regardless it should be targeted at the |
It's an |
That doesn't make sense to me. The documentation for expose_by_default says:
I'm understanding this as, an entity will be exposed if:
Right now (using and) the logic is coded to expose things if:
So which one is right here? If the docs are wrong I can make a PR to fix those, but in my opinion the docs behavior is the more intuitive one and this PR will adjust the code to work like that. |
If a domain is not in expose_by_default, it's not supported. So no need to route entities through the GA flow and then make it generate a ton of warnings. |
@balloob I still believe either the documentation or code needs changing here. The documentation doesn't match up with how the code works. Take this example. Let's say I have three devices in three domains, one of which is unsupported: Devices:
Current behavior:
LIGHT, SWITCH are exposed
only LIGHT is exposed
no devices are exposed
only SWITCH is exposed Using OR behavior:
LIGHT, SWITCH are exposed
LIGHT, SWITCH are exposed
LIGHT is exposed
LIGHT, SWITCH are exposed To me, use cases #3 and #4 are what seem wrong in the current behavior. I see someone updated the documentation today to make it clear this is how it works (home-assistant/home-assistant.io#7292) but I think the config can still be improved. In my opinion, if not the OR behavior above there are a few other alternatives:
Lastly, currently the code itself doesn't protect against unsupported domains in GA either. The only line of code that uses the filtered set of domains is in the default configuration above. To actually support this, I think instead in const.py there should be a list of Sorry for the long post, but just want to clear this up. |
I'm sorry, looks like you're right. |
Now that home-assistant/core#17745 has been merged, the original documentation is back to being correct so the docs changes should be reverted once the version with home-assistant/core#17745 has been released.
* Revert #7292 Now that home-assistant/core#17745 has been merged, the original documentation is back to being correct so the docs changes should be reverted once the version with home-assistant/core#17745 has been released. * Add missing quote
we need to revert this change because it's causing issues #18856 |
oh no! Sorry about the issues that this is causing. Would you be okay with me putting out another PR with better functionality + testing after you revert? |
If we do so, it should be done as a non breaking change. |
Home Assistant release with the issue:
0.80.3
Last working Home Assistant release (if known):
Operating environment (Hass.io/Docker/Windows/etc.):
Component/platform:
https://www.home-assistant.io/components/google_assistant/#expose_by_default
Description of problem:
Based on the documentation here: https://www.home-assistant.io/components/google_assistant/#expose_by_default it seems that expose_by_default means all devices should be exposed unless explicitly set to false, and that regardless if this is set domains in exposed_domains should be exposed.
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Traceback (if applicable):
Additional information: