offline_replay_demo.py 520 B

123456789101112131415161718
  1. from pathlib import Path
  2. from hth_sdk import HTH
  3. from hth_sdk.replay import write_sample_replay
  4. def main() -> None:
  5. path = Path(__file__).resolve().parent.parent / "hth_sdk" / "data" / "sample_replay.jsonl"
  6. if not path.is_file():
  7. write_sample_replay(path)
  8. with HTH.replay(path) as hth:
  9. state = hth.read()
  10. print("replay temps", [t for t in state.temperatures_c if t is not None][:4])
  11. print("ready", state.ready, "fresh", state.fresh)
  12. if __name__ == "__main__":
  13. main()