TuyaAPI / cli

🔧 A CLI for Tuya devices
MIT License
270 stars 44 forks source link

Device registered, Device failed to be registered #110

Closed Adrian-at-CrimsonAzure closed 3 years ago

Adrian-at-CrimsonAzure commented 3 years ago

I get his error when running the link command:

{ GotError: Invalid value "undefined" for header "access_token"
    at get (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/request-as-event-emitter.js:200:27)
    at ClientRequest.setHeader (_http_outgoing.js:473:3)
    at new ClientRequest (_http_client.js:203:14)
    at Object.request (https.js:289:10)
    at get (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/request-as-event-emitter.js:197:65) name: 'RequestError', code: 'ERR_HTTP_INVALID_HEADER_VALUE' }

The device still shows in the Tuya device list, but tuya-cli doesn't print out the localkey and seems to error out.

loglux commented 3 years ago

Have the same issue


[ { GotError: Invalid value "undefined" for header "access_token"
      at get (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/request-as-event-emitter.js:200:27)
      at ClientRequest.setHeader (_http_outgoing.js:473:3)
      at new ClientRequest (_http_client.js:203:14)
      at Object.request (https.js:289:10)
      at get (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/request-as-event-emitter.js:197:65) name: 'RequestError', code: 'ERR_HTTP_INVALID_HEADER_VALUE' },
  { GotError: Invalid value "undefined" for header "access_token"
      at get (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/request-as-event-emitter.js:200:27)
      at ClientRequest.setHeader (_http_outgoing.js:473:3)
      at new ClientRequest (_http_client.js:203:14)
      at Object.request (https.js:289:10)
      at get (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/request-as-event-emitter.js:197:65) name: 'RequestError', code: 'ERR_HTTP_INVALID_HEADER_VALUE' },
  { GotError: Invalid value "undefined" for header "access_token"
      at get (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/request-as-event-emitter.js:200:27)
      at ClientRequest.setHeader (_http_outgoing.js:473:3)
      at new ClientRequest (_http_client.js:203:14)
      at Object.request (https.js:289:10)
      at get (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/request-as-event-emitter.js:197:65) name: 'RequestError', code: 'ERR_HTTP_INVALID_HEADER_VALUE' } ]
codetheweb commented 3 years ago

Combining with https://github.com/codetheweb/tuyapi/issues/411 for better visibility; please follow that issue for details.