google-home / smart-home-java

Apache License 2.0
92 stars 47 forks source link

Separate response and homegraph states #21

Closed 2m closed 4 years ago

2m commented 4 years ago

This fixes the following error:

ERROR:: QUERY FAILED: {}
io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Request contains an invalid argument.

Homegraph ReportState does not expect to get status=SUCCESS but only device state as mentioned here: https://github.com/actions-on-google/actions-on-google-java/blob/7f3b1e2fd51e3b044380ea3c72722058ad99240f/src/main/proto/google/home/graph/v1/homegraph.proto#L132

devunwired commented 4 years ago

proppy@ PTAL, this might be affecting the Node.js sample as well.

devunwired commented 4 years ago

Thanks for your contribution! Unfortunately due to a recent platform change we needed to remove the Report State call from the QUERY handler altogether (d1850ae372068386d3db327da00f49f879d38513), so believe this change is no longer needed. Feel free to reopen if you are still having issues or have additional concerns.

proppy commented 4 years ago

See the note at the beginning of https://developers.google.com/assistant/smarthome/develop/report-state for more context about the platform change.

Following the initial SYNC for a device, the platform sends a QUERY intent that gathers the state of the device to populate Home Graph. After that point, Home Graph only stores the state that is sent with Report State.

2m commented 4 years ago

Cool! I'll try it out without the report state call. Thanks for the update!

2m commented 4 years ago

Just tested code from latest master and without this change - seems to work just fine!