Merge pull request #50 from google/uael/command-timeout

device: raise a `CommandTimeoutError` error on command timeout
This commit is contained in:
Gilles Boccon-Gibod
2022-10-23 20:49:06 -07:00
committed by GitHub
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -91,6 +91,10 @@ class TimeoutError(Exception):
""" Timeout Error """
class CommandTimeoutError(Exception):
""" Command Timeout Error """
class InvalidStateError(Exception):
""" Invalid State Error """
+1
View File
@@ -784,6 +784,7 @@ class Device(CompositeEventEmitter):
)
except asyncio.TimeoutError:
logger.warning('!!! Command timed out')
raise CommandTimeoutError()
async def power_on(self):
# Reset the controller