lrybak / domoticz-airly

A Python plugin for Domoticz to access airly API for smog information in Poland
MIT License
10 stars 8 forks source link

Plugin will stop updating domoticz if Airly sensor is not reachable #1

Closed mstojek closed 6 years ago

mstojek commented 6 years ago

If Airly sensor connection fails plugin will never update Domoticz since we set variable self.inProgress = True and never change it to False.

Proposed fix in function OnHeartbeat around line 360: except SensorNotFoundException as snfe: self.inProgress = False Domoticz.Error(_("Sensor id (%(sensor_id)d) not exists") % {'sensorid': int(Parameters["Mode2"])}) except UnauthorizedException as ue: self.inProgress = False Domoticz.Error(("Not authorized"))

As you can see I added "self.inProgress = False" when exception is caught.

lrybak commented 6 years ago

Hello, Thanks for reporting the issue. It's fixed already in v0.2. self.inProgress is set to False in the 'finally' block