Parse and generate zone interfaces

Interfaces can optionally be defined on each zone to include setting
properties under those interfaces when fan control initializes the zone.
Setting the property values here allows them to be initialized to a
default value or set of values.

Change-Id: I75d51a05caa9e5662a0608d285fd388acc8593e2
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/templates/fan_zone_defs.mako.cpp b/control/templates/fan_zone_defs.mako.cpp
index a73449f..cb46986 100644
--- a/control/templates/fan_zone_defs.mako.cpp
+++ b/control/templates/fan_zone_defs.mako.cpp
@@ -45,6 +45,38 @@
                 ${zone['default_floor']},
                 ${zone['increase_delay']},
                 ${zone['decrease_interval']},
+                std::vector<ZoneHandler>{
+                    %if ('ifaces' in zone) and \
+                        (zone['ifaces'] is not None):
+                        %for i in zone['ifaces']:
+                            %if ('props' in i) and \
+                                (i['props'] is not None):
+                                %for p in i['props']:
+                    ZoneHandler{
+                        make_zoneHandler(handler::setZoneProperty(
+                            &Zone::${p['name']},
+                            static_cast<${p['type']}>(
+                                %if "vector" in p['type'] or "map" in p['type']:
+                                ${p['type']}{
+                                %endif
+                                %for i, v in enumerate(p['values']):
+                                %if (i+1) != len(p['values']):
+                                    ${v},
+                                %else:
+                                    ${v}
+                                %endif
+                                %endfor
+                                %if "vector" in p['type'] or "map" in p['type']:
+                                }
+                                %endif
+                            )
+                        ))
+                    },
+                                %endfor
+                            %endif
+                        %endfor
+                    %endif
+                },
                 std::vector<FanDefinition>{
                 %for fan in zone['fans']:
                     FanDefinition{