Refine debug message

This commit is contained in:
2025-02-01 22:45:21 +08:00
parent 02f38e782e
commit f4be76e18e

5
tapo_exporter.py Normal file → Executable file
View File

@@ -36,7 +36,7 @@ class TplinkT315:
await self.hubDev.update() await self.hubDev.update()
except KasaException as e: except KasaException as e:
self.hubDev = None self.hubDev = None
print(f"[TplinkT315::connect] Error: {e}") print(f"[TplinkT315::connect] Hub Error: {e}")
return False return False
try: try:
@@ -44,7 +44,7 @@ class TplinkT315:
await self.t315Dev.update() await self.t315Dev.update()
except KasaException as e: except KasaException as e:
self.t315Dev = None self.t315Dev = None
print(f"[TplinkT315::connect] Error: {e}") print(f"[TplinkT315::connect] Device Error: {e}")
return False return False
return True return True
@@ -98,6 +98,7 @@ def getSecrets(fileanme):
async def main(configs): async def main(configs):
secrect = getSecrets(configs.get("secret_filepath", DEFAULT_POLLING_INTERVAL)) secrect = getSecrets(configs.get("secret_filepath", DEFAULT_POLLING_INTERVAL))
if secrect is None: if secrect is None:
print(f'Cannot read secret file({configs.get("secret_filepath", DEFAULT_POLLING_INTERVAL)})')
return return
hubIp = secrect["ip"] hubIp = secrect["ip"]