diff options
Diffstat (limited to 'control/actions.cpp')
-rw-r--r-- | control/actions.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/control/actions.cpp b/control/actions.cpp index 6eda2a6..66bba2b 100644 --- a/control/actions.cpp +++ b/control/actions.cpp @@ -99,6 +99,27 @@ void default_floor_on_missing_owner(Zone& zone, const Group& group) zone.setFloorChangeAllow(&group, !defFloor); } +Action set_speed_on_missing_owner(uint64_t speed) +{ + return [speed](control::Zone& zone, const Group& group) + { + auto services = zone.getGroupServices(&group); + auto missingOwner = std::any_of( + services.begin(), + services.end(), + [](const auto& s) + { + return !std::get<hasOwnerPos>(s); + }); + if (missingOwner) + { + zone.setSpeed(speed); + } + // Update group's fan control active allowed based on action results + zone.setActiveAllow(&group, !missingOwner); + }; +} + void set_request_speed_base_with_max(control::Zone& zone, const Group& group) { |