power: log the traceback on device init errors

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan
2023-01-18 19:31:47 -05:00
parent db81607370
commit 2ad7a6a087

View File

@@ -442,7 +442,7 @@ class HTTPDevice(PowerDevice):
raise
except Exception as e:
if type(last_err) != type(e) or last_err.args != e.args:
logging.info(f"Device Init Error: {self.name}\n{e}")
logging.exception(f"Device Init Error: {self.name}")
last_err = e
await asyncio.sleep(5.)
continue
@@ -886,7 +886,7 @@ class TPLinkSmartPlug(PowerDevice):
raise
except Exception as e:
if type(last_err) != type(e) or last_err.args != e.args:
logging.info(f"Device Init Error: {self.name}\n{e}")
logging.exception(f"Device Init Error: {self.name}")
last_err = e
await asyncio.sleep(5.)
continue