From 2014e42e4e32f11af0908efb2bc1d1a67cac1f5b Mon Sep 17 00:00:00 2001 From: ChristianKuehnel Date: Fri, 9 Feb 2018 21:31:49 +0100 Subject: [PATCH] miflora - fix for exception handling bug (#12149) * updated to development branch of miflora * updated requirements_all.txt * upgraded to version 0.3 * updated requirements_all.txt --- homeassistant/components/sensor/miflora.py | 6 +++++- requirements_all.txt | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sensor/miflora.py b/homeassistant/components/sensor/miflora.py index 56f8c3cfe4739..ec68588f24125 100644 --- a/homeassistant/components/sensor/miflora.py +++ b/homeassistant/components/sensor/miflora.py @@ -16,7 +16,7 @@ ) -REQUIREMENTS = ['miflora==0.2.0'] +REQUIREMENTS = ['miflora==0.3.0'] _LOGGER = logging.getLogger(__name__) @@ -138,12 +138,16 @@ def update(self): This uses a rolling median over 3 values to filter out outliers. """ + from miflora.backends import BluetoothBackendException try: _LOGGER.debug("Polling data for %s", self.name) data = self.poller.parameter_value(self.parameter) except IOError as ioerr: _LOGGER.info("Polling error %s", ioerr) return + except BluetoothBackendException as bterror: + _LOGGER.info("Polling error %s", bterror) + return if data is not None: _LOGGER.debug("%s = %s", self.name, data) diff --git a/requirements_all.txt b/requirements_all.txt index 4c8f0f50498e0..8766502b0eb93 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -488,7 +488,7 @@ messagebird==1.2.0 mficlient==0.3.0 # homeassistant.components.sensor.miflora -miflora==0.2.0 +miflora==0.3.0 # homeassistant.components.upnp miniupnpc==2.0.2