@@ -57,12 +57,13 @@ class Switchbot {
5757 * - duration | Integer | Optional | Duration for discovery process (msec).
5858 * | | | The value must be in the range of 1 to 60000.
5959 * | | | The default value is 5000 (msec).
60- * - model | String | Optional | "H", "T", "M ", "CS ", or "c".
60+ * - model | String | Optional | "H", "T", "e ", "s", "d ", or "c".
6161 * | | | If "H" is specified, this method will discover only Bots.
6262 * | | | If "T" is specified, this method will discover only Meters.
63- * | | | If "M" is specified, this method will discover only Motion Sensors.
64- * | | | If "CS" is specified, this method will discover only Contact Sensors.
65- * | | | If "C" is specified, this method will discover only Curtains.
63+ * | | | If "e" is specified, this method will discover only Humidifiers.
64+ * | | | If "s" is specified, this method will discover only Motion Sensors.
65+ * | | | If "d" is specified, this method will discover only Contact Sensors.
66+ * | | | If "c" is specified, this method will discover only Curtains.
6667 * - id | String | Optional | If this value is set, this method willl discover
6768 * | | | only a device whose ID is as same as this value.
6869 * | | | The ID is identical to the MAC address.
@@ -84,7 +85,7 @@ class Switchbot {
8485 // Check the parameters
8586 let valid = parameterChecker . check ( params , {
8687 duration : { required : false , type : 'integer' , min : 1 , max : 60000 } ,
87- model : { required : false , type : 'string' , enum : [ 'H' , 'h' , 'T ', 'P ' , 'C ' , 'c' ] } ,
88+ model : { required : false , type : 'string' , enum : [ 'H' , 'T' , 'e ', 's ' , 'd ' , 'c' ] } ,
8889 id : { required : false , type : 'string' , min : 12 , max : 17 } ,
8990 quick : { required : false , type : 'boolean' }
9091 } , false ) ;
@@ -191,16 +192,16 @@ class Switchbot {
191192 case 'H' :
192193 device = new SwitchbotDeviceWoHand ( peripheral , this . noble ) ;
193194 break ;
194- case 'Hu ' :
195+ case 'e ' :
195196 device = new SwitchbotDeviceWoHumi ( peripheral , this . noble ) ;
196197 break ;
197198 case 'T' :
198199 device = new SwitchbotDeviceWoSensorTH ( peripheral , this . noble ) ;
199200 break ;
200- case 'M ' :
201+ case 's ' :
201202 device = new SwitchbotDeviceWoPresence ( peripheral , this . noble ) ;
202203 break ;
203- case 'CS ' :
204+ case 'd ' :
204205 device = new SwitchbotDeviceWoContact ( peripheral , this . noble ) ;
205206 break ;
206207 case 'c' :
@@ -240,20 +241,23 @@ class Switchbot {
240241 *
241242 * [Arguments]
242243 * - params | Object | Optional |
243- * - model | String | Optional | "H", "T", "M ", "CS ", or "C ".
244+ * - model | String | Optional | "H", "T", "e ", "s ", "d", or "c ".
244245 * | | | If "H" is specified, the `onadvertisement`
245246 * | | | event hander will be called only when advertising
246247 * | | | packets comes from Bots.
247248 * | | | If "T" is specified, the `onadvertisement`
248249 * | | | event hander will be called only when advertising
249250 * | | | packets comes from Meters.
250- * | | | If "M" is specified, the `onadvertisement`
251+ * | | | If "e" is specified, the `onadvertisement`
252+ * | | | event hander will be called only when advertising
253+ * | | | packets comes from Humidifiers.
254+ * | | | If "s" is specified, the `onadvertisement`
251255 * | | | event hander will be called only when advertising
252256 * | | | packets comes from Motion Sensor.
253- * | | | If "CS " is specified, the `onadvertisement`
257+ * | | | If "d " is specified, the `onadvertisement`
254258 * | | | event hander will be called only when advertising
255259 * | | | packets comes from Contact Sensor.
256- * | | | If "C " is specified, the `onadvertisement`
260+ * | | | If "c " is specified, the `onadvertisement`
257261 * | | | event hander will be called only when advertising
258262 * | | | packets comes from Curtains.
259263 * - id | String | Optional | If this value is set, the `onadvertisement`
@@ -272,7 +276,7 @@ class Switchbot {
272276 let promise = new Promise ( ( resolve , reject ) => {
273277 // Check the parameters
274278 let valid = parameterChecker . check ( params , {
275- model : { required : false , type : 'string' , enum : [ 'H' , 'h ' , 'T ' , 'P ' , 'C ' , 'c' ] } ,
279+ model : { required : false , type : 'string' , enum : [ 'H' , 'T ' , 'e ' , 's ' , 'd ' , 'c' ] } ,
276280 id : { required : false , type : 'string' , min : 12 , max : 17 } ,
277281 } , false ) ;
278282
0 commit comments