try MessageToDict(msg)

This commit is contained in:
J. Nick Koston 2024-08-29 10:31:41 -10:00
parent 265167279c
commit 14d0a2d8cf
No known key found for this signature in database

View File

@ -17,6 +17,7 @@ from typing import TYPE_CHECKING, Any, Callable
import aiohappyeyeballs
from async_interrupt import interrupt
from google.protobuf import message
from google.protobuf.json_format import MessageToDict
import aioesphomeapi.host_resolver as hr
@ -712,7 +713,10 @@ class APIConnection:
if debug_enabled := self._debug_enabled:
for msg in msgs:
_LOGGER.debug(
"%s: Sending %s: %r", self.log_name, type(msg).__name__, msg
"%s: Sending %s: %s",
self.log_name,
type(msg).__name__,
MessageToDict(msg),
)
if TYPE_CHECKING:
@ -908,10 +912,10 @@ class APIConnection:
if debug_enabled:
_LOGGER.debug(
"%s: Got message of type %s: %r",
"%s: Got message of type %s: %s",
self.log_name,
msg_type.__name__,
msg,
MessageToDict(msg),
)
if self._pong_timer is not None: