Skip to content

Add experimental ESPHome touchscreen example - #1

Merged
Mattie merged 5 commits into
mainfrom
feat/wireless-touchscreen-example
Jul 29, 2026
Merged

Add experimental ESPHome touchscreen example#1
Mattie merged 5 commits into
mainfrom
feat/wireless-touchscreen-example

Conversation

@Mattie

@Mattie Mattie commented Jul 28, 2026

Copy link
Copy Markdown
Owner

What changed

  • Add a direct Digest REST/SSE ESPHome panel adapter, DPAPI-protected settings store, interactive provisioner, and tests.
  • Add neutral and retro-futuristic bridge-console firmware examples pinned to ESPHome 2026.7.2.
  • Add public-safe research and device-reference docs, the exact tested device link, an architecture diagram, and a reviewed metadata-free physical-device photo.

Why

This provides an experimental way to display four Joydex task states and invoke task or Plan Mode actions from an ESP32-4848S040C_I touchscreen on a normal trusted Wi-Fi LAN, without Home Assistant, MQTT, or custom panel firmware.

Validation

  • Clean rebased branch: 386 tests passed (357 Joydex tests and 29 wireless configuration tests).
  • dotnet format Joydex.sln --verify-no-changes --no-restore passed.
  • NuGet audit found no vulnerable packages.
  • Release publish contains Joydex and the wireless-panel configuration tool.
  • Both firmware configurations validate and compile locally with ESPHome 2026.7.2.
  • Clean-checkout validation passed with placeholder secrets.
  • Intended-commit privacy scan found no credentials, personal paths, private LAN addresses, MAC addresses, COM assignments, backup names, or firmware binaries.
  • Published photo contains no EXIF, GPS, XMP, or ICC metadata.
  • Bridge firmware OTA upload, reboot, LAN reconnect, SSE reconnect, and exact public-head host connection succeeded.

Manual hardware checklist

  • Cold boot / OTA reboot and Wi-Fi reconnection.
  • Joydex host restart and state convergence.
  • Task 1–4 and PLAN MODE touch/action pass on the physical panel.
  • No incorrect action, white full-screen flash, or sustained tearing during the final pass.

The final physical pass showed one tiny redraw-local flicker while all four task cards changed. That remains within the documented acceptance threshold for this experimental example.

Security and scope

  • Firmware source only; no compiled images or credentials are published.
  • Intended for a trusted LAN only; do not port-forward the panel.
  • Existing Windows/.NET CI remains unchanged. ESPHome is pinned and was validated locally because this is a quick experimental hardware example.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an experimental ESPHome-based wireless touchscreen panel integration for Joydex. It adds a Windows-side adapter/transport that talks directly to an ESPHome panel over Digest-authenticated REST and SSE, plus a DPAPI-protected configuration store, an interactive provisioning tool, firmware examples pinned to ESPHome 2026.7.2, and supporting documentation/assets.

Changes:

  • Added a new Joydex.WirelessPanel library for DPAPI-protected per-user configuration and schema validation.
  • Added a new Joydex.Windows.WirelessPanel implementation (SSE parser, REST transport, adapter) and wired it into the Joydex tray app lifecycle.
  • Added an interactive provisioning tool, extensive tests, and ESPHome firmware + docs for the ESP32-4848S040C_I panel.

Reviewed changes

