Repository navigation
feat(maimu): add an Off time to the Maimu node for duty-cycled pulses - #201
Merged
Merged
Conversation
The node's Period is relabelled On (ms), still saved as period_ms so existing files open unchanged, and gains Off (ms). Off 0 keeps the original symmetric toggle; any other value sends "p<on>,<off>,<s>" through the device's write action, e.g. On 10 / Off 40 = 20 Hz with 10 ms pulses. Needs Maimu firmware 0.1.0+; older firmware ignores the 'p' command rather than misreading it.
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.
Summary
The Maimu node could only run a symmetric train:
<period_ms>,<duration_s>makes the on time equal to the off time. A 20 Hz train of 10 ms pulses (10 ms on / 40 ms off) needs those two times to differ.period_ms, so existing.gliderfiles open and behave unchanged.pulsecommand.p<on_ms>,<off_ms>,<duration_s>(e.g.p10,40,10) through the device's existingwriteaction.device.pyis untouched.Firmware
The
pcommand needs Maimu firmware 0.1.0, which adds it alongside the original command. Older firmware runsatoi("p10"), gets 0 and ignores the command, so the light stays off. Without the prefix,10,40,10would be misread as a 10 ms toggle for 40 s.Test plan
pytest plugins/glider-maimu/testspasses (86 tests, 3 new): Off 0 keeps thepulsecall, On 10 / Off 40 sendswrite("p10", 40, 10), Off saves and reloads, and an old file with nooff_msloads as symmetricruff checkandblack --checkare clean