Giter Site home page Giter Site logo

homebridge-tuya-cloud's People

Contributors

hak avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

homebridge-tuya-cloud's Issues

Failing NPM run build

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 :)

Describe Your Problem:
during installation, npm run build fails.

Logs:

> [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) {
                             ~~~~~~~~~~~~~~~~~~~~~~

  • Node.js Version: v12.18.2
  • NPM Version: 6.14.10
  • Operating System: macOS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.