Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use json_dumps helper for websocket messages #4854

Merged
merged 1 commit into from
Jan 30, 2024
Merged

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Jan 30, 2024

Proposed change

I missed that these need to have dumps passed. Noticed in #4853 (comment)

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to cli pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints of add-on configuration are added/changed:

I missed that these need to have dumps passed
@bdraco bdraco added the performance A code change that improves performance label Jan 30, 2024
@@ -74,7 +75,7 @@ async def async_send_message(self, message: dict[str, Any]) -> None:
self._message_id += 1
_LOGGER.debug("Sending: %s", message)
try:
await self._client.send_json(message)
await self._client.send_json(message, dumps=json_dumps)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only one that matters but good to be consistent and use the same everywhere

@bdraco bdraco changed the title Use orjson encoder for websocket messages Use json_dumps helper for websocket messages Jan 30, 2024
@bdraco bdraco marked this pull request as ready for review January 30, 2024 05:00
@mdegat01 mdegat01 merged commit 375789b into main Jan 30, 2024
21 of 22 checks passed
@mdegat01 mdegat01 deleted the orjson_websocket branch January 30, 2024 14:00
@bdraco
Copy link
Member Author

bdraco commented Jan 30, 2024

thanks

@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed performance A code change that improves performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants