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

Handle non-str keys when sending commands #214

Merged
merged 2 commits into from
Dec 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
lint
  • Loading branch information
bdraco committed Dec 29, 2023

Unverified

This user has not yet uploaded their public signing key.
commit 60e1442d946e64822dbda9ed9d76edb7898d759d
4 changes: 3 additions & 1 deletion roombapy/roomba.py
Original file line number Diff line number Diff line change
@@ -223,7 +223,9 @@ def send_command(self, command, params=None):

# params may contain non-string keys, so we need to use the orjson
# OPT_NON_STR_KEYS option
str_command = orjson.dumps(roomba_command, option=orjson.OPT_NON_STR_KEYS).decode("utf-8")
str_command = orjson.dumps(
roomba_command, option=orjson.OPT_NON_STR_KEYS
).decode("utf-8")
self.log.debug("Publishing Roomba Command : %s", str_command)
self.remote_client.publish("cmd", str_command)

Loading