Skip to content

Commit 1e5be6e

Browse files
committed
silent option affects more logs
1 parent fe47d32 commit 1e5be6e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

appdaemon/plugins/hass/hassplugin.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,9 @@ async def websocket_send_json(self, timeout: float = 5.0, silent: bool = False,
283283
self.id += 1
284284
request["id"] = self.id
285285

286-
# include this in the "not auth" section so we don't accidentally put the token in the logs
287-
self.logger.debug(f"Sending JSON: {request}")
286+
if not silent:
287+
# include this in the "not auth" section so we don't accidentally put the token in the logs
288+
self.logger.debug(f"Sending JSON: {request}")
288289

289290
send_time = perf_counter()
290291
try:
@@ -308,7 +309,8 @@ async def websocket_send_json(self, timeout: float = 5.0, silent: bool = False,
308309
try:
309310
result: dict = await asyncio.wait_for(future, timeout=timeout)
310311
except asyncio.TimeoutError:
311-
self.logger.warning(f"Timed out [{timeout:.0f}s] waiting for request: %s", request)
312+
if not silent:
313+
self.logger.warning(f"Timed out [{timeout:.0f}s] waiting for request: %s", request)
312314
return {"success": "timeout", "ad_duration": timeout}
313315
else:
314316
travel_time = perf_counter() - send_time

0 commit comments

Comments
 (0)