@lumiastream/tapo-cove 0.0.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/discovery.d.ts +8 -0
- package/dist/module/discovery.js +118 -0
- package/dist/module/index.d.ts +5 -0
- package/dist/module/index.js +12 -0
- package/dist/module/lightstate.d.ts +39 -0
- package/dist/module/lightstate.js +123 -0
- package/dist/module/shared/cipher.d.ts +11 -0
- package/dist/module/shared/cipher.js +66 -0
- package/dist/module/shared/color-transformer.d.ts +8 -0
- package/dist/module/shared/color-transformer.js +42 -0
- package/dist/module/shared/helpers.d.ts +5 -0
- package/dist/module/shared/helpers.js +105 -0
- package/dist/module/shared/tapo-ca-cert.d.ts +2 -0
- package/dist/module/shared/tapo-ca-cert.js +3 -0
- package/dist/module/shared/tapo.constants.d.ts +21 -0
- package/dist/module/shared/tapo.constants.js +25 -0
- package/dist/module/shared/utils.d.ts +23 -0
- package/dist/module/shared/utils.js +152 -0
- package/dist/module/tapo-api.d.ts +48 -0
- package/dist/module/tapo-api.js +142 -0
- package/dist/module/types/interfaces.d.ts +3 -0
- package/dist/module/types/interfaces.js +2 -0
- package/dist/module/types/raw-types.d.ts +84 -0
- package/dist/module/types/raw-types.js +2 -0
- package/lib/cjs/discovery.d.ts +8 -0
- package/lib/cjs/discovery.js +118 -0
- package/lib/cjs/index.d.ts +5 -0
- package/lib/cjs/index.js +12 -0
- package/lib/cjs/lightstate.d.ts +39 -0
- package/lib/cjs/lightstate.js +123 -0
- package/lib/cjs/shared/cipher.d.ts +11 -0
- package/lib/cjs/shared/cipher.js +66 -0
- package/lib/cjs/shared/color-transformer.d.ts +8 -0
- package/lib/cjs/shared/color-transformer.js +42 -0
- package/lib/cjs/shared/helpers.d.ts +5 -0
- package/lib/cjs/shared/helpers.js +105 -0
- package/lib/cjs/shared/tapo-ca-cert.d.ts +2 -0
- package/lib/cjs/shared/tapo-ca-cert.js +3 -0
- package/lib/cjs/shared/tapo.constants.d.ts +21 -0
- package/lib/cjs/shared/tapo.constants.js +25 -0
- package/lib/cjs/shared/utils.d.ts +23 -0
- package/lib/cjs/shared/utils.js +152 -0
- package/lib/cjs/tapo-api.d.ts +48 -0
- package/lib/cjs/tapo-api.js +142 -0
- package/lib/cjs/types/interfaces.d.ts +3 -0
- package/lib/cjs/types/interfaces.js +2 -0
- package/lib/cjs/types/raw-types.d.ts +84 -0
- package/lib/cjs/types/raw-types.js +2 -0
- package/lib/esm/discovery.d.ts +8 -0
- package/lib/esm/discovery.js +116 -0
- package/lib/esm/index.d.ts +5 -0
- package/lib/esm/index.js +5 -0
- package/lib/esm/lightstate.d.ts +39 -0
- package/lib/esm/lightstate.js +120 -0
- package/lib/esm/shared/cipher.d.ts +11 -0
- package/lib/esm/shared/cipher.js +56 -0
- package/lib/esm/shared/color-transformer.d.ts +8 -0
- package/lib/esm/shared/color-transformer.js +40 -0
- package/lib/esm/shared/helpers.d.ts +5 -0
- package/lib/esm/shared/helpers.js +98 -0
- package/lib/esm/shared/tapo-ca-cert.d.ts +2 -0
- package/lib/esm/shared/tapo-ca-cert.js +1 -0
- package/lib/esm/shared/tapo.constants.d.ts +21 -0
- package/lib/esm/shared/tapo.constants.js +22 -0
- package/lib/esm/shared/utils.d.ts +23 -0
- package/lib/esm/shared/utils.js +146 -0
- package/lib/esm/tapo-api.d.ts +48 -0
- package/lib/esm/tapo-api.js +140 -0
- package/lib/esm/types/interfaces.d.ts +3 -0
- package/lib/esm/types/interfaces.js +1 -0
- package/lib/esm/types/raw-types.d.ts +84 -0
- package/lib/esm/types/raw-types.js +1 -0
- package/package.json +38 -0
- package/test/auth.test.ts +22 -0
- package/test/discover.test.ts +9 -0
- package/test/light.test.ts +17 -0
- package/test/plug.test.ts +16 -0
- package/tslint.json +53 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LightState, TapoApi } from '../src';
|
|
2
|
+
|
|
3
|
+
const email = '';
|
|
4
|
+
const password = '';
|
|
5
|
+
const token = '';
|
|
6
|
+
const deviceId = '';
|
|
7
|
+
const deviceIp = '';
|
|
8
|
+
|
|
9
|
+
(async () => {
|
|
10
|
+
const api = new TapoApi({ token });
|
|
11
|
+
|
|
12
|
+
const devices = await api.setup({ email, password, devices: [{ id: deviceId, ip: deviceIp }] });
|
|
13
|
+
console.log('devices: ', devices);
|
|
14
|
+
|
|
15
|
+
const state = new LightState({ rgb: { r: 200, g: 0, b: 10 }, brightness: 100 });
|
|
16
|
+
await api.sendState({ device: { id: deviceId }, state });
|
|
17
|
+
})();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TapoApi } from '../src';
|
|
2
|
+
|
|
3
|
+
const email = '';
|
|
4
|
+
const password = '';
|
|
5
|
+
const token = '';
|
|
6
|
+
const deviceId = '';
|
|
7
|
+
const deviceIp = '';
|
|
8
|
+
|
|
9
|
+
(async () => {
|
|
10
|
+
const api = new TapoApi({ token });
|
|
11
|
+
|
|
12
|
+
const devices = await api.setup({ email, password, devices: [{ id: deviceId, ip: deviceIp }] });
|
|
13
|
+
console.log('devices: ', devices);
|
|
14
|
+
|
|
15
|
+
await api.sendPower({ device: { id: deviceId }, power: false });
|
|
16
|
+
})();
|
package/tslint.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier", "tslint-eslint-rules"],
|
|
3
|
+
"linterOptions": {
|
|
4
|
+
"exclude": [
|
|
5
|
+
"config/**/*.js",
|
|
6
|
+
"node_modules/**/*.ts",
|
|
7
|
+
"coverage/lcov-report/*.js"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"parser": "babel-eslint",
|
|
11
|
+
"parserOptions": {
|
|
12
|
+
"ecmaFeatures": {
|
|
13
|
+
"jsx": true
|
|
14
|
+
},
|
|
15
|
+
"ecmaVersion": 2018,
|
|
16
|
+
"sourceType": "module"
|
|
17
|
+
},
|
|
18
|
+
"plugins": [
|
|
19
|
+
"react"
|
|
20
|
+
],
|
|
21
|
+
"rules": {
|
|
22
|
+
"arrow-parens": true,
|
|
23
|
+
"arrow-return-shorthand": true,
|
|
24
|
+
"callable-types": false,
|
|
25
|
+
"curly": false,
|
|
26
|
+
"defaultSeverity": "warning",
|
|
27
|
+
"forin": false,
|
|
28
|
+
"indent": [true, "tabs", 2],
|
|
29
|
+
"jsx-alignment": false,
|
|
30
|
+
"jsx-boolean-value": 1,
|
|
31
|
+
"jsx-curly-spacing": 1,
|
|
32
|
+
"jsx-key": 1,
|
|
33
|
+
"jsx-no-lambda": false,
|
|
34
|
+
"linebreak-style": [true, "unix"],
|
|
35
|
+
"max-classes-per-file": false,
|
|
36
|
+
"member-access": false,
|
|
37
|
+
"no-console": false,
|
|
38
|
+
"no-debugger": false,
|
|
39
|
+
"no-empty": false,
|
|
40
|
+
"no-irregular-whitespace": true,
|
|
41
|
+
"no-unnecessary-initializer": true,
|
|
42
|
+
"no-unused-expression": false,
|
|
43
|
+
"no-unused-variable": false,
|
|
44
|
+
"object-curly-spacing": [true, "always"],
|
|
45
|
+
"object-literal-sort-keys": false,
|
|
46
|
+
"ordered-imports": false,
|
|
47
|
+
"prefer-conditional-expression": [true, "check-else-if"],
|
|
48
|
+
"prefer-object-spread": true,
|
|
49
|
+
"quotemark": [true, "single", "avoid-escape", "avoid-template"],
|
|
50
|
+
"semicolon": [true, "always", "ignore-bound-class-methods"],
|
|
51
|
+
"variable-name": false
|
|
52
|
+
}
|
|
53
|
+
}
|