device: raise a CommandTimeoutError error on command timeout

This commit is contained in:
Abel Lucas
2022-10-20 22:11:07 +00:00
parent eb8556ccf6
commit 4e2f66f709
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