@@ -31,6 +31,61 @@ const command: CommandModule<GlobalOptions> = {
3131 )
3232 }
3333 )
34+ . command (
35+ "create" ,
36+ "create a noise threshold" ,
37+ ( yargs ) => {
38+ return yargs
39+ . option ( "device_id" , {
40+ describe : "the device ID" ,
41+ type : "string" ,
42+ demandOption : true ,
43+ } )
44+ . option ( "name" , {
45+ describe : "the name of the noise threshold" ,
46+ type : "string" ,
47+ demandOption : false ,
48+ } )
49+ . option ( "starts_daily_at" , {
50+ describe : "the time the noise threshold starts" ,
51+ type : "string" ,
52+ demandOption : true ,
53+ } )
54+ . option ( "ends_daily_at" , {
55+ describe : "the time the noise threshold ends" ,
56+ type : "string" ,
57+ demandOption : true ,
58+ } )
59+ . option ( "noise_threshold_decibels" , {
60+ describe : "the noise threshold in decibels" ,
61+ type : "number" ,
62+ demandOption : false ,
63+ conflicts : "noise_threshold_nrs" ,
64+ } )
65+ . option ( "noise_threshold_nrs" , {
66+ describe : "the noise threshold in NRS" ,
67+ type : "number" ,
68+ demandOption : false ,
69+ conflicts : "noise_threshold_decibels" ,
70+ } )
71+ } ,
72+ async ( argv ) => {
73+ await executeCommand (
74+ "noiseThresholds.create" ,
75+ [
76+ {
77+ device_id : argv . device_id ,
78+ name : argv . name ,
79+ starts_daily_at : argv . starts_daily_at ,
80+ ends_daily_at : argv . ends_daily_at ,
81+ noise_threshold_decibels : argv . noise_threshold_decibels ,
82+ noise_threshold_nrs : argv . noise_threshold_nrs ,
83+ } ,
84+ ] ,
85+ argv
86+ )
87+ }
88+ )
3489 . command (
3590 "delete" ,
3691 "delete a noise threshold" ,
0 commit comments