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

Query available commands and change backup format #9

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

KendrickLamarck
Copy link
Contributor

@KendrickLamarck KendrickLamarck commented Jan 10, 2025

Changes

  • Removed hardcoded list of commands and query the device for available commands instead.
    • These commands, once queried, are stored in a file khtool_commands.json
    • We store the osc/limits data for each parameter. This is used to check writability of parameters and could be used by external tools to check acceptable ranges, units etc.
  • Changed format of files generated by --backup. They now store device parameters in a json object hierarchy instead of a list of command strings. This better reflects the structure of the parameters better and improves interoperability with other tools.

TODOs

  • Use device.ip instead of device.name in khtool_commands.json? Probably yes, if only to keep consistent with --backup behavior.
  • _query_by_dict currently populates the command dictionary with values and returns the corresponding list of command strings. This might be confusing. Split up? Decided it's fine.
  • Function order: Put restore_device next to backup_device.

Instead of hard-coding commands for query and backup, ask the device
which commands it supports using osc/schema requests.
Instead of a list of command strings, store data in backup as json
object hierarchy. This reflects the structure of the commands better and
improves interoperability with other tools.
@KendrickLamarck KendrickLamarck force-pushed the query-available-commands branch from a50dc94 to 69da744 Compare January 10, 2025 19:51
@KendrickLamarck
Copy link
Contributor Author

Any update on this?

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 this pull request may close these issues.

1 participant