@@ -86,6 +86,67 @@ const command: CommandModule<GlobalOptions> = {
8686 )
8787 }
8888 )
89+ . command (
90+ "update" ,
91+ "update a noise threshold" ,
92+ ( yargs ) => {
93+ return yargs
94+ . option ( "device_id" , {
95+ describe : "the device ID" ,
96+ type : "string" ,
97+ demandOption : true ,
98+ } )
99+ . option ( "noise_threshold_id" , {
100+ describe : "the noise threshold ID" ,
101+ type : "string" ,
102+ demandOption : true ,
103+ } )
104+ . option ( "name" , {
105+ describe : "the name of the noise threshold" ,
106+ type : "string" ,
107+ demandOption : false ,
108+ } )
109+ . option ( "starts_daily_at" , {
110+ describe : "the time the noise threshold starts" ,
111+ type : "string" ,
112+ demandOption : false ,
113+ } )
114+ . option ( "ends_daily_at" , {
115+ describe : "the time the noise threshold ends" ,
116+ type : "string" ,
117+ demandOption : false ,
118+ } )
119+ . option ( "noise_threshold_decibels" , {
120+ describe : "the noise threshold in decibels" ,
121+ type : "number" ,
122+ demandOption : false ,
123+ conflicts : "noise_threshold_nrs" ,
124+ } )
125+ . option ( "noise_threshold_nrs" , {
126+ describe : "the noise threshold in NRS" ,
127+ type : "number" ,
128+ demandOption : false ,
129+ conflicts : "noise_threshold_decibels" ,
130+ } )
131+ } ,
132+ async ( argv ) => {
133+ await executeCommand (
134+ "noiseThresholds.update" ,
135+ [
136+ {
137+ device_id : argv . device_id ,
138+ noise_threshold_id : argv . noise_threshold_id ,
139+ name : argv . name ,
140+ starts_daily_at : argv . starts_daily_at ,
141+ ends_daily_at : argv . ends_daily_at ,
142+ noise_threshold_decibels : argv . noise_threshold_decibels ,
143+ noise_threshold_nrs : argv . noise_threshold_nrs ,
144+ } ,
145+ ] ,
146+ argv
147+ )
148+ }
149+ )
89150 . command (
90151 "delete" ,
91152 "delete a noise threshold" ,
0 commit comments