Private GIT

Skip to content
Snippets Groups Projects
Unverified Commit b9feb157 authored by Björn Augustsson's avatar Björn Augustsson Committed by GitHub
Browse files

Handle AttributeError from request_environmental_data() (#18)

parent 53dfc10c
No related branches found
No related tags found
No related merge requests found
...@@ -85,7 +85,10 @@ class DeviceWrapper: ...@@ -85,7 +85,10 @@ class DeviceWrapper:
if self.is_connected: if self.is_connected:
logging.debug( logging.debug(
'Requesting updated environmental data from %s', self.serial) 'Requesting updated environmental data from %s', self.serial)
try:
self.libdyson.request_environmental_data() self.libdyson.request_environmental_data()
except AttributeError:
logging.error('Race with a disconnect? Skipping an iteration.')
self._refresh_timer() self._refresh_timer()
else: else:
logging.debug('Device %s is disconnected.', self.serial) logging.debug('Device %s is disconnected.', self.serial)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment