From e3d1c4a9f155cdd05660eb1cf5c334972a5b0aea Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Thu, 11 Jan 2018 13:53:49 -0600 Subject: Make event actions optional Event actions should be made optional for events that only require subscribing to group signals. This is in preparation for separating signal and timer based event actions. A use case would be where one event can be used to subscribe to signals that update cached property values without performing an action, and another timer based event performs an action based on those property values the signal event provides. Tested: Events without an action are generated correctly Events without an action are handled correctly and run no action Change-Id: I757a82ce6c45ac637ce7cea8f82a62b98b600e3e Signed-off-by: Matthew Barth --- control/gen-fan-zone-defs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'control') diff --git a/control/gen-fan-zone-defs.py b/control/gen-fan-zone-defs.py index 40bec2c..b89e5bc 100755 --- a/control/gen-fan-zone-defs.py +++ b/control/gen-fan-zone-defs.py @@ -393,8 +393,11 @@ def getEvent(zone_num, zone_conditions, e, events_data): return event['groups'] = grps - # Add set speed actions and function parameters - event['action'] = getActions(e, e, events_data) + # Add optional set speed actions and function parameters + event['action'] = [] + if ('actions' in e) and \ + (e['actions'] is not None): + event['action'] = getActions(e, e, events_data) # Add signal handlers signals = [] -- cgit v1.2.1