Suppress occupancy binds in Away, Travel and Night fans #126

Merged
Claude merged 2 commits from feat/yn-8-suppress-occupancy-binds into feat/yaml-nodes 2026-10-16 06:14:53 +00:00
Collaborator

Occupancy-sourced binds now turn nothing on in Away or Travel, and do not start a Fan-class target in Night. Clears still act; switch (EVT_BINARY) sources act in every mode. Entering Travel already switches off Light-class targets through modeSwitchesOff, so binds need no extra hook. Spec 9.5 no longer says binds act in every mode.

Tested: five new host tests in test_binds (each mode case); mutating the Night fan check and the Travel check made them fail. pio test -e native: 598 -> 603 pass; pio run passes.

YN-8

Occupancy-sourced binds now turn nothing on in Away or Travel, and do not start a Fan-class target in Night. Clears still act; switch (EVT_BINARY) sources act in every mode. Entering Travel already switches off Light-class targets through modeSwitchesOff, so binds need no extra hook. Spec 9.5 no longer says binds act in every mode. Tested: five new host tests in test_binds (each mode case); mutating the Night fan check and the Travel check made them fail. pio test -e native: 598 -> 603 pass; pio run passes. YN-8
Suppress occupancy binds in Away, Travel and Night fans
Some checks failed
Build and test / release (pull_request) Has been cancelled
Build and test / build (pull_request) Has been cancelled
acbaefaef5
Claude left a comment

Two things to fix; the rest matches the task and spec 7 / 9.5.

Two things to fix; the rest matches the task and spec 7 / 9.5.
@ -45,6 +53,7 @@ void Binds::onFrame(const can::Frame& frame, uint32_t now) {
bind.sourceOn = on;
const bool actsOnFirstReport = bind.action == BindAction::Follow || (bind.action == BindAction::Toggle && freshPress);
if (!wasSynced && !actsOnFirstReport) continue;
if (fromOccupancy && on && occupancySuppressed(mode, *bind.target)) continue;
Author
Collaborator

Suppressed rise still sets bind.sourceOn = true (line above), so anyFollowSourceOn() counts it. With a second Follow source on the same target (e.g. a switch), that source clearing in Away calls setOn(anyFollowSourceOn) = true and turns the light ON. Trace: PIR rises in Away (suppressed, sourceOn stays true), switch on, switch off -> light on. Fix: skip a suppressed occupancy source in anyFollowSourceOn, or don't record sourceOn when suppressed. Add a two-source test.

Suppressed rise still sets bind.sourceOn = true (line above), so anyFollowSourceOn() counts it. With a second Follow source on the same target (e.g. a switch), that source clearing in Away calls setOn(anyFollowSourceOn) = true and turns the light ON. Trace: PIR rises in Away (suppressed, sourceOn stays true), switch on, switch off -> light on. Fix: skip a suppressed occupancy source in anyFollowSourceOn, or don't record sourceOn when suppressed. Add a two-source test.
Author
Collaborator

ToggleOnChange also flips on a clear, so an occupancy clear in Away/Travel/Night-fan turns an off target ON. Spec says clears still act, but 'turns nothing on' is violated. Either suppress ToggleOnChange occupancy fully or confirm with the spec owner it's out of scope.

ToggleOnChange also flips on a clear, so an occupancy clear in Away/Travel/Night-fan turns an off target ON. Spec says clears still act, but 'turns nothing on' is violated. Either suppress ToggleOnChange occupancy fully or confirm with the spec owner it's out of scope.
Keep suppressed occupancy out of follow state and change toggles
All checks were successful
Build and test / build (pull_request) Successful in 5m18s
Build and test / release (pull_request) Has been skipped
bec36c63fe
Claude left a comment

Clean. Nothing to act on.

Clean. Nothing to act on.
Claude merged commit 81ec9de458 into feat/yaml-nodes 2026-10-16 06:14:53 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rob/CampervanControlSystems!126
No description provided.