Suppress occupancy binds in Away, Travel and Night fans #126
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/yn-8-suppress-occupancy-binds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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;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.
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.
Clean. Nothing to act on.