diff options
-rwxr-xr-x | control/gen-fan-zone-defs.py | 3 | ||||
-rw-r--r-- | control/types.hpp | 8 | ||||
-rw-r--r-- | control/zone.cpp | 3 | ||||
-rw-r--r-- | control/zone.hpp | 15 |
4 files changed, 25 insertions, 4 deletions
diff --git a/control/gen-fan-zone-defs.py b/control/gen-fan-zone-defs.py index 20c1534..eb33956 100755 --- a/control/gen-fan-zone-defs.py +++ b/control/gen-fan-zone-defs.py @@ -49,6 +49,7 @@ const std::vector<ZoneGroup> Manager::_zoneLayouts ZoneDefinition{ ${zone['num']}, ${zone['full_speed']}, + ${zone['default_floor']}, std::vector<FanDefinition>{ %for fan in zone['fans']: FanDefinition{ @@ -294,6 +295,8 @@ def buildZoneData(zone_data, fan_data, events_data, zone_conditions_data): zone['full_speed'] = z['full_speed'] + zone['default_floor'] = z['default_floor'] + # 'cooling_profiles' is optional (use 'all' instead) if ('cooling_profiles' not in z) or \ (z['cooling_profiles'] is None): diff --git a/control/types.hpp b/control/types.hpp index de56186..6e99950 100644 --- a/control/types.hpp +++ b/control/types.hpp @@ -58,10 +58,12 @@ using EventData = std::tuple<Group, Handler, Action>; constexpr auto zoneNumPos = 0; constexpr auto fullSpeedPos = 1; -constexpr auto fanListPos = 2; -constexpr auto setSpeedEventsPos = 3; +constexpr auto floorSpeedPos = 2; +constexpr auto fanListPos = 3; +constexpr auto setSpeedEventsPos = 4; using ZoneDefinition = std::tuple<size_t, - unsigned int, + uint64_t, + uint64_t, std::vector<FanDefinition>, std::vector<SetSpeedEvent>>; diff --git a/control/zone.cpp b/control/zone.cpp index a57174d..1a299e2 100644 --- a/control/zone.cpp +++ b/control/zone.cpp @@ -31,7 +31,8 @@ Zone::Zone(Mode mode, const ZoneDefinition& def) : _bus(bus), _fullSpeed(std::get<fullSpeedPos>(def)), - _zoneNum(std::get<zoneNumPos>(def)) + _zoneNum(std::get<zoneNumPos>(def)), + _defFloorSpeed(std::get<floorSpeedPos>(def)) { auto& fanDefs = std::get<fanListPos>(def); diff --git a/control/zone.hpp b/control/zone.hpp index 1af0c22..c524397 100644 --- a/control/zone.hpp +++ b/control/zone.hpp @@ -113,6 +113,16 @@ class Zone _properties[object][interface][property]); }; + /** + * @brief Get the default floor speed + * + * @return - The defined default floor speed + */ + inline auto getDefFloor() + { + return _defFloorSpeed; + }; + private: /** @@ -131,6 +141,11 @@ class Zone const size_t _zoneNum; /** + * The default floor speed for the zone + */ + const uint64_t _defFloorSpeed; + + /** * Automatic fan control active state */ bool _isActive = true; |