Generate list of property change signals
Add the list of property(s) associated to a set speed event where the
handler updates the property cached on the zone for the action
Change-Id: Ifac61dda6eb200ca28735ddfaab3d34c9a9df758
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/gen-fan-zone-defs.py b/control/gen-fan-zone-defs.py
index 97d62ea..a779f34 100755
--- a/control/gen-fan-zone-defs.py
+++ b/control/gen-fan-zone-defs.py
@@ -16,6 +16,7 @@
#include "manager.hpp"
#include "functor.hpp"
#include "actions.hpp"
+#include "handlers.hpp"
using namespace phosphor::fan::control;
@@ -61,6 +62,23 @@
%endif
%endfor
)),
+ std::vector<PropertyChange>{
+ %for signal in event['signal']:
+ PropertyChange{
+ "interface='org.freedesktop.DBus.Properties',"
+ "member='PropertiesChanged',"
+ "type='signal',"
+ "path='${signal['path']}'",
+ make_handler(propertySignal<${signal['type']}>(
+ "${signal['interface']}",
+ "${signal['property']}",
+ handler::setProperty<${signal['type']}>(
+ "${signal['member']}",
+ "${signal['property']}"
+ )
+ ))},
+ %endfor
+ }
},
%endfor
}
@@ -93,6 +111,7 @@
if g['name'] == e['group'])
for member in groups['members']:
members = {}
+ members['type'] = groups['type']
members['name'] = ("/xyz/openbmc_project/" +
groups['type'] +
member)
@@ -125,6 +144,18 @@
action['parameters'] = params
event['action'] = action
+ # Add property change signal handler
+ signal = []
+ for path in group:
+ signals = {}
+ signals['path'] = path['name']
+ signals['interface'] = e['interface']
+ signals['property'] = e['property']['name']
+ signals['type'] = e['property']['type']
+ signals['member'] = path['name']
+ signal.append(signals)
+ event['signal'] = signal
+
events.append(event)
return events