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

Flatten keywords in LegacyActor #52

Closed
albireox opened this issue Feb 12, 2021 · 0 comments · Fixed by #53
Closed

Flatten keywords in LegacyActor #52

albireox opened this issue Feb 12, 2021 · 0 comments · Fixed by #53

Comments

@albireox
Copy link
Member

Right now if the value of a keyword passed to LegacyActor.write is a dictionary, it's output as a dictionary even if that's incompatible with the legacy datamodel. For example

status = {
    "camera": {"name": camera.name, "uid": camera.uid},
    "status": camera.get_status(update=True),
}
command.info(status)

This will be output in a LegacyActor as 0 0 i camera={name: 'camera_name', uid: 'ML12345'}; status={temperature: 25.0}. Maybe this should just fail, but for now we can flatten it so that if a keyword is a dictionary with a single depth level, it gets converted into a list of values. The above would be

0 0 i camera=["camera_name", "ML12345"]; status=[25.0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant