Skip to content

refactor(domain): store operation mode as typed enum - #215

Merged
stritti merged 1 commit into
mainfrom
refactor/typed-operation-mode
Oct 10, 2026
Merged

stritti merged 1 commit into
mainfrom
refactor/typed-operation-mode

Conversation

@stritti

@stritti stritti commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adopts the typed OperationMode contract from #214 inside OperationModeNode while preserving all existing String-facing APIs and external values.

Changes

  • store _mode as OperationMode instead of Arduino String
  • add typed setMode(OperationMode, source) and getTypedMode()
  • keep setMode(String) / getMode() / getModeCStr() as compatibility boundaries
  • parse persisted/string values through the allocation-free contract helper
  • compare rules against the stable external representation
  • persist the unchanged wire/NVS values (auto, manu, boost, timer)

Why

This removes protocol strings from the mutable domain state without forcing MQTT/Web/UI call sites to migrate in the same PR. It is the next small step toward typed commands and a pure application runtime.

Compatibility

No MQTT, Web or NVS value changes. The historic manu representation remains unchanged.

Stacked on #214.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

✅⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ ACTION actionlint 8 0 0 0.78s
✅ BASH bash-exec 2 0 0 0.64s
✅ BASH shellcheck 2 0 0 0.7s
✅ BASH shfmt 2 0 0 0.01s
✅ C clang-format 1 0 0 0.04s
✅ C cppcheck 1 0 0 0.04s
✅ C cpplint 1 0 0 0.33s
✅ CPP clang-format 90 0 0 0.78s
✅ CPP cppcheck 90 0 0 7.04s
✅ CPP cpplint 90 0 0 8.5s
✅ EDITORCONFIG editorconfig-checker 275 0 0 0.48s
✅ JSON jsonlint 6 0 0 0.13s
✅ JSON v8r 6 0 0 4.05s
⚠️ MARKDOWN markdownlint 107 4 0 5.19s
✅ YAML yamllint 26 0 0 0.96s

Detailed Issues

⚠️ MARKDOWN / markdownlint - 4 errors
.opencode/skills/web-ui/SKILL.md:34 error MD028/no-blanks-blockquote Blank line inside blockquote
docs/superpowers/plans/2026-08-10-olimex-c6-local-ui-implementation.md:106:401 error MD013/line-length Line length [Expected: 400; Actual: 452]
docs/superpowers/plans/2026-08-16-norvi-button-calibration.md:7:401 error MD013/line-length Line length [Expected: 400; Actual: 412]
openspec/changes/controller-architecture-contracts/design.md:171:401 error MD013/line-length Line length [Expected: 400; Actual: 448]

Notices

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: MAKEFILE, MAKEFILE_CHECKMAKE, MARKDOWN_MARKDOWN_LINK_CHECK. See Removed linters to find their replacements.

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.1.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,BASH_EXEC,BASH_SHELLCHECK,BASH_SHFMT,C_CPPCHECK,C_CPPLINT,C_CLANG_FORMAT,CPP_CPPCHECK,CPP_CPPLINT,CPP_CLANG_FORMAT,EDITORCONFIG_EDITORCONFIG_CHECKER,JSON_JSONLINT,JSON_V8R,MARKDOWN_MARKDOWNLINT,YAML_YAMLLINT

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Native Test Coverage

Metric Value
Line Coverage 48.2%
Branch Coverage 74.8%
Lines Hit/Total 392/814
Branches Hit/Total 178/238

Report from native unit tests (ASan + gcov).

@stritti stritti mentioned this pull request Oct 4, 2026
5 tasks
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

2 similar comments
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Native Test Coverage

Metric Value
Line Coverage 48.2%
Branch Coverage 74.8%
Lines Hit/Total 392/814
Branches Hit/Total 178/238

Report from native unit tests (ASan + gcov).

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Native Test Coverage

Metric Value
Line Coverage 48.2%
Branch Coverage 74.8%
Lines Hit/Total 392/814
Branches Hit/Total 178/238

Report from native unit tests (ASan + gcov).

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Native Test Coverage

Metric Value
Line Coverage 48.2%
Branch Coverage 74.8%
Lines Hit/Total 392/814
Branches Hit/Total 178/238

Report from native unit tests (ASan + gcov).

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Native Test Coverage

Metric Value
Line Coverage 48.2%
Branch Coverage 74.8%
Lines Hit/Total 392/814
Branches Hit/Total 178/238

Report from native unit tests (ASan + gcov).

2 similar comments
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Native Test Coverage

Metric Value
Line Coverage 48.2%
Branch Coverage 74.8%
Lines Hit/Total 392/814
Branches Hit/Total 178/238

Report from native unit tests (ASan + gcov).

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Native Test Coverage

Metric Value
Line Coverage 48.2%
Branch Coverage 74.8%
Lines Hit/Total 392/814
Branches Hit/Total 178/238

Report from native unit tests (ASan + gcov).

@stritti
stritti changed the base branch from refactor/controller-architecture-contracts to main October 10, 2026 20:41
Co-authored-by: stritti <stritti@users.noreply.github.com>
@stritti
stritti force-pushed the refactor/typed-operation-mode branch from 91d7403 to 8e55172 Compare October 10, 2026 20:44
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown
Contributor

Native Test Coverage

Metric Value
Line Coverage 49.3%
Branch Coverage 76.4%
Lines Hit/Total 411/833
Branches Hit/Total 194/254

Report from native unit tests (ASan + gcov).

@stritti
stritti merged commit 7fcb628 into main Oct 10, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant