feat(s4): change a Micromate's settings by serial, audited, schedule-checked

s4_change_settings runs the shared change core with a read-back verdict
for its state (as asked / unchanged / differs).  It reads the active
setup's name (unstripped), the preferences, trigger and setup blocks and
the schedule; patches the setup through micromate.setup_fields; sends
THOR's setup push (0xDA 68 73 82 83 71 72, now enableable) once; reads
the setup back.  Refused before sending: a monitoring unit, a value the
unit does not allow (422), a stale preview (SettingsChanged, 409), and --
shown as 'blocked' in the preview -- the factory setup, a schedule that
loads another setup, an unreadable schedule, or a block SFM has not seen
(ChangeRefused, 409).  s4_settings carries the editable fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-11-03 21:43:03 -05:00
1 parent d0335dbbbd
commit c082f72d62
9 files changed
+407 -16

No files matched your search

+6
View File
@@ -63,6 +63,12 @@ def call_home_change(enabled: bool) -> ChangeKind:
else ChangeKind("disable call-home", "disabled", "disabled"))
def settings_change() -> ChangeKind:
"""A settings change (phase 5): its "state" is a read-back verdict --
"as asked" (the unit holds what was written), "unchanged", or "differs"."""
return ChangeKind("change settings", "as asked", "applied")
def _take_snapshot(snapshot: Optional[Callable[[], Dict[str, Any]]]) -> Optional[Dict[str, Any]]:
"""The caller's record of what the unit holds after the change -- for the
result and the audit row only. It never decides the outcome."""