Mercurial > code > home > repos > homeauto
changeset 1186:732a8861a75c
defer import of w1thermsensor
Ignore-this: 9fcf8a4313599bace8315f943c145f41
darcs-hash:d7408b4bcbaea171b873de3aaf5f51e56ddcd3f9
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Fri, 28 Dec 2018 01:56:33 -0800 |
parents | 56bca87ed939 |
children | 2ceb776a5f1b |
files | service/piNode/devices.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/service/piNode/devices.py Tue Dec 18 23:56:12 2018 -0800 +++ b/service/piNode/devices.py Fri Dec 28 01:56:33 2018 -0800 @@ -18,7 +18,6 @@ import pigpio except ImportError: pigpio = None -import w1thermsensor try: import rpi_ws281x except ImportError: @@ -359,7 +358,9 @@ # deliberately written like arduinoNode's one for an easier merge. def __init__(self, *a, **kw): DeviceType.__init__(self, *a, **kw) + import w1thermsensor log.info("scan for w1 devices") + self.SensorNotReadyError = w1thermsensor.core.SensorNotReadyError self._sensors = w1thermsensor.W1ThermSensor.get_available_sensors() for s in self._sensors: # Something looks different about these ids @@ -379,7 +380,7 @@ stmts.append((sensor.uri, ROOM['temperatureF'], # see round() note in arduinoNode/devices.py Literal(round(tempF, 2)))) - except w1thermsensor.core.SensorNotReadyError as e: + except self.SensorNotReadyError as e: log.warning(e) return stmts