Skip to content

feat(plugins): add read-only multi-instance E64 sensor - #848

Draft
MaxRink wants to merge 2 commits into
decentespresso:mainfrom
MaxRink:feature/e64-js-sensor
Draft

feat(plugins): add read-only multi-instance E64 sensor#848
MaxRink wants to merge 2 commits into
decentespresso:mainfrom
MaxRink:feature/e64-js-sensor

Conversation

@MaxRink

@MaxRink MaxRink commented Sep 13, 2026

Copy link
Copy Markdown

Summary

Add an opt-in E64 sensor plugin that reads grinder telemetry through the existing host-owned WebSocket transport, with independent same-model instances and no grinder writes.

  • Keep one registration, socket, request counter, pending map, timer, and connection epoch per configured instance.
  • Expose only readState, readConfig, readMachineInfo, and readLogMessages, with exact request/ref correlation and complete typed object publications.
  • Validate configuration and secure tokens before opening sockets, isolate one instance's failure, and preserve existing brewing/dosing scale registrations.

Linked Issue

Related #854. Depends on the sensor-selection fix #847 for accepted issue #831. #747/#748 concern separate MOTTO80 work and are context only, not issues fixed by this E64 plugin.

The new discussion issue is awaiting maintainer triage. This PR remains a draft while maintainers discuss the proposal; opening the issue does not satisfy the accepted-issue gate or imply approval of the proposed contract.

Verification

  • test/plugins/e64ws_plugin_test.dart has 12 passing protocol and loopback tests covering the four reads, correlation, validation, limits, failures, polling, reconnect, heartbeat, and timeouts.

  • test/controllers/steam_sequencer_test.dart has 19 passing tests, including the mixed-adapter case with two E64 adapters, two scales, and a Bengle milk probe in both registration orders, probe attach, and reconnect.

  • The standalone E64 branch Flutter suite passed 4,171 tests; the final combined feature suite, including fix(api): resolve encoded sensor IDs in REST and WebSocket routes #858, passed 4,293 tests. Each had 1 skipped and 0 failures; flutter analyze is clean. Node syntax checking and Dart formatting pass locally.

  • The final two-fixture runtime run passed using percent-encoded IDs for REST manifest lookup, all four read commands, and independent WebSocket snapshots. Disconnecting A leaves B responsive and the simulated scale connected. This uses the host fix in fix(api): resolve encoded sensor IDs in REST and WebSocket routes #858. Real hardware and self-signed WSS validation are not claimed.

  • The implementation and loopback fixtures were independently authored; no vendor code or assets are included.

  • The final two-instance runtime check exposed pre-existing sensor path handling bug fix(api): resolve URL-encoded sensor IDs in REST and WebSocket routes #857: URL-encoded plugin sensor IDs return 404 despite both registrations being present. Draft fix(api): resolve encoded sensor IDs in REST and WebSocket routes #858 supplies that host fix and must land before this plugin is considered ready; its standalone full suite passed 4,155 tests. The final combined encoded-path runtime check now passes with that fix.

Impact

This adds an opt-in telemetry-only sensor path. It sends no motor, calibration, brew-event, or GBS writes, and it does not alter the existing scale API or inventory contract. The prerequisite sensor-selection fix is included in this branch and must land first through #847.

Contributor Responsibility

AI-assisted development is allowed. The submitter remains responsible for the submitted work.

  • I have reviewed and understand all changes in this PR and take responsibility for their correctness, security, behavior, licensing, and provenance, including any AI-assisted or AI-generated work.

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