Since the things type used in functions such as getThingStatus() is a number, it may be difficult to understand the code.
/**
* Get Device Status
*
* @param options - The things information.
* @param options.type - The things type. 1: user's own device, 2: devices shared by others.
* @param options.id - The things id.
* @param options.params - option, The things params.
* @returns response - Please refer to the online API documentation
*/
So, I think it would be a good idea to change the things type to a string.
I suggest replacing type: number | 1 | 2; with type: 'own' | 'shared';.
Also, since most devices are owned by the user, it seems good to set the default to own.
Since the things type used in functions such as getThingStatus() is a number, it may be difficult to understand the code.
So, I think it would be a good idea to change the things type to a string. I suggest replacing
type: number | 1 | 2;
withtype: 'own' | 'shared';
.Also, since most devices are owned by the user, it seems good to set the default to
own
.