Code Monkey home page Code Monkey logo

dirigera's People

Contributors

lpgera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cseitz stuartp44

dirigera's Issues

HTTPError on air purifier device

Heyo! Back again lol

I just bought an air purifier that should be controllable with dirigera, i have gotten it to turn on and off its statusLight using the setStatusLight function but the setMotorState function as shown in the example code in github is throwing the following error

HTTPError [DirigeraError]: {"error":"Error","message":"\"attributes\" does not match any of the allowed types"}
    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:633:26)
    at Request.emit (node:events:530: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',

This also gets thrown when i try to use the following code

await ikeaClient.devices.setAttributes({
          id: `5dba0600-d190-4d28-868d-fb70837b4973_1`,
          attributes: {
              motorState: 100
          },
      })

But im willing to accept that last part as incompetence on my end xd
Wouldnt be the first time. Im hoping you have some insight as to why this wouldnt work, or maybe i can be your test by proxy if you need :))

Question

Heyo, is there no way to query the on/off state of a device?
As of right now im querying all devices from my client and filtering for the ones that are part of the deviceSet that carries the same id as the deviceSet im looking for, then testing their states but this seems awfully janky.

client.lights.setLightLevel returns an uncaught error that doesnt make sense

Hello again, figured i would split the issues ive been facing as they seem to be unrelated.

When using the code below (example code from the documentation) i get the error shown below the code.

client.lights.setLightLevel({    
    id: 'deviceid',
    lightLevel: 10,
    transitionTime: 5000,
})
Error:
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

HTTPError [DirigeraError]: {"error":"Error","message":"\"attributes\" does not match any of the allowed types"}
    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',
  

Ill be happy to share more data where needed, but im not sure what you could need. I could of course set this functionality up using my own timer and setting the lightlevel lower every x seconds, but figured this ought to be fixed for other people using the lib.

client.outlets.get returning a weird error

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',

dirigera webpage question

Hey there

for my final school project I'm making a webpage from where I can control Iot devices but I barely found any documentation on IKEA API. I read through your documentation but I had a hard time telling which parts I could use in my project.

it would really help if you could provide a simple example, including initial configuration and how to set up, e.g., environment variables to open/close the IKEA smart wall socket.

thanks in advance

Add Nuxt Support

Hello,

Can you add Nuxt support for the moment i can't use dirigera libs on Nuxt app because os.networkInterfaces is not a function`

image
image

transitionTime does not seem supported

Heyo!
Ive been messing around with the library and found out that client.devices.setAttributes never takes the transitionTime attribute into consideration. My code is as follows

await client.devices.setAttributes({
        id: 'deviceid',
        attributes: {"lightLevel": 9, transitionTime: 100000}
      })

But the time taken is approximately 1 second regardless of the time provided in transitionTime. I cant seem to figure out any further way to log internal errors, so i hope you are able to point me in the right direction

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.