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

Incorrect device class assignment for entity "Gate" in Google Assistant integration #117757

Closed
Bygood91 opened this issue May 20, 2024 · 4 comments

Comments

@Bygood91
Copy link
Contributor

The problem

Description of the issue:
In the Google Assistant integration, the device class of the entity "Gate" is incorrectly assigned as "Garage". This results in improper handling of the device by Google Assistant.

Technical details:
I believe I have identified a part of the code that might be responsible for this issue:

  • File: core/homeassistant/components/google_assistant/const.py
  • Lines: 173 and 174
    image (4)

Steps to reproduce the issue:

  1. Configure an entity of type "Gate" in Home Assistant.
  2. Sync the entity with Google Assistant.
  3. Observe that Google Assistant recognizes it as a "Garage" instead of a "Gate".

The entity "Gate" should be correctly recognized by Google Assistant as a "Gate".

Current result:
The entity "Gate" is assigned as a "Garage".

Thank you for your assistance in correcting this issue.

What version of Home Assistant Core has the issue?

core-2024.5.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Google Assistant

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @home-assistant/cloud, mind taking a look at this issue 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 issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign google_assistant Removes the current integration label and assignees on the issue, 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 issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


google_assistant documentation
google_assistant source
(message by IssueLinks)

@Bygood91
Copy link
Contributor Author

Hi ,

For informations, this device type is referenced in "https://developers.home.google.com/cloud-to-cloud/guides/gate".
image

Thanks👌

@Bygood91
Copy link
Contributor Author

Bygood91 commented May 25, 2024

Hi,

I managed to find what needed to be modified in the const.py file (2 lines) so that my gate appears with the right device type in Google Assistant (Home). 😁

I am attaching the screen printouts of the 2 modifications and the result on Google Home.

Thanks in advance.

File : homeassistant/components/google_assistant/const.py

First modification:
We add this under line 85
TYPE_GATE = f"{PREFIX_TYPES}GATE"
image

Second modification :
We modify the value "TYPE_GARAGE" to "TYPE_GATE" for line 175
(cover.DOMAIN, cover.CoverDeviceClass.GATE): TYPE_GATE,
image

Here is the result on Google Home.
Perfect icon and device type (Gate means portal in French) :
image
image

@Bygood91
Copy link
Contributor Author

I sent a pull request :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants