MadPatrick / somfy

Tahoma/Conexoon plugin for IO blinds, this plugin require internet connexion and a Somfy account
GNU General Public License v3.0
15 stars 4 forks source link

Undefined name in tahoma.py #11

Closed MTijn closed 2 years ago

MTijn commented 2 years ago

First a big thanks for taking over development of the plugin, much appreciated.

I did notice an error creeping through, when running it for a while it started to complain about a undefined name.

2022-08-09 13:26:07.214 Error: Tahoma: Call to function 'onHeartbeat' failed, exception details:
2022-08-09 13:26:07.285 Error: Tahoma: Traceback (most recent call last):
2022-08-09 13:26:07.285 Error: Tahoma: File "/opt/domoticz/plugins/somfy/plugin.py", line 285, in onHeartbeat
2022-08-09 13:26:07.285 Error: Tahoma: _plugin.onHeartbeat()
2022-08-09 13:26:07.285 Error: Tahoma: File "/opt/domoticz/plugins/somfy/plugin.py", line 188, in onHeartbeat
2022-08-09 13:26:07.285 Error: Tahoma: event_list = self.tahoma.get_events()
2022-08-09 13:26:07.285 Error: Tahoma: File "/opt/domoticz/plugins/somfy/tahoma.py", line 249, in get_events
2022-08-09 13:26:07.285 Error: Tahoma: time.sleep(i ** 3)
2022-08-09 13:26:07.285 Error: Tahoma: NameError: name 'time' is not defined 

Looking at the tahoma.py file, it seems indeed that the time variable was not set, leading up to this error.

https://github.com/MadPatrick/somfy/blob/master/tahoma.py#L249 uses time, but can't find it set anywhere.

MadPatrick commented 2 years ago

Did you a time for the referesh interval ? This must be done in Domoticz on the hardware page and then click on the Somfy plugin

2022-08-09 13_56_51-Domoticz - Hardware

JanJaapKo commented 2 years ago

PR merged. Indeed the import of the time module got lost somewhere. Tnx!

MadPatrick commented 2 years ago

Updated the version number to keep track of the latest version