actions-on-google / actions-on-google-java

Java/Kotlin library for Actions on Google
Apache License 2.0
286 stars 39 forks source link

report state need a Integer value type #46

Closed kingskylar closed 4 years ago

kingskylar commented 4 years ago

The spectrumRgb report state need a integer value,but the Value build only has a number type and will turn to Double type. https://developers.google.com/assistant/smarthome/traits/colorsetting#device-states

below is the main error log info:

` value { struct_value { fields { key: "color" value { struct_value { fields { key: "spectrumRgb" value { number_value: 9109504.0 } } } } } } }

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Request contains an invalid argument. at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) ~[spring-webmvc-5.0.7.RELEASE.jar:5.0.7.RELEASE] Caused by: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Request contains an invalid argument. at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:233) ~[grpc-stub-1.15.1.jar:1.15.1] at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:214) ~[grpc-stub-1.15.1.jar:1.15.1] at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:139) ~[grpc-stub-1.15.1.jar:1.15.1] at com.google.home.graph.v1.HomeGraphApiServiceGrpc$HomeGraphApiServiceBlockingStub.reportStateAndNotification(HomeGraphApiServiceGrpc.java:425) ~[actions-on-google-1.8.0.jar:?] at com.google.actions.api.smarthome.SmartHomeApp.reportState(SmartHomeApp.kt:132) ~[actions-on-google-1.8.0.jar:?]`

Fleker commented 4 years ago

Can you update the key you're sending to be "spectrumRGB" as capitalized?

kingskylar commented 4 years ago

The guide noted reporting state use "spectrumRgb",i will test use "spectrumRGB". 0E4FD599-BB06-4173-B4DF-7B182DFC998F

Fleker commented 4 years ago

There is also a note a bit higher on the page.

image

kingskylar commented 4 years ago

yes,you are right,thank you.