summaryrefslogtreecommitdiffstats
path: root/parse_led.py
diff options
context:
space:
mode:
Diffstat (limited to 'parse_led.py')
-rwxr-xr-xparse_led.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/parse_led.py b/parse_led.py
index 35f67aa..c86764c 100755
--- a/parse_led.py
+++ b/parse_led.py
@@ -15,15 +15,23 @@ if __name__ == '__main__':
ofile.write(' std::set<phosphor::led::Layout::LedAction>>')
ofile.write(' systemLedMap = {\n\n')
for group in ifile.iterkeys():
- # Value of this group is a std::set<string, led structure>
+ # This section generates an std::map of LedGroupNames to std::set
+ # of LEDs containing the name and properties
ledset = ifile[group]
ofile.write(' {\"' + "/xyz/openbmc_project/ledmanager/groups/" + group + '\",{\n')
for led_dict, list_dict in ledset.iteritems():
+ # Need this to make sure the LED name is printed once
+ name_printed = False
for name, value in list_dict.iteritems():
- if group and led_dict and name and value:
- ofile.write(' {\"' + led_dict + '\",')
- ofile.write('phosphor::led::Layout::' + value + '},\n')
+ if group and led_dict and name:
+ if name_printed is False:
+ ofile.write(' {\"' + led_dict + '\",')
+ name_printed = True
+ if name == 'Action':
+ ofile.write('phosphor::led::Layout::')
+ ofile.write(str(value) + ',')
+ ofile.write('},\n')
ofile.write(' }},\n')
ofile.write('};\n')
OpenPOWER on IntegriCloud