12035f2f39
- Migrates tactility-firmware and tactility-bluetooth from ~/.hermes/skills/ into .claude/skills/ for repo co-location - Adds AGENTS.md with local workstation context, board table, board-direct build rule, Hermes PYTHONPATH pitfall, common Tactility pitfalls, and in-repo skill index Refs: personal Gitea mirror
2.4 KiB
2.4 KiB
Battery Cleanup Lesson — 2026-07-11
User intent evolution
- "Add option for screensaver to be disabled when charging. Check if possible with ESP32"
- "I want battery level shown on tab where WiFi icon is shown"
- "I see, I think the issue is firmware is not reading battery level. Debug this."
- "Let's remove any custom battery logic (not the board config). I have a micropython code with battery reading level on the projects folder. Look for it"
- "I don't need the battery level on the wifi, that makes no sense. I wanted on the overall status bar, but I deduced that the issue was that the power was not configured so tactility should have a native icon for battery"
What went wrong
- Added battery_label to WifiManage View: wrong UX location. Statusbar already has native icon
statusbar_set_battery_text+ visibility. Should have checkedStatusbar.cppfirst. - Added custom Power.cpp to ES3C28P: violated later instruction "not the board config". Should keep board config pristine unless explicitly allowed.
- MicroPython reference:
Projects/MicroPython/test1/Screen/lib/battery_util.pyBatteryMonitor(pin_num=9) ADC 11dB ATTN, 2x divider, 3.0-4.2V. Found viafind Projects -name "*.py" | xargs grep batteryavoiding venv. Pin 9 conflicts with RLCD I2S BCLK=9 — note before applying.
Correct pattern for future
- When user says "battery not shown where WiFi icon is" → interpret as statusbar (overall header bar where WiFi + BT icons live), not WifiManage app tab. Explain native statusbar exists, check if PowerDevice missing.
- When user says "remove any custom battery logic (not board config)" → delete Devices/*/Power.{h,cpp} you added, revert CMakeLists.txt and Configuration.cpp to HEAD. Keep only generic features using existing HAL API (DisplaySettings, DisplayIdle).
- When user provides external reference (micropython code) → locate it, read exact pin/divider, but don't auto-apply to board config if they said not to touch config. Offer as suggestion.
Files reverted in cleanup
Devices/es3c28p/Source/Configuration.cpp→ only createDisplay()Devices/es3c28p/CMakeLists.txt→ remove EstimatedPower/esp_adc REQUIRESTactility/Private/Tactility/app/wifimanage/View.handView.cpp→ removed battery_label/updateBattery()- Kept:
DisplaySettings.hdisableScreensaverWhenCharging, DisplayIdle charging guard, Display.cpp toggle — these use native IsCharging API, no custom ADC