GoToLocationCapabilityMqttHandle wants JSON, documentation says "send a string"; results in unhandledRejection SyntaxError: Unexpected token a in JSON error #960
Labels
bug
Something isn't working
Describe the bug
When attempting to send my vac to a specific location, I observe an error:
To Reproduce
This is the
action
that my Home Assistant is taking:The docs say:
Data type: string
but the code tries to parse JSON:https://github.com/Hypfer/Valetudo/blob/master/backend/lib/mqtt/capabilities/GoToLocationCapabilityMqttHandle.js#L49
Screenshots
Vacuum Model
This is a Roborock S6.
Valetudo Version
2021.05.0
/6b35e4d96bfc9f55b7bd8d51172d450a805e8351
Expected behavior
I would expect that the device navigate to the destination.
Additional context
A string is invalid JSON, so this is why the exception is thrown. The closest thing to a string that is also valid JSON would be an array with a single string in it:
["3ac1b81a-DEAD-BEEF-0123-45cff8d6897d"]
When i send that ^ payload, the command silently fails (yes, even with
TRACE
level logging). If the docs are updated to indicate that the payload should be an array with a single string, then the code can be adjusted:And that would set
id
to the string. Optionally, the code could be written such that theJSON.parse()
call is removed.The text was updated successfully, but these errors were encountered: