Skip to content

Instantly share code, notes, and snippets.

@CamDavidsonPilon
Created May 15, 2023 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CamDavidsonPilon/f87bd4a5e661296e66042164340d4bb3 to your computer and use it in GitHub Desktop.
Save CamDavidsonPilon/f87bd4a5e661296e66042164340d4bb3 to your computer and use it in GitHub Desktop.
from pioreactor.utils import local_persistant_storage
from msgspec.json import decode as loads, encode as dumps
name = "my_cali_name"
with local_persistant_storage("pump_calibrations") as c:
blob = loads(c[name])
print(f"old={blob}")
print()
blob['duration_'] = 1000 * blob['duration_']
print(f"new={blob}")
print()
c[name] = dumps(blob)
print(f"Saved! Now run `pio run pump_calibration change_current {name}`")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment