From e9d79cca6617da0ecbe9aeab122e08237d9244aa Mon Sep 17 00:00:00 2001 From: zewelor Date: Mon, 28 Jan 2019 21:35:32 +0100 Subject: [PATCH] Handle bluetooth connection exception --- workers/thermostat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workers/thermostat.py b/workers/thermostat.py index 942bccb..8fde016 100644 --- a/workers/thermostat.py +++ b/workers/thermostat.py @@ -63,11 +63,13 @@ class ThermostatWorker(BaseWorker): self._modes_mapper = self.ModesMapper() def status_update(self): + from bluepy import btle + ret = [] for name, thermostat in self.devices.items(): try: ret += self.update_device_state(name, thermostat) - except RuntimeError: + except (RuntimeError, btle.BTLEException): pass return ret