@@ -41,8 +41,11 @@ def read_pdm_address(args, pa):
4141
4242
4343def new_pod (args , pa ):
44- pa ["id_lot" ] = args .id_lot
45- pa ["id_t" ] = args .id_t
44+
45+ if args .id_lot is not None :
46+ pa ["id_lot" ] = args .id_lot
47+ if args .id_t is not None :
48+ pa ["id_t" ] = args .id_t
4649 if args .radio_address is not None :
4750 if str (args .radio_address ).lower ().startswith ("0x" ):
4851 pa ["radio_address" ] = int (args .radio_address [2 :], 16 )
@@ -83,6 +86,10 @@ def activate(args, pa):
8386 call_api (args .url , REST_URL_ACTIVATE_POD , pa )
8487
8588
89+ def archive (args , pa ):
90+ call_api (args .url , REST_URL_ARCHIVE_POD , pa )
91+
92+
8693def start (args , pa ):
8794 for i in range (0 ,48 ):
8895 pa ["h" + str (i )] = args .basalrate
@@ -107,8 +114,8 @@ def main():
107114 subparser .set_defaults (func = read_pdm_address )
108115
109116 subparser = subparsers .add_parser ("newpod" , help = "newpod -h" )
110- subparser .add_argument ("id_lot" , type = int , help = "Lot number of the pod" )
111- subparser .add_argument ("id_t" , type = int , help = "Serial number of the pod" )
117+ subparser .add_argument ("id_lot" , type = int , help = "Lot number of the pod" , default = None , nargs = "?" )
118+ subparser .add_argument ("id_t" , type = int , help = "Serial number of the pod" , default = None , nargs = "?" )
112119 subparser .add_argument ("radio_address" , help = "Radio radio_address of the pod" , default = None , nargs = "?" )
113120 subparser .set_defaults (func = new_pod )
114121
@@ -147,6 +154,9 @@ def main():
147154 subparser = subparsers .add_parser ("restart" , help = "restart -h" )
148155 subparser .set_defaults (func = restart )
149156
157+ subparser = subparsers .add_parser ("archive" , help = "archive -h" )
158+ subparser .set_defaults (func = archive )
159+
150160 args = parser .parse_args ()
151161 pa = get_auth_params ()
152162 args .func (args , pa )
0 commit comments