Skip to content

Minor fixes and updates, ensure pins are better guarded#194

Merged
k3ldar merged 1 commit into
mainfrom
minorUpdates
May 22, 2026
Merged

Minor fixes and updates, ensure pins are better guarded#194
k3ldar merged 1 commit into
mainfrom
minorUpdates

Conversation

@k3ldar
Copy link
Copy Markdown
Owner

@k3ldar k3ldar commented May 22, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 22, 2026 06:18
This was linked to issues May 22, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 additional guards and platform-aware updates for sensor configuration, warning reporting, and ADC handling within the PowerControlHub firmware.

Changes:

  • Adds new sensor failure warning types and corresponding display strings.
  • Adds PinGuard validation to sensor pin assignment commands and improves input-only pin handling on ESP32-S3.
  • Introduces board-specific ADC resolution constants plus a setup-time configureAdc() hook, and updates the voltage sensor ADC scaling.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
PowerControlHub/WarningType.h Adds new warning bits (Voltage/Binary/Light/Water sensor failure) and display strings.
PowerControlHub/VoltageSensorHandler.h Uses ADC_FULL_SCALE, adds disabled-pin guarding, and gates updates/MQTT on initialization.
PowerControlHub/SystemFunctions.h Declares configureAdc() for boards supporting runtime ADC resolution selection.
PowerControlHub/SystemFunctions.cpp Implements configureAdc() and changes safeJsonFloat() formatting.
PowerControlHub/SensorFactory.h Adds disabled-pin checks that raise specific warnings and skip sensor instantiation.
PowerControlHub/SensorConfigCommandHandler.h Adds PinGuard validation for the sensor pin assignment command (S4).
PowerControlHub/PowerControlHub.ino Calls SystemFunctions::configureAdc() during setup().
PowerControlHub/PinGuard.h Adjusts ESP32-S3 input-only handling and treats input-only pins as safe for input uses.
PowerControlHub/BoardConfig.h Adds ADC resolution/full-scale capability table and CONFIGURE_ADC define.
PowerControlHub.sln Adds Docs/PinGuard.md to the solution.
Docs/PinGuard.md Documents PinGuard behavior, coverage, and input-only handling (needs updates for S4 + bypass semantics).

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

Comment thread PowerControlHub/VoltageSensorHandler.h
Comment thread PowerControlHub/SystemFunctions.cpp
Comment thread Docs/PinGuard.md
Comment thread PowerControlHub/SystemFunctions.cpp
Comment thread Docs/PinGuard.md
@k3ldar k3ldar enabled auto-merge (squash) May 22, 2026 06:38
@k3ldar k3ldar disabled auto-merge May 22, 2026 06:42
@k3ldar k3ldar enabled auto-merge (squash) May 22, 2026 06:42
@k3ldar k3ldar marked this pull request as draft May 22, 2026 10:38
auto-merge was automatically disabled May 22, 2026 10:38

Pull request was converted to draft

@k3ldar k3ldar marked this pull request as ready for review May 22, 2026 10:39
@k3ldar k3ldar merged commit 086efe2 into main May 22, 2026
5 checks passed
@k3ldar k3ldar deleted the minorUpdates branch May 22, 2026 10:39
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.

safeJsonFloat Voltage Sensor handler Sensor Factory PinGuard Updates

2 participants