@lumiastream/tapo-cove 3.6.1 → 3.10.0
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/CHANGELOG.md +8 -0
- package/dist/index.d.mts +146 -0
- package/dist/index.d.ts +119 -119
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.10.0](https://github.com/lumiastream/rgb/compare/v3.9.0...v3.10.0) (2023-08-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @lumiastream/tapo-cove
|
|
9
|
+
|
|
10
|
+
# [3.9.0](https://github.com/lumiastream/rgb/compare/v3.8.1...v3.9.0) (2023-08-15)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @lumiastream/tapo-cove
|
|
13
|
+
|
|
6
14
|
## [3.6.1](https://github.com/lumiastream/rgb/compare/v3.6.0...v3.6.1) (2023-05-03)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @lumiastream/tapo-cove
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { ILumiaDeviceType } from '@lumiastream/lumia-rgb-types';
|
|
2
|
+
|
|
3
|
+
declare const discover: (config: {
|
|
4
|
+
token?: string;
|
|
5
|
+
email?: string;
|
|
6
|
+
password?: string;
|
|
7
|
+
types?: ILumiaDeviceType[];
|
|
8
|
+
}) => Promise<any>;
|
|
9
|
+
|
|
10
|
+
declare class SuperState {
|
|
11
|
+
protected _values: Record<string, boolean | string | number>;
|
|
12
|
+
transition: (value: number) => this;
|
|
13
|
+
duration: (value: number) => this;
|
|
14
|
+
getValues: () => Record<string, string | number | boolean>;
|
|
15
|
+
}
|
|
16
|
+
declare class LightState extends SuperState {
|
|
17
|
+
constructor(values?: {
|
|
18
|
+
on: boolean;
|
|
19
|
+
});
|
|
20
|
+
create: (values?: {
|
|
21
|
+
[x: string]: any;
|
|
22
|
+
} | undefined) => this;
|
|
23
|
+
on: (value?: boolean) => this;
|
|
24
|
+
turnOn: (value?: boolean) => this;
|
|
25
|
+
off: () => this;
|
|
26
|
+
turnOff: () => this;
|
|
27
|
+
mode: (value?: string) => this;
|
|
28
|
+
hue: (value: number) => this;
|
|
29
|
+
bri: (value: number) => this;
|
|
30
|
+
brightness: (value: number) => this;
|
|
31
|
+
sat: (value: number) => this;
|
|
32
|
+
saturation: (value: number) => this;
|
|
33
|
+
temp: (value: number) => this;
|
|
34
|
+
colorTemperature: (value: number) => this;
|
|
35
|
+
hsv: (value: [
|
|
36
|
+
number,
|
|
37
|
+
number,
|
|
38
|
+
number
|
|
39
|
+
] | {
|
|
40
|
+
h: number;
|
|
41
|
+
s: number;
|
|
42
|
+
v: number;
|
|
43
|
+
}) => this;
|
|
44
|
+
rgb: (value: [
|
|
45
|
+
number,
|
|
46
|
+
number,
|
|
47
|
+
number
|
|
48
|
+
] | {
|
|
49
|
+
r: number;
|
|
50
|
+
g: number;
|
|
51
|
+
b: number;
|
|
52
|
+
}) => this;
|
|
53
|
+
color: (value: {
|
|
54
|
+
ct?: number;
|
|
55
|
+
r?: number;
|
|
56
|
+
g?: number;
|
|
57
|
+
b?: number;
|
|
58
|
+
}) => this;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
type TapoDeviceKey = {
|
|
62
|
+
key: string | Buffer;
|
|
63
|
+
iv: string | Buffer;
|
|
64
|
+
deviceIp: string;
|
|
65
|
+
sessionCookie: string;
|
|
66
|
+
token?: string;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
declare class TapoApi {
|
|
70
|
+
_baseUrl: string;
|
|
71
|
+
_baseTapoCareUrl: string;
|
|
72
|
+
private axiosInstance;
|
|
73
|
+
private _config;
|
|
74
|
+
private _token;
|
|
75
|
+
private _devices;
|
|
76
|
+
constructor(config?: {
|
|
77
|
+
token?: string;
|
|
78
|
+
timeout?: number;
|
|
79
|
+
httpTimeout?: number;
|
|
80
|
+
});
|
|
81
|
+
auth: ({ email, password }: {
|
|
82
|
+
email: string;
|
|
83
|
+
password: string;
|
|
84
|
+
}) => Promise<string>;
|
|
85
|
+
setup: ({ email, password, devices }: {
|
|
86
|
+
email: string;
|
|
87
|
+
password: string;
|
|
88
|
+
devices: Array<{
|
|
89
|
+
id: string;
|
|
90
|
+
host: string;
|
|
91
|
+
}>;
|
|
92
|
+
}) => Promise<Map<string, TapoDeviceKey>>;
|
|
93
|
+
sendState: (config: {
|
|
94
|
+
device: {
|
|
95
|
+
id: string;
|
|
96
|
+
};
|
|
97
|
+
state: LightState;
|
|
98
|
+
fetchConfig?: {
|
|
99
|
+
shouldWait: boolean;
|
|
100
|
+
};
|
|
101
|
+
}) => Promise<any>;
|
|
102
|
+
sendPower: (config: {
|
|
103
|
+
device: {
|
|
104
|
+
id: string;
|
|
105
|
+
};
|
|
106
|
+
power: boolean;
|
|
107
|
+
}) => void;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare const TapoDeviceTypes: {
|
|
111
|
+
ALL: string;
|
|
112
|
+
BULBS: string;
|
|
113
|
+
LIGHTSTRIPS: string;
|
|
114
|
+
PLUGS: string;
|
|
115
|
+
};
|
|
116
|
+
declare enum ETapoDeviceTypes {
|
|
117
|
+
ALL = "all",
|
|
118
|
+
BULBS = "bulb",
|
|
119
|
+
LIGHTSTRIPS = "lightstrip",
|
|
120
|
+
PLUGS = "plug"
|
|
121
|
+
}
|
|
122
|
+
declare const DeviceResTypes: {
|
|
123
|
+
BULB: string;
|
|
124
|
+
PLUG: string;
|
|
125
|
+
};
|
|
126
|
+
declare const DeviceSendValues: {
|
|
127
|
+
BULB: string;
|
|
128
|
+
LIGHTSTRIP: string;
|
|
129
|
+
PLUG: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
declare const tapo_constants_DeviceResTypes: typeof DeviceResTypes;
|
|
133
|
+
declare const tapo_constants_DeviceSendValues: typeof DeviceSendValues;
|
|
134
|
+
type tapo_constants_ETapoDeviceTypes = ETapoDeviceTypes;
|
|
135
|
+
declare const tapo_constants_ETapoDeviceTypes: typeof ETapoDeviceTypes;
|
|
136
|
+
declare const tapo_constants_TapoDeviceTypes: typeof TapoDeviceTypes;
|
|
137
|
+
declare namespace tapo_constants {
|
|
138
|
+
export {
|
|
139
|
+
tapo_constants_DeviceResTypes as DeviceResTypes,
|
|
140
|
+
tapo_constants_DeviceSendValues as DeviceSendValues,
|
|
141
|
+
tapo_constants_ETapoDeviceTypes as ETapoDeviceTypes,
|
|
142
|
+
tapo_constants_TapoDeviceTypes as TapoDeviceTypes,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { LightState, TapoApi, tapo_constants as TapoConstants, discover };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,132 +1,132 @@
|
|
|
1
1
|
import { ILumiaDeviceType } from '@lumiastream/lumia-rgb-types';
|
|
2
2
|
|
|
3
|
-
declare const discover: (config: {
|
|
4
|
-
token?: string;
|
|
5
|
-
email?: string;
|
|
6
|
-
password?: string;
|
|
7
|
-
types?: ILumiaDeviceType[];
|
|
3
|
+
declare const discover: (config: {
|
|
4
|
+
token?: string;
|
|
5
|
+
email?: string;
|
|
6
|
+
password?: string;
|
|
7
|
+
types?: ILumiaDeviceType[];
|
|
8
8
|
}) => Promise<any>;
|
|
9
9
|
|
|
10
|
-
declare class SuperState {
|
|
11
|
-
protected _values: Record<string, boolean | string | number>;
|
|
12
|
-
transition: (value: number) => this;
|
|
13
|
-
duration: (value: number) => this;
|
|
14
|
-
getValues: () => Record<string, string | number | boolean>;
|
|
15
|
-
}
|
|
16
|
-
declare class LightState extends SuperState {
|
|
17
|
-
constructor(values?: {
|
|
18
|
-
on: boolean;
|
|
19
|
-
});
|
|
20
|
-
create: (values?: {
|
|
21
|
-
[x: string]: any;
|
|
22
|
-
} | undefined) => this;
|
|
23
|
-
on: (value?: boolean) => this;
|
|
24
|
-
turnOn: (value?: boolean) => this;
|
|
25
|
-
off: () => this;
|
|
26
|
-
turnOff: () => this;
|
|
27
|
-
mode: (value?: string) => this;
|
|
28
|
-
hue: (value: number) => this;
|
|
29
|
-
bri: (value: number) => this;
|
|
30
|
-
brightness: (value: number) => this;
|
|
31
|
-
sat: (value: number) => this;
|
|
32
|
-
saturation: (value: number) => this;
|
|
33
|
-
temp: (value: number) => this;
|
|
34
|
-
colorTemperature: (value: number) => this;
|
|
35
|
-
hsv: (value: [
|
|
36
|
-
number,
|
|
37
|
-
number,
|
|
38
|
-
number
|
|
39
|
-
] | {
|
|
40
|
-
h: number;
|
|
41
|
-
s: number;
|
|
42
|
-
v: number;
|
|
43
|
-
}) => this;
|
|
44
|
-
rgb: (value: [
|
|
45
|
-
number,
|
|
46
|
-
number,
|
|
47
|
-
number
|
|
48
|
-
] | {
|
|
49
|
-
r: number;
|
|
50
|
-
g: number;
|
|
51
|
-
b: number;
|
|
52
|
-
}) => this;
|
|
53
|
-
color: (value: {
|
|
54
|
-
ct?: number;
|
|
55
|
-
r?: number;
|
|
56
|
-
g?: number;
|
|
57
|
-
b?: number;
|
|
58
|
-
}) => this;
|
|
10
|
+
declare class SuperState {
|
|
11
|
+
protected _values: Record<string, boolean | string | number>;
|
|
12
|
+
transition: (value: number) => this;
|
|
13
|
+
duration: (value: number) => this;
|
|
14
|
+
getValues: () => Record<string, string | number | boolean>;
|
|
15
|
+
}
|
|
16
|
+
declare class LightState extends SuperState {
|
|
17
|
+
constructor(values?: {
|
|
18
|
+
on: boolean;
|
|
19
|
+
});
|
|
20
|
+
create: (values?: {
|
|
21
|
+
[x: string]: any;
|
|
22
|
+
} | undefined) => this;
|
|
23
|
+
on: (value?: boolean) => this;
|
|
24
|
+
turnOn: (value?: boolean) => this;
|
|
25
|
+
off: () => this;
|
|
26
|
+
turnOff: () => this;
|
|
27
|
+
mode: (value?: string) => this;
|
|
28
|
+
hue: (value: number) => this;
|
|
29
|
+
bri: (value: number) => this;
|
|
30
|
+
brightness: (value: number) => this;
|
|
31
|
+
sat: (value: number) => this;
|
|
32
|
+
saturation: (value: number) => this;
|
|
33
|
+
temp: (value: number) => this;
|
|
34
|
+
colorTemperature: (value: number) => this;
|
|
35
|
+
hsv: (value: [
|
|
36
|
+
number,
|
|
37
|
+
number,
|
|
38
|
+
number
|
|
39
|
+
] | {
|
|
40
|
+
h: number;
|
|
41
|
+
s: number;
|
|
42
|
+
v: number;
|
|
43
|
+
}) => this;
|
|
44
|
+
rgb: (value: [
|
|
45
|
+
number,
|
|
46
|
+
number,
|
|
47
|
+
number
|
|
48
|
+
] | {
|
|
49
|
+
r: number;
|
|
50
|
+
g: number;
|
|
51
|
+
b: number;
|
|
52
|
+
}) => this;
|
|
53
|
+
color: (value: {
|
|
54
|
+
ct?: number;
|
|
55
|
+
r?: number;
|
|
56
|
+
g?: number;
|
|
57
|
+
b?: number;
|
|
58
|
+
}) => this;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
type TapoDeviceKey = {
|
|
62
|
-
key: string | Buffer;
|
|
63
|
-
iv: string | Buffer;
|
|
64
|
-
deviceIp: string;
|
|
65
|
-
sessionCookie: string;
|
|
66
|
-
token?: string;
|
|
61
|
+
type TapoDeviceKey = {
|
|
62
|
+
key: string | Buffer;
|
|
63
|
+
iv: string | Buffer;
|
|
64
|
+
deviceIp: string;
|
|
65
|
+
sessionCookie: string;
|
|
66
|
+
token?: string;
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
declare class TapoApi {
|
|
70
|
-
_baseUrl: string;
|
|
71
|
-
_baseTapoCareUrl: string;
|
|
72
|
-
private axiosInstance;
|
|
73
|
-
private _config;
|
|
74
|
-
private _token;
|
|
75
|
-
private _devices;
|
|
76
|
-
constructor(config?: {
|
|
77
|
-
token?: string;
|
|
78
|
-
timeout?: number;
|
|
79
|
-
httpTimeout?: number;
|
|
80
|
-
});
|
|
81
|
-
auth: ({ email, password }: {
|
|
82
|
-
email: string;
|
|
83
|
-
password: string;
|
|
84
|
-
}) => Promise<string>;
|
|
85
|
-
setup: ({ email, password, devices }: {
|
|
86
|
-
email: string;
|
|
87
|
-
password: string;
|
|
88
|
-
devices: Array<{
|
|
89
|
-
id: string;
|
|
90
|
-
host: string;
|
|
91
|
-
}>;
|
|
92
|
-
}) => Promise<Map<string, TapoDeviceKey>>;
|
|
93
|
-
sendState: (config: {
|
|
94
|
-
device: {
|
|
95
|
-
id: string;
|
|
96
|
-
};
|
|
97
|
-
state: LightState;
|
|
98
|
-
fetchConfig?: {
|
|
99
|
-
shouldWait: boolean;
|
|
100
|
-
};
|
|
101
|
-
}) => Promise<any>;
|
|
102
|
-
sendPower: (config: {
|
|
103
|
-
device: {
|
|
104
|
-
id: string;
|
|
105
|
-
};
|
|
106
|
-
power: boolean;
|
|
107
|
-
}) => void;
|
|
69
|
+
declare class TapoApi {
|
|
70
|
+
_baseUrl: string;
|
|
71
|
+
_baseTapoCareUrl: string;
|
|
72
|
+
private axiosInstance;
|
|
73
|
+
private _config;
|
|
74
|
+
private _token;
|
|
75
|
+
private _devices;
|
|
76
|
+
constructor(config?: {
|
|
77
|
+
token?: string;
|
|
78
|
+
timeout?: number;
|
|
79
|
+
httpTimeout?: number;
|
|
80
|
+
});
|
|
81
|
+
auth: ({ email, password }: {
|
|
82
|
+
email: string;
|
|
83
|
+
password: string;
|
|
84
|
+
}) => Promise<string>;
|
|
85
|
+
setup: ({ email, password, devices }: {
|
|
86
|
+
email: string;
|
|
87
|
+
password: string;
|
|
88
|
+
devices: Array<{
|
|
89
|
+
id: string;
|
|
90
|
+
host: string;
|
|
91
|
+
}>;
|
|
92
|
+
}) => Promise<Map<string, TapoDeviceKey>>;
|
|
93
|
+
sendState: (config: {
|
|
94
|
+
device: {
|
|
95
|
+
id: string;
|
|
96
|
+
};
|
|
97
|
+
state: LightState;
|
|
98
|
+
fetchConfig?: {
|
|
99
|
+
shouldWait: boolean;
|
|
100
|
+
};
|
|
101
|
+
}) => Promise<any>;
|
|
102
|
+
sendPower: (config: {
|
|
103
|
+
device: {
|
|
104
|
+
id: string;
|
|
105
|
+
};
|
|
106
|
+
power: boolean;
|
|
107
|
+
}) => void;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
declare const TapoDeviceTypes: {
|
|
111
|
-
ALL: string;
|
|
112
|
-
BULBS: string;
|
|
113
|
-
LIGHTSTRIPS: string;
|
|
114
|
-
PLUGS: string;
|
|
115
|
-
};
|
|
116
|
-
declare enum ETapoDeviceTypes {
|
|
117
|
-
ALL = "all",
|
|
118
|
-
BULBS = "bulb",
|
|
119
|
-
LIGHTSTRIPS = "lightstrip",
|
|
120
|
-
PLUGS = "plug"
|
|
121
|
-
}
|
|
122
|
-
declare const DeviceResTypes: {
|
|
123
|
-
BULB: string;
|
|
124
|
-
PLUG: string;
|
|
125
|
-
};
|
|
126
|
-
declare const DeviceSendValues: {
|
|
127
|
-
BULB: string;
|
|
128
|
-
LIGHTSTRIP: string;
|
|
129
|
-
PLUG: string;
|
|
110
|
+
declare const TapoDeviceTypes: {
|
|
111
|
+
ALL: string;
|
|
112
|
+
BULBS: string;
|
|
113
|
+
LIGHTSTRIPS: string;
|
|
114
|
+
PLUGS: string;
|
|
115
|
+
};
|
|
116
|
+
declare enum ETapoDeviceTypes {
|
|
117
|
+
ALL = "all",
|
|
118
|
+
BULBS = "bulb",
|
|
119
|
+
LIGHTSTRIPS = "lightstrip",
|
|
120
|
+
PLUGS = "plug"
|
|
121
|
+
}
|
|
122
|
+
declare const DeviceResTypes: {
|
|
123
|
+
BULB: string;
|
|
124
|
+
PLUG: string;
|
|
125
|
+
};
|
|
126
|
+
declare const DeviceSendValues: {
|
|
127
|
+
BULB: string;
|
|
128
|
+
LIGHTSTRIP: string;
|
|
129
|
+
PLUG: string;
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
declare const tapo_constants_DeviceResTypes: typeof DeviceResTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumiastream/tapo-cove",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "GPL",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"lint": "tsc"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@lumiastream/fetch-cove": "^3.0
|
|
15
|
-
"@lumiastream/lumia-rgb-types": "^3.0
|
|
16
|
-
"@lumiastream/lumia-rgb-utils": "^3.
|
|
17
|
-
"axios": "
|
|
14
|
+
"@lumiastream/fetch-cove": "^3.10.0",
|
|
15
|
+
"@lumiastream/lumia-rgb-types": "^3.10.0",
|
|
16
|
+
"@lumiastream/lumia-rgb-utils": "^3.10.0",
|
|
17
|
+
"axios": "^1.4.0",
|
|
18
18
|
"local-devices": "^4.0.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"tsup": "*",
|
|
24
24
|
"typescript": "*"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "4d649c1dbbae4d98c45bfce14ff5a443b1cf8fa6"
|
|
27
27
|
}
|