@@ -3473,6 +3473,75 @@ def on_exec(self, args: argparse.Namespace):
34733473 print (AnimationMode (self .cmd .get_animation_mode ()))
34743474
34753475
3476+ @hw_settings .group ('wakeuptime' )
3477+ class HWSettingsWakeupTime (DeviceRequiredUnit ):
3478+ def args_parser (self ) -> ArgumentParserNoExit :
3479+ parser = ArgumentParserNoExit ()
3480+ return parser
3481+
3482+ def on_exec (self , args : argparse .Namespace ):
3483+ # Show help if no subcommand is provided
3484+ self .args_parser ().print_help ()
3485+
3486+
3487+ @HWSettingsWakeupTime .command ('button' )
3488+ class HWSettingsWakeupTimeButton (DeviceRequiredUnit ):
3489+ def args_parser (self ) -> ArgumentParserNoExit :
3490+ parser = ArgumentParserNoExit ()
3491+ parser .description = 'Get or set the button wake-up time (1000-60000 ms)'
3492+ parser .add_argument ('-s' , '--set' , type = int , required = False ,
3493+ help = 'Set wake-up time in milliseconds (1000-60000)' )
3494+ return parser
3495+
3496+ def on_exec (self , args : argparse .Namespace ):
3497+ if args .set is not None :
3498+ if not 1000 <= args .set <= 60000 :
3499+ print (f"{ CR } Error: Wake-up time must be between 1000 and 60000 milliseconds{ C0 } " )
3500+ return
3501+
3502+ resp = self .cmd .set_wakeup_button_time (args .set )
3503+ if resp .status == Status .SUCCESS :
3504+ print (f"Successfully set button wake-up time to { args .set } ms" )
3505+ print (f"{ CY } Do not forget to store your settings in flash!{ C0 } " )
3506+ else :
3507+ print (f"Failed to set button wake-up time: { Status (resp .status )} " )
3508+ else :
3509+ resp = self .cmd .get_wakeup_button_time ()
3510+ if resp .status == Status .SUCCESS :
3511+ print (f"Button wake-up time: { resp .parsed } ms" )
3512+ else :
3513+ print (f"Failed to get button wake-up time: { Status (resp .status )} " )
3514+
3515+
3516+ @HWSettingsWakeupTime .command ('field' )
3517+ class HWSettingsWakeupTimeField (DeviceRequiredUnit ):
3518+ def args_parser (self ) -> ArgumentParserNoExit :
3519+ parser = ArgumentParserNoExit ()
3520+ parser .description = 'Get or set the field detection wake-up time (1000-60000 ms)'
3521+ parser .add_argument ('-s' , '--set' , type = int , required = False ,
3522+ help = 'Set wake-up time in milliseconds (1000-60000)' )
3523+ return parser
3524+
3525+ def on_exec (self , args : argparse .Namespace ):
3526+ if args .set is not None :
3527+ if not 1000 <= args .set <= 60000 :
3528+ print (f"{ CR } Error: Wake-up time must be between 1000 and 60000 milliseconds{ C0 } " )
3529+ return
3530+
3531+ resp = self .cmd .set_wakeup_field_time (args .set )
3532+ if resp .status == Status .SUCCESS :
3533+ print (f"Successfully set field detection wake-up time to { args .set } ms" )
3534+ print (f"{ CY } Do not forget to store your settings in flash!{ C0 } " )
3535+ else :
3536+ print (f"Failed to set field detection wake-up time: { Status (resp .status )} " )
3537+ else :
3538+ resp = self .cmd .get_wakeup_field_time ()
3539+ if resp .status == Status .SUCCESS :
3540+ print (f"Field detection wake-up time: { resp .parsed } ms" )
3541+ else :
3542+ print (f"Failed to get field detection wake-up time: { Status (resp .status )} " )
3543+
3544+
34763545@hw_settings .command ('bleclearbonds' )
34773546class HWSettingsBleClearBonds (DeviceRequiredUnit ):
34783547
0 commit comments