lpgera / dirigera

An unofficial TypeScript client library for IKEA's DIRIGERA smart home hub
https://www.npmjs.com/package/dirigera
MIT License
50 stars 2 forks source link

client.outlets.get returning a weird error #7

Closed KiterWork closed 9 months ago

KiterWork commented 9 months ago

Experiencing the below error with the following code where the id is taken from the output of client.outlets.list()

await client.outlets.get("b1b61fce-0a25-47f4-8bd2-f604d8a65586_1")
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

HTTPError [DirigeraError]: {"error":"Error","message":"invalid device id: undefined"}
    at Request.<anonymous> (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Object.onceWrapper (node:events:627:26)
    at Request.emit (node:events:524:35)
    at Request._onResponseBase (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/core/index.js:603:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Request._onResponse (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/core/index.js:645:13) {
  input: undefined,
  code: 'ERR_NON_2XX_3XX_RESPONSE',
KiterWork commented 9 months ago

Function takes an object not a string. Im an idiot