Skip to content

Somfy Links tab + shade/group/room add-at-capacity fixes#2

Merged
MatthiasJobst merged 8 commits into
mainfrom
feature/shade-link-tab
Jul 8, 2026
Merged

Somfy Links tab + shade/group/room add-at-capacity fixes#2
MatthiasJobst merged 8 commits into
mainfrom
feature/shade-link-tab

Conversation

@MatthiasJobst

Copy link
Copy Markdown
Owner

Summary

Adds the Somfy Links tab (shade-to-shade and remote linking) with its GUI assets/icons, plus a set of fixes and a refactor found while stress-testing it at capacity.

Features

  • New Somfy Links tab for shade-to-shade and remote linking; virtual remote moved behind a button in the Somfy settings tab.
  • UI cleanup, header icon swap, third-party license notices extended (Google-sourced remote assets).

Fixes

  • Add-at-capacity crashes: adding a shade/group/room when full previously null-deref'd (shade) or assert-panicked (group/room). Now guarded — the add returns nullptr and the web layer reports "maximum exceeded".
  • Slot/id decoupling: persistence compacts records into the front slots on load, so slot index ≠ id-1; add*() no longer indexes by id-1 (which could overwrite an existing record after a reboot). Corrected the id-allocation off-by-one so the full array capacity is usable.
  • HomeKit accessory-AID NVS bloat fixed; removed NVS-usage boot diagnostic.

Refactor

  • Extracted the shared "lowest free id / first empty slot" logic into SlotArray.h (single-pass, concept-constrained, NO_ID sentinel per record type), replacing three hand-rolled copies.

Tests

  • New test/unit/test_slotArray.cpp (parameterized over both sentinel conventions) plus controller regressions for the capacity/compaction cases. Host suite: 799 + 100 tests green locally.

🤖 Generated with Claude Code

MatthiasJobst and others added 8 commits June 25, 2026 21:16
Introduce a dedicated "Links" subtab under Somfy that consolidates all
linking actions: pick a source shade, view its linked shades/remotes
(app shades shown by name), add a link to another app shade via a
dropdown, link a physical remote via the press-a-remote flow, and unlink
any entry. The Shades editor keeps its linked-remotes list display but no
longer hosts the Link Remote button.

WebShades: honor SomfyShade::linkRemote's return value so a full
linked-remote table reports an error instead of silently no-opping, and
stop double-sending the response on the error branches.

Web assets: shared .info-text size class; cache-bust bumped to v0.7.1h.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- main.css: remove dead rules and merge duplicate blocks (field-group /
  button-container, input/select); drop the .field-group1 variant in
  favour of .field-group + .field-sep / .radioPins.
- Reorder the top tabs to Somfy, HomeKit, Radio, Network, System
  (System stays the initial landing tab).
- Links tab: source-shade picker now uses the same field-group look as
  the Virtual Remote selector.
- Replace the CSS-drawn config gear/home with Bootstrap Icons
  house-gear-fill / house-fill, served from LittleFS and registered in
  WebFiles.cpp; recoloured via CSS mask so they stay white on the button.
  Toggle now flips a `show-home` class instead of swapping icss classes.
- Delete the now-unused icss-gear/icss-gears/icss-home definitions.
- Add THIRD-PARTY-NOTICES.md and a README License section clarifying that
  the Unlicense covers only this project's own code; bundled components
  (Bootstrap Icons, ArduinoJson, etc.) keep their own licenses.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New SVG icons, web UI for shade linking, and matching third-party notices.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Key shade AIDs by stable id instead of name (with one-time migration of
existing name-keyed entries), and prune orphaned AID entries on boot and
shade delete. Stops hap_main filling the nvs partition, which broke PHY
calibration writes (0x1105). Adds an NVS-usage diagnostic at boot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
It served its purpose diagnosing the hap_main bloat; drop the per-boot
per-key enumeration and its log noise.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…omfyTab in settings.

Fixed a bug when adding 30 shades.
Needed to extend the licenses because the remote is used from google.
Guard capacity (return nullptr instead of null-deref/assert) and
decouple slot index from id, which persistence compacts on load.
Extract the shared lowest-free-id/first-empty-slot logic into
SlotArray.h with a per-type NO_ID sentinel, plus unit tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MatthiasJobst
MatthiasJobst merged commit f193e9d into main Jul 8, 2026
4 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