IndigoDomotics / indigo-ecobee-plugin

Plugin for Indigo home automation software to support Ecobee thermostats and remote sensors
1 stars 1 forks source link

NoneType not iterable #7

Closed rapamatic closed 6 years ago

rapamatic commented 6 years ago

I think this is the same error in the indigo forums, but I just got it this morning and wanted to post it here. I can confirm that it re-authenticates correctly, after manually restarting the plugin.

Aug 8, 2018, 8:14:31 AM
   Ecobee                          Error connecting to Ecobee.  Possible connectivity outage.
   Ecobee Error                    Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 163, in runConcurrentThread
  File "plugin.py", line 319, in updateAllDevices
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/ecobee_devices.py", line 159, in updateServer
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Ecobee.indigoPlugin/Contents/Server Plugin/ecobee_devices.py", line 56, in _get_thermostat_json
TypeError: 'NoneType' object is not iterable

   Ecobee Error                    plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
FlyingDiver commented 6 years ago

Thanks. I'll see what I can do to suppress that error.

rapamatic commented 6 years ago

Also, the plugin seemed to hang after this error, not even trying to re-authenticate or throwing errors (turns out this happened before, and I didn't catch it until my error-checking script noticed that the devices hadn't been updated in a while). Maybe it makes sense to have a periodic action to restart the plugin to get around temporary errors like this (this would be something done on the indigo server, not the plugin)

FlyingDiver commented 6 years ago

That shouldn't be necessary if I can catch all the exceptions. You could certainly do so as a work-around until the plugin is fixed.

This is some of the most confusing code I've ever worked with. Sigh.

rapamatic commented 6 years ago

Yeah, the code for this plugin is pretty crazy. I've tried to clean it up over the years, but I am purely a hobbyist programmer, and I quickly got in over my head.

FlyingDiver commented 6 years ago

I think I've got a fix for that issue implemented. Running it on my system now. But it's hard to test because I can't create the error condition on-demand.

rapamatic commented 6 years ago

I'd be happy to test... I seem to get that error once or twice a day

FlyingDiver commented 6 years ago

Try https://github.com/IndigoDomotics/indigo-ecobee-plugin/releases/tag/1.2.5

rapamatic commented 6 years ago

Alright, I've got it running now, I'll report if I see anything.