Skip to content

Commit

Permalink
Correct generating cast messages
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery committed Jan 28, 2024
1 parent b2546f4 commit f85879c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pychromecast/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ def _message_to_string(message, data=None):
)


def _json_to_payload(data: dict) -> bytes:
"""Encodes a python value into JSON format."""
return json.dumps(data, ensure_ascii=False).encode("utf8")


@dataclass(frozen=True)
class NetworkAddress:
"""Network address container."""
Expand Down Expand Up @@ -877,7 +872,7 @@ def send_message(
cast_channel_pb2.CastMessage.STRING # pylint: disable=no-member
)
msg.namespace = namespace
msg.payload_utf8 = _json_to_payload(data)
msg.payload_utf8 = json.dumps(data, ensure_ascii=False)

# prepend message with Big-Endian 4 byte payload size
be_size = pack(">I", msg.ByteSize())
Expand Down

0 comments on commit f85879c

Please sign in to comment.