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

Can't use it, many errors #15

Open
filipdns opened this issue Mar 26, 2024 · 3 comments
Open

Can't use it, many errors #15

filipdns opened this issue Mar 26, 2024 · 3 comments

Comments

@filipdns
Copy link

Hello,
First time for me using npm, so sorry if I'm doing it on wrong way but following all instructions, I got:

`
test.js:72:1
‼ 72:1 test.todo() should be not be used. ava/no-todo-test

index.js:32:1
‼ 44:1 Function TuyaCloud has a complexity of 23. complexity
× 32:1 Line 32 exceeds the maximum line length of 90. max-len
× 33:1 Line 33 exceeds the maximum line length of 90. max-len
× 35:1 Line 35 exceeds the maximum line length of 90. max-len
× 61:1 Line 61 exceeds the maximum line length of 90. max-len
× 62:1 Line 62 exceeds the maximum line length of 90. max-len
× 83:3 Closing curly brace does not appear on the same line as the subsequent block. brace-style
× 95:1 Expected indentation of 4 spaces but found 6. indent
× 96:1 Expected indentation of 4 spaces but found 6. indent
× 385:1 Expected indentation of 6 spaces but found 8.
`
Could you help me please?

Kind regards
Philippe

@Apollon77
Copy link
Contributor

Why you execute the tests if you want to use it? Just do not execute the tests and just use it :-)

@filipdns
Copy link
Author

I try to execute it because I want to see if it's working and how it's working lol and if my ident for api is accepted

@filipdns
Copy link
Author

filipdns commented Mar 26, 2024

To use it, if I understand correctly, I can paste your sample usage in test.js:
``
const Cloud = require('@tuyapi/cloud');

let api = new Cloud({key: 'your-api-app-key', secret: 'your-api-app-secret'});

api.register({email: '[email protected]', password: 'example-password'}).then(async sid => {
let token = await api.request({action: 'tuya.m.device.token.create', data: {'timeZone': '-05:00'}});

console.log(token) // => { secret: '0000', token: '01010101' }
});
``
and replace your-api-app-key, your-api-app-secret, [email protected], example-password with my own information and then run node test.js

doing that, I got same errors.

I did make the keys.json with my informations with add region: EU in case but same result.

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