Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transitionTime does not seem supported #4

Closed
KiterWork opened this issue Dec 27, 2023 · 6 comments
Closed

transitionTime does not seem supported #4

KiterWork opened this issue Dec 27, 2023 · 6 comments

Comments

@KiterWork
Copy link

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

@KiterWork
Copy link
Author

KiterWork commented Dec 28, 2023

image
looks like this could be the culprit?

@KiterWork
Copy link
Author

KiterWork commented Dec 28, 2023

Update i got it to work with the following code

await client.deviceSets.setAttributes({
        id: deviceSets[0].id,
        attributes: {
            lightLevel: 1
        },
        transitionTime: 10000
    })

Seems like theres something different in client.devices.setAttributes versus client.deviceSets.setAttributes

@KiterWork
Copy link
Author

Final update before closing: the docs are messed up, the syntax should be updated. lll make a pr.

@lpgera
Copy link
Owner

lpgera commented Dec 28, 2023

Sorry for the inconvenience, and thanks for your investigation! I hope I'll have time to check your findings and the PR by tomorrow! 🙂

@KiterWork
Copy link
Author

Hey! I forgot to update here, but i was a total idiot and the code is totally fine in the docs. The issue was that the setAttributes section didnt include example code so i didnt know i had to split the transitiontime outside of the attributes object.

@lpgera
Copy link
Owner

lpgera commented Dec 29, 2023

The issue was that the setAttributes section didnt include example code so i didnt know i had to split the transitiontime outside of the attributes object.

Noted! I'll try to make this clearer in the future.

I'm curious, are you using TypeScript in your own code? That, while doesn't replace a good documentation, but should help with these types of problems a little bit:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants