Skip to content

Commit

Permalink
miflora - fix for exception handling bug (#12149)
Browse files Browse the repository at this point in the history
* updated to development branch of miflora

* updated requirements_all.txt

* upgraded to version 0.3

* updated requirements_all.txt
  • Loading branch information
ChristianKuehnel authored and Danielhiversen committed Feb 9, 2018
1 parent 2ae0c56 commit 2014e42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion homeassistant/components/sensor/miflora.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)


REQUIREMENTS = ['miflora==0.2.0']
REQUIREMENTS = ['miflora==0.3.0']

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2014e42

Please sign in to comment.