cli: add device name to output when changing settings using config command

This commit is contained in:
Peter F. Patel-Schneider 2021-02-15 12:15:50 -05:00
parent 8fccd84345
commit 4b52b77348
1 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ def run(receivers, args, find_receiver, find_device):
value = False
else:
raise Exception("%s: don't know how to interpret '%s' as boolean" % (setting.name, value))
print('Setting %s to %s' % (setting.name, value))
print('Setting %s of %s to %s' % (setting.name, dev.name, value))
elif setting.kind == _settings.KIND.range:
try:
@ -100,7 +100,7 @@ def run(receivers, args, find_receiver, find_device):
min, max = setting.range
if value < min or value > max:
raise Exception("%s: value '%s' out of bounds" % (setting.name, args.value))
print('Setting %s to %s' % (setting.name, value))
print('Setting %s of %s to %s' % (setting.name, dev.name, value))
elif setting.kind == _settings.KIND.choice:
value = args.value
@ -129,7 +129,7 @@ def run(receivers, args, find_receiver, find_device):
value = setting.choices[:][0]
else:
raise Exception('%s: possible values are [%s]' % (setting.name, ', '.join(str(v) for v in setting.choices)))
print('Setting %s to %r' % (setting.name, value))
print('Setting %s of %s to %s' % (setting.name, dev.name, value))
else:
raise Exception('NotImplemented')