Hi! I was planning to expand the job you've done since I'm using some devices that will only work via Tuya Cloud API. I'm currently using a mini Nodejs server to poll them and rewrite easier API for HB Http plugin. It's the first time I'm dealing with developing a new plugin so I apologies!
I'm planning to expand it to switches and RBG Lights. Happy to contribute if I make it after this issue :)
> [email protected] build /Users/tommasotani/Downloads/homebridge-tuya-cloud-master
> rimraf ./dist && tsc
src/platform.ts:53:76 - error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'string'.
53 let sign = this.calc_sign(this.config.clientID + this.accessToken + t, this.config.secret);
~~~~~~~~~~~~~~~~~~
src/platform.ts:65:12 - error TS2769: No overload matches this call.
Overload 1 of 2, '(config: AxiosRequestConfig): AxiosPromise<any>', gave the following error.
Type 'unknown' is not assignable to type 'string | undefined'.
Type 'unknown' is not assignable to type 'string'.
Overload 2 of 2, '(url: string, config?: AxiosRequestConfig | undefined): AxiosPromise<any>', gave the following error.
Argument of type '{ headers: { client_id: unknown; sign: string; t: string; sign_method: string; }; url: string; baseURL: unknown; params: any; data: string; method: string; }' is not assignable to parameter of type 'string'.
65 return axios({
~~~~~~~
66 headers: headers,
~~~~~~~~~~~~~~~~~~~~~~~
...
71 method: "GET"
~~~~~~~~~~~~~~~~~~~
72 });
~~~~~~
node_modules/axios/index.d.ts:47:3
47 baseURL?: string;
~~~~~~~
The expected type comes from property 'baseURL' which is declared here on type 'AxiosRequestConfig'
src/platform.ts:131:26 - error TS2571: Object is of type 'unknown'.
131 for (const device of this.config.deviceList) {
~~~~~~~~~~~~~~~~~~~~~~