What exists already
locatorCommands (main.go:88) maps subcommand names to wire bytes, but has no
dimmer entry
sendCommand sends fixed 3-byte mode commands; sendSetCommand sends the
6-byte SetTimer struct — neither fits a 1-byte-payload command
What's missing
Per TimeMachinesCorp Locator Protocol API v2.0
section 1.4.4, Dimmer Set is:
| Byte |
Description |
| 0 |
Command byte: 0xB5 |
| 1 |
Digit Brightness: 0-100 |
There is no CLI subcommand to send it.
Proposed subcommand
ctm dimmer_set <level> <clock_ip> → sends \xb5 + one brightness byte
Example:
ctm dimmer_set 50 192.168.42.204 # sends \xb5\x32, expects ACK
Notes / constraints
- API v2.0-only feature; the clock must return a 40-byte status response to be
v2.0, though the command itself just needs an ACK.
- Volatile: the dimmer level is not saved to non-volatile memory — it is
lost on reboot or until changed. Worth noting in --help text.
- Needs a small send helper for a command byte + 1 payload byte (or a
generalized payload-send function that sendSetCommand can share).
- Brightness must be validated to 0-100.
Acceptance Criteria
What exists already
locatorCommands(main.go:88) maps subcommand names to wire bytes, but has nodimmer entry
sendCommandsends fixed 3-byte mode commands;sendSetCommandsends the6-byte
SetTimerstruct — neither fits a 1-byte-payload commandWhat's missing
Per TimeMachinesCorp Locator Protocol API v2.0
section 1.4.4, Dimmer Set is:
0xB5There is no CLI subcommand to send it.
Proposed subcommand
ctm dimmer_set <level> <clock_ip>→ sends\xb5+ one brightness byteExample:
Notes / constraints
v2.0, though the command itself just needs an ACK.
lost on reboot or until changed. Worth noting in
--helptext.generalized payload-send function that
sendSetCommandcan share).Acceptance Criteria
locatorCommands["dimmer_set"] = "\xb5"entry added and pinned inmain_test.goctm dimmer_set 50 <ip>sends\xb5\x32and receives ACKnewCommandTreewithfakeConnverifying wire bytes