Context
docs/mqtt-contract.md §4 defines enabled: false as a valid, applied config that means "provisioned but stay silent" — the remote on/off lever (e.g. to quiet a device during an OTA). The current firmware does the opposite: RuntimeConfig::isValid() returns false when !enabled, so a disabled config is rejected and never applied. The device therefore keeps its previous enabled: true state and cannot be turned off remotely — the dead end noted earlier in this work.
Conflict to resolve
This directly contradicts open issue #6, which lists enabled among fields that must be required/validated (i.e. keeps rejecting enabled: false). The contract supersedes that assumption. #6 should be updated or closed as part of this — its premise (require topic fields + enabled in config) no longer matches the design.
Scope
Make enabled: false an accepted, applied config; keep telemetry gated so a disabled device stays silent.
Implementation notes
isValid() must stop treating !enabled as invalid (it still requires configured, mac, rack_id, role).
- The telemetry send path already gates on
config_.enabled (two separate guards in sendMQTT), so once a disabled config is applied, transmission stops correctly — the only change is letting it be applied.
- Confirm the hello loop stays gated on
!configured only, so a disabled-but-configured device does not resume announcing.
Acceptance criteria
- A config with
enabled: false is accepted and applied; the device stops publishing telemetry but remains connected and subscribed.
- A later
enabled: true config re-enables transmission.
- Matches
docs/mqtt-contract.md §4 and §10.
Relates to #6.
Context
docs/mqtt-contract.md§4 definesenabled: falseas a valid, applied config that means "provisioned but stay silent" — the remote on/off lever (e.g. to quiet a device during an OTA). The current firmware does the opposite:RuntimeConfig::isValid()returns false when!enabled, so a disabled config is rejected and never applied. The device therefore keeps its previousenabled: truestate and cannot be turned off remotely — the dead end noted earlier in this work.Conflict to resolve
This directly contradicts open issue #6, which lists
enabledamong fields that must be required/validated (i.e. keeps rejectingenabled: false). The contract supersedes that assumption. #6 should be updated or closed as part of this — its premise (require topic fields + enabled in config) no longer matches the design.Scope
Make
enabled: falsean accepted, applied config; keep telemetry gated so a disabled device stays silent.Implementation notes
isValid()must stop treating!enabledas invalid (it still requiresconfigured,mac,rack_id,role).config_.enabled(two separate guards insendMQTT), so once a disabled config is applied, transmission stops correctly — the only change is letting it be applied.!configuredonly, so a disabled-but-configured device does not resume announcing.Acceptance criteria
enabled: falseis accepted and applied; the device stops publishing telemetry but remains connected and subscribed.enabled: trueconfig re-enables transmission.docs/mqtt-contract.md§4 and §10.Relates to #6.