From a956184bfe6afa6803fc4456eea1f5b6742d8f80 Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Thu, 29 Jun 2017 11:43:45 -0500 Subject: Add increase & decrease timer values in seconds Support setting the increase delay time(in seconds) for each zone from the zone yaml file. Speed increases use a delay type timer where the amount of time given delays additional increase requests from happening until the fans within the zone reach the highest net increase in speeds. Support setting the decrease interval time(in seconds) for each zone from the zone yaml file. Since decreasing is done on an interval, a decrease interval time of zero disables the decrease interval timer causing no decreases in speed to occur. Speed decreases use an interval type timer to decrease the fan speeds within the zone when no speed increase requests exist on the given time interval. Change-Id: I88334a313b6e2820b768fa7e3f1cb65887f29258 Signed-off-by: Matthew Barth --- control/gen-fan-zone-defs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'control/gen-fan-zone-defs.py') diff --git a/control/gen-fan-zone-defs.py b/control/gen-fan-zone-defs.py index adef86a..177bfe0 100755 --- a/control/gen-fan-zone-defs.py +++ b/control/gen-fan-zone-defs.py @@ -50,6 +50,8 @@ const std::vector Manager::_zoneLayouts ${zone['num']}, ${zone['full_speed']}, ${zone['default_floor']}, + ${zone['increase_delay']}, + ${zone['decrease_interval']}, std::vector{ %for fan in zone['fans']: FanDefinition{ @@ -311,6 +313,14 @@ def buildZoneData(zone_data, fan_data, events_data, zone_conditions_data): zone['default_floor'] = z['default_floor'] + # 'increase_delay' is optional (use 0 by default) + key = 'increase_delay' + zone[key] = z.setdefault(key, 0) + + # 'decrease_interval' is optional (use 0 by default) + key = 'decrease_interval' + zone[key] = z.setdefault(key, 0) + # 'cooling_profiles' is optional (use 'all' instead) if ('cooling_profiles' not in z) or \ (z['cooling_profiles'] is None): -- cgit v1.2.1