@@ -597,6 +597,7 @@ def onConnected(interface):
597
597
598
598
# Handle the int/float/bool arguments
599
599
pref = None
600
+ fields = set ()
600
601
for pref in args .set :
601
602
found = False
602
603
field = splitCompoundName (pref [0 ].lower ())[0 ]
@@ -609,11 +610,19 @@ def onConnected(interface):
609
610
)
610
611
found = setPref (config , pref [0 ], pref [1 ])
611
612
if found :
613
+ fields .add (field )
612
614
break
613
615
614
616
if found :
615
617
print ("Writing modified preferences to device" )
616
- node .writeConfig (field )
618
+ if len (fields ) > 1 :
619
+ print ("Using a configuration transaction" )
620
+ node .beginSettingsTransaction ()
621
+ for field in fields :
622
+ print (f"Writing { field } configuration to device" )
623
+ node .writeConfig (field )
624
+ if len (fields ) > 1 :
625
+ node .commitSettingsTransaction ()
617
626
else :
618
627
if mt_config .camel_case :
619
628
print (
@@ -1417,7 +1426,7 @@ def addConfigArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
1417
1426
"--get" ,
1418
1427
help = (
1419
1428
"Get a preferences field. Use an invalid field such as '0' to get a list of all fields."
1420
- " Can use either snake_case or camelCase format. (ex: 'ls_secs' or 'lsSecs')"
1429
+ " Can use either snake_case or camelCase format. (ex: 'power. ls_secs' or 'power. lsSecs')"
1421
1430
),
1422
1431
nargs = 1 ,
1423
1432
action = "append" ,
@@ -1426,7 +1435,11 @@ def addConfigArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
1426
1435
1427
1436
group .add_argument (
1428
1437
"--set" ,
1429
- help = "Set a preferences field. Can use either snake_case or camelCase format. (ex: 'ls_secs' or 'lsSecs')" ,
1438
+ help = (
1439
+ "Set a preferences field. Can use either snake_case or camelCase format."
1440
+ " (ex: 'power.ls_secs' or 'power.lsSecs'). May be less reliable when"
1441
+ " setting properties from more than one configuration section."
1442
+ ),
1430
1443
nargs = 2 ,
1431
1444
action = "append" ,
1432
1445
metavar = ("FIELD" , "VALUE" ),
0 commit comments