2
0
mirror of https://opendev.org/x/pyghmi synced 2026-03-27 21:33:31 +00:00

Show True and False as choices for booleans

Boolean settings inherently have choices to
offer, enumerate them for better help text.

Change-Id: Ibce17930f151244eaae0bc02759757c2070627cc
This commit is contained in:
Jarrod Johnson
2020-01-23 15:59:50 -05:00
parent a7900c24b6
commit 92771354aa

View File

@@ -918,6 +918,9 @@ class Command(object):
defaultval, defaultval)
if attr['Type'] == 'Integer' and defaultval:
defaultval = int(defaultval)
if attr['Type'] == 'Boolean':
vals = [{'ValueDisplayName': 'True'},
{'ValueDisplayName': 'False'}]
addon[attr['AttributeName']] = {
'default': defaultval,
'help': attr.get('HelpText', None),