- Code: Select all
data = json.loads(reply)
return data
The problem is that in something like one time out of four or five I get an error along the lines of:
Traceback (most recent call last):
File "plugin.py", line 60, in runConcurrentThread
File "plugin.py", line 99, in updateReadings
File "plugin.py", line 143, in getNeoData
File "/Library/Application Support/Perceptive Automation/Indigo 6/IndigoPluginHost.app/Contents/PlugIns/simplejson/__init__.py", line 307, in loads
File "/Library/Application Support/Perceptive Automation/Indigo 6/IndigoPluginHost.app/Contents/PlugIns/simplejson/decoder.py", line 338, in decode
ValueError: Extra data: line 2 column 1 - line 2 column 2 (char 2832 - 2833)
The strange part is that, since the thermostat data doesn't change frequently, one reply will be decoded correctly while the next reply (identical to the last in every respect) produces an error. I've attached text file of a typical reply received from the hub. This reply passed, failed and passed again on successive polls despite being unchanged.
Any thoughts would be appreciated!