summaryrefslogtreecommitdiffstats
path: root/parse_led.py
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-01-20 18:42:21 +0530
committerVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-01-25 21:51:46 +0530
commit8a50a50a803860a853b1412899769678bed48f9e (patch)
treed568c2ebf797a02d87fee39997a3d2c21070e121 /parse_led.py
parented4907342897301ab96cbf2c617cafd78caf25a1 (diff)
downloadphosphor-led-manager-8a50a50a803860a853b1412899769678bed48f9e.tar.gz
phosphor-led-manager-8a50a50a803860a853b1412899769678bed48f9e.zip
Update led manager to consume DutyOn and Period values
Previous code only considered the Name and Action for the LED but then DutyOn and Period are also the properties that are associated with LED and this patchset handles that. Change-Id: Ifb57719ed3bcf01a4704618089d9ce676e4b951c Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
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