Refactor random data sender into CLI with Measurement dataclass - #85
Open
nk25719 wants to merge 6 commits into
Open
Refactor random data sender into CLI with Measurement dataclass#85nk25719 wants to merge 6 commits into
nk25719 wants to merge 6 commits into
Conversation
…ter-b18zj8 Publish inspiratory pressure alarms to MQTT and document alarm payloads
…ter-19gkpb Publish compact `a3` over-pressure alarm and simplify MQTT alarm behavior
nk25719
force-pushed
the
SpikeKrakeAlarmMQTT
branch
from
June 9, 2026 17:15
673a3df to
56a6120
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
@dataclassMeasurementthat implementsas_bytes()for the 12-byte PIRDS frame.terminate_with_newline,random_measurement,send_random_measurements, andparse_args, and added amain()entry point guarded byif __name__ == "__main__".asBytes()andprintMeasurement()that delegate to the new snake_case methods.DEVICE_TYPES/MEASUREMENT_TYPESand aDEFAULT_SAMPLE_COUNTto replace many implicit globals.Testing
python3 -m compileall data_serverwhich succeeded.Measurement('T','B',25,123456789,-7)and verifiedm.asBytes() == m.as_bytes(), the 13-byte payload length with newline, header bytes, and that the measurement value decodes as-7, which all passed.SystemExit(main())when run as a script.Codex Task