I entered the following in the driver page: {"lat": 80} and here's what's logged:
Location received {"lat": 80}
TYPE: class java.lang.String
I was expecting the variable to be a JSON object -- meaning I could reference loc.lat but as you can see it's a String. Am I missing something? I imagine I could just take in a String and convert it to JSON but was thinking the JSON_OBJECT would do that for me somehow
I believe the intent is that is what you have to do, use parseJson() to convert it to a List or Map yourself (as witnessed by the number of apps that blew up with an error related to this method when thermostat drivers that use this data type were corrected a few platform versions ago and some third-party drivers did not follow suit ).
My bad, I got it round the wrong way, you are parsing a Json string into a map. In my driver I was wanting to output the Json in a formatted string. Or maybe I am still confused... Not to worry, don't want to hijack the topic any more than I already have.
Sorry I may not have explained the question right but how is JSON_OBJECT different from TEXT in the command argument? It seems both just pass in a string