diff --git a/appdaemon/plugins/hass/hassplugin.py b/appdaemon/plugins/hass/hassplugin.py index ba98ebb5e..8127c5fe1 100644 --- a/appdaemon/plugins/hass/hassplugin.py +++ b/appdaemon/plugins/hass/hassplugin.py @@ -283,8 +283,9 @@ async def websocket_send_json(self, timeout: float = 5.0, silent: bool = False, self.id += 1 request["id"] = self.id - # include this in the "not auth" section so we don't accidentally put the token in the logs - self.logger.debug(f"Sending JSON: {request}") + if not silent: + # include this in the "not auth" section so we don't accidentally put the token in the logs + self.logger.debug(f"Sending JSON: {request}") send_time = perf_counter() try: @@ -308,7 +309,8 @@ async def websocket_send_json(self, timeout: float = 5.0, silent: bool = False, try: result: dict = await asyncio.wait_for(future, timeout=timeout) except asyncio.TimeoutError: - self.logger.warning(f"Timed out [{timeout:.0f}s] waiting for request: %s", request) + if not silent: + self.logger.warning(f"Timed out [{timeout:.0f}s] waiting for request: %s", request) return {"success": "timeout", "ad_duration": timeout} else: travel_time = perf_counter() - send_time