Copilot reviewed 30 out of 33 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/Joydex.WirelessPanel.Configure/Program.cs New interactive provisioning CLI for panel endpoint/credentials, saves via DPAPI-backed store.
tools/Joydex.WirelessPanel.Configure/Joydex.WirelessPanel.Configure.csproj New Windows-targeted provisioning tool project.
THIRD_PARTY_NOTICES.md Adds licensing/attribution note for the published scale photograph.
tests/Joydex.WirelessPanel.Tests/WirelessPanelConfigurationTests.cs Tests validation rules and password exclusion from diagnostics/JSON.
tests/Joydex.WirelessPanel.Tests/WirelessPanelConfigurationStoreTests.cs Tests DPAPI encrypt/decrypt round-trip, schema validation, and temp-file behavior.
tests/Joydex.WirelessPanel.Tests/ProvisioningToolProcessTests.cs Process-level tests for provisioning tool argument rejection / redirected input handling.
tests/Joydex.WirelessPanel.Tests/Joydex.WirelessPanel.Tests.csproj New test project for wireless-panel library + provisioning tool.
tests/Joydex.Tests/EspHomePanelTransportTests.cs Tests SSE parsing, press tracking, REST select posting serialization/timeouts, and reconnect behavior.
tests/Joydex.Tests/EspHomePanelAdapterTests.cs Tests adapter projection, navigation/acknowledgement behavior, Plan Mode action routing, and publish coalescing/retry semantics.
src/Joydex.WirelessPanel/WirelessPanelConfigurationStore.cs New DPAPI-protected JSON store with strict schema and best-effort ACL hardening.
src/Joydex.WirelessPanel/WirelessPanelConfiguration.cs New validated configuration model (http-only endpoint boundary, username/password constraints).
src/Joydex.WirelessPanel/Joydex.WirelessPanel.csproj New library project (net8.0-windows) with ProtectedData dependency.
src/Joydex.Windows/WirelessPanel/EspHomeSseParser.cs Adds bounded SSE line reader + ESPHome state event parsing + press edge tracking.
src/Joydex.Windows/WirelessPanel/EspHomePanelTransport.cs Adds Digest-auth HTTP client transport for /events + select updates, with reconnection and serialization.
src/Joydex.Windows/WirelessPanel/EspHomePanelModels.cs Defines panel button/task-state enums used by adapter/transport.
src/Joydex.Windows/WirelessPanel/EspHomePanelAdapter.cs Adds host policy adapter: projects task alerts to panel states and routes touch events to navigation/actions.
src/Joydex.App/TrayApplicationContext.cs Wires panel adapter into app startup/shutdown and task-alert change propagation.
src/Joydex.App/Joydex.App.csproj Adds reference to the new Joydex.WirelessPanel project.
scripts/Publish-Joydex.ps1 Publishes the provisioning tool alongside the app into the release output.
README.md Documents the experimental touchscreen feature, device, and where to start.
Joydex.sln Adds new projects (wireless panel library, provisioning tool, wireless panel tests) to the solution.
firmware/esphome/secrets.example.yaml Adds example secrets template for Wi-Fi/Web Server/OTA credentials.
firmware/esphome/requirements.txt Pins ESPHome to 2026.7.2 for repeatable builds.
firmware/esphome/README.md End-to-end firmware + provisioning + security-boundary instructions.
firmware/esphome/joydex-panel.yaml Neutral ESPHome/LVGL firmware example implementing the panel contract.
firmware/esphome/joydex-panel-bridge.yaml Bridge-console ESPHome/LVGL firmware example implementing the same contract.
firmware/esphome/.gitignore Ignores ESPHome build output, secrets, and firmware artifacts in the firmware directory.
docs/WIRELESS_TOUCHSCREEN_RESEARCH_V1.1.md Public research/design record, contract definition, and lessons learned.
docs/ESP32_4848S040C_I_DEVICE_REFERENCE.md Device-specific findings, pin/timing notes, and repeatability checklist.
CHANGELOG.md Records the new experimental touchscreen capability in the dated changelog.
.gitignore Ensures ESPHome secrets, venv, and build output stay out of Git.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/Joydex.WirelessPanel.Configure/Program.cs Outdated
@Mattie
Mattie marked this pull request as ready for review July 29, 2026 17:18
@Mattie
Mattie requested a review from Copilot July 29, 2026 17:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 30 out of 33 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/Joydex.WirelessPanel/WirelessPanelConfigurationStore.cs:87

  • Load() has a TOCTOU race: the file can be deleted between the File.Exists(...) check and FileInfo.Length, causing FileNotFoundException to escape even though the method contract is to return null when no settings exist. Handle “file vanished” as “no configuration”.
        var fileInfo = new FileInfo(ConfigurationPath);
        if (fileInfo.Length is <= 0 or > MaximumDocumentBytes)
        {
            throw new InvalidDataException(
                $"The wireless-panel settings file must contain 1 to {MaximumDocumentBytes} bytes.");

@Mattie
Mattie merged commit b81c77d into main Jul 29, 2026
3 checks passed
@Mattie
Mattie deleted the feat/wireless-touchscreen-example branch July 29, 2026 22:01
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.

2 participants