mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
refactor: move the shade's behaviour into ShadeBehaviour
PR B of SHADE_BEHAVIOUR_PLAN.md. What a shade does with frames, commands, group commands and radio events moves unchanged from SomfyShade into ShadeBehaviour, which builds natively and is pinned by test_shadebehaviour. ShadeBehaviour reads ShadeSettings and RemoteSettings, gets the time on every input, and holds the motion state that other files now read through state(). It sends through MotorLink and reports through ShadeEvents (changes, commands, save wanted, sensor flags) as things happen. SomfyShade wraps it: its MotorLink is SomfyRemote::sendCommandAfter, which now leaves the sender out of the echo and radio hold because the module hears its own frame. lastFrame stays shared with the send path. ConfigFile writes through restore() and clearTilt(), SomfyShadeOps through setPosition(). The pinning tests label where the copies of a rule disagree "today:", for the reconcile phase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
fa7aaf0d49
commit
4f8eac03ac
18 changed files with 2182 additions and 1343 deletions
10
GLOSSARY.md
10
GLOSSARY.md
|
|
@ -70,6 +70,16 @@ What shades and groups share about how their frames go on air: flip commands, bi
|
|||
**Flags**
|
||||
The byte a shade is saved and sent with. Its sun sensor, light and simulated My bits are settings; its sun flag, sunny, windy and demo mode bits are state. A group's flags are its shades' flags together.
|
||||
|
||||
**ShadeBehaviour**
|
||||
What a shade does with frames, commands, group commands and radio events, and where that leaves it: positions, targets, directions, the favorite and the sensor state.
|
||||
_Avoid_: shade logic, motion (`ShadeMotion` is the position maths it uses)
|
||||
|
||||
**MotorLink**
|
||||
The seam a shade's commands reach its motor through, radio or GPIO. The shade hears its own frame; every other shade hears it through the link.
|
||||
|
||||
**ShadeEvents**
|
||||
The seam through which a shade's behaviour reports what happened: changes for the change fan-out, commands for clients, a save wanted, and sensor flags for the groups.
|
||||
|
||||
## Entry points and outputs
|
||||
|
||||
**Entry point**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue