@lumiastream/tapo-cove 4.1.1 → 9999.0.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/README.md +1 -0
- package/index.js +1 -0
- package/package.json +5 -26
- package/CHANGELOG.md +0 -124
- package/UNIFIED_README.md +0 -185
- package/dist/index.d.mts +0 -386
- package/dist/index.d.ts +0 -386
- package/dist/index.js +0 -2054
- package/dist/index.mjs +0 -2011
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Moved to @lumiapriv/tapo-cove (GitHub Packages). Moved to the @lumiapriv scope on GitHub Packages. This public package is no longer maintained.
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = {};
|
package/package.json
CHANGED
|
@@ -1,29 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumiastream/tapo-cove",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
11
|
-
"lint": "tsc"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@lumiastream/lumia-rgb-types": "^4.1.0",
|
|
15
|
-
"@lumiastream/lumia-rgb-utils": "^4.1.0",
|
|
16
|
-
"@lumiastream/network-cove": "^4.1.0",
|
|
17
|
-
"axios": "^1.6.7",
|
|
18
|
-
"byte-morph": "*",
|
|
19
|
-
"crypto": "1.0.1",
|
|
20
|
-
"local-devices": "^4.0.0"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/node": "20.8.7",
|
|
24
|
-
"tsconfig": "*",
|
|
25
|
-
"tsup": "*",
|
|
26
|
-
"typescript": "*"
|
|
27
|
-
},
|
|
28
|
-
"gitHead": "b99ebc4deb9d3c7134dcb5692117a67c72ce2264"
|
|
3
|
+
"version": "9999.0.0",
|
|
4
|
+
"description": "Moved to @lumiapriv/tapo-cove (GitHub Packages). Moved to the @lumiapriv scope on GitHub Packages. This public package is no longer maintained.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"files": ["index.js"]
|
|
29
8
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [4.1.1](https://github.com/lumiastream/rgb/compare/v4.1.0...v4.1.1) (2025-07-30)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @lumiastream/tapo-cove
|
|
9
|
-
|
|
10
|
-
# [4.1.0](https://github.com/lumiastream/rgb/compare/v3.17.3...v4.1.0) (2025-07-29)
|
|
11
|
-
|
|
12
|
-
### Features
|
|
13
|
-
|
|
14
|
-
- tplink tapo unified api ([d51ba83](https://github.com/lumiastream/rgb/commit/d51ba832ef70b12a54697cd473c6c512a3134f30))
|
|
15
|
-
|
|
16
|
-
# [3.15.0](https://github.com/lumiastream/rgb/compare/v3.14.0...v3.15.0) (2025-01-29)
|
|
17
|
-
|
|
18
|
-
### Features
|
|
19
|
-
|
|
20
|
-
- **protocol**: Add secure passthrough transport protocol as fallback to KLAP
|
|
21
|
-
- **protocol**: Implement dual protocol negotiation (KLAP + SecurePassthrough)
|
|
22
|
-
- **devices**: Add P300 smart strip support with multi-outlet zones
|
|
23
|
-
- **devices**: Add C320WS camera device type support
|
|
24
|
-
- **devices**: Add L900-10 smart light strip support with zones
|
|
25
|
-
- **lightstate**: Add HSL color control with value normalization
|
|
26
|
-
- **lightstate**: Add preset color methods (red, green, blue, yellow, orange, purple, pink, white)
|
|
27
|
-
- **api**: Add energy usage monitoring for compatible plugs
|
|
28
|
-
- **api**: Add getDeviceInfo and getEnergyUsage methods
|
|
29
|
-
- **discovery**: Improve MAC address filtering with known Tapo prefixes
|
|
30
|
-
- **discovery**: Enhanced device type detection for strips and cameras
|
|
31
|
-
- **error-handling**: Add comprehensive TapoError class with detailed error codes
|
|
32
|
-
- **error-handling**: Add retry operation utility with exponential backoff
|
|
33
|
-
- **types**: Update TypeScript interfaces for new device types and features
|
|
34
|
-
|
|
35
|
-
### Bug Fixes
|
|
36
|
-
|
|
37
|
-
- **discovery**: Fix missing break statements in device type switch cases
|
|
38
|
-
- **zones**: Correct ILumiaDeviceZone addressable property type (string|number)
|
|
39
|
-
- **async**: Fix sendPower method to return Promise properly
|
|
40
|
-
|
|
41
|
-
# [3.14.0](https://github.com/lumiastream/rgb/compare/v3.13.4...v3.14.0) (2024-03-06)
|
|
42
|
-
|
|
43
|
-
**Note:** Version bump only for package @lumiastream/tapo-cove
|
|
44
|
-
|
|
45
|
-
## [3.13.4](https://github.com/lumiastream/rgb/compare/v3.13.3...v3.13.4) (2024-02-29)
|
|
46
|
-
|
|
47
|
-
**Note:** Version bump only for package @lumiastream/tapo-cove
|
|
48
|
-
|
|
49
|
-
## [3.13.1](https://github.com/lumiastream/rgb/compare/v3.13.0...v3.13.1) (2024-02-29)
|
|
50
|
-
|
|
51
|
-
### Bug Fixes
|
|
52
|
-
|
|
53
|
-
- axios \* ([dbe18fa](https://github.com/lumiastream/rgb/commit/dbe18facfb0968654314ed4c73896ccf8b03c650))
|
|
54
|
-
|
|
55
|
-
# [3.13.0](https://github.com/lumiastream/rgb/compare/v3.12.2...v3.13.0) (2024-02-29)
|
|
56
|
-
|
|
57
|
-
### Features
|
|
58
|
-
|
|
59
|
-
- move from fetch work to axios ([07e5dac](https://github.com/lumiastream/rgb/commit/07e5dac313cf1f00845a29918c1f352201eb3a34))
|
|
60
|
-
- tapo does not need to decrypt response ([36f7b4c](https://github.com/lumiastream/rgb/commit/36f7b4c5bc4a9d7553c1090a0c08a9f76fe9ae19))
|
|
61
|
-
|
|
62
|
-
## [3.12.2](https://github.com/lumiastream/rgb/compare/v3.12.1...v3.12.2) (2023-10-26)
|
|
63
|
-
|
|
64
|
-
### Bug Fixes
|
|
65
|
-
|
|
66
|
-
- tapo cookie error ([5aa2093](https://github.com/lumiastream/rgb/commit/5aa20933547b1782bbd27ea321c3c75dfe046992))
|
|
67
|
-
|
|
68
|
-
## [3.12.1](https://github.com/lumiastream/rgb/compare/v3.12.0...v3.12.1) (2023-10-26)
|
|
69
|
-
|
|
70
|
-
### Bug Fixes
|
|
71
|
-
|
|
72
|
-
- tapo host set error ([6437ed3](https://github.com/lumiastream/rgb/commit/6437ed3f0a8f44fbb9ddad2b78d815f71deae7b0))
|
|
73
|
-
|
|
74
|
-
# [3.12.0](https://github.com/lumiastream/rgb/compare/v3.11.2...v3.12.0) (2023-10-25)
|
|
75
|
-
|
|
76
|
-
### Bug Fixes
|
|
77
|
-
|
|
78
|
-
- tapo build error ([7dd7658](https://github.com/lumiastream/rgb/commit/7dd7658e391108e6aa6c2e4ec28aab47d183f4e5))
|
|
79
|
-
|
|
80
|
-
### Features
|
|
81
|
-
|
|
82
|
-
- tapo new klap cipher implementation ([a82c8f8](https://github.com/lumiastream/rgb/commit/a82c8f8c300108e76494b0ba264a0710537dc386))
|
|
83
|
-
|
|
84
|
-
# [3.11.0](https://github.com/lumiastream/rgb/compare/v3.10.1...v3.11.0) (2023-08-15)
|
|
85
|
-
|
|
86
|
-
**Note:** Version bump only for package @lumiastream/tapo-cove
|
|
87
|
-
|
|
88
|
-
# [3.10.0](https://github.com/lumiastream/rgb/compare/v3.9.0...v3.10.0) (2023-08-15)
|
|
89
|
-
|
|
90
|
-
**Note:** Version bump only for package @lumiastream/tapo-cove
|
|
91
|
-
|
|
92
|
-
# [3.9.0](https://github.com/lumiastream/rgb/compare/v3.8.1...v3.9.0) (2023-08-15)
|
|
93
|
-
|
|
94
|
-
**Note:** Version bump only for package @lumiastream/tapo-cove
|
|
95
|
-
|
|
96
|
-
## [3.6.1](https://github.com/lumiastream/rgb/compare/v3.6.0...v3.6.1) (2023-05-03)
|
|
97
|
-
|
|
98
|
-
**Note:** Version bump only for package @lumiastream/tapo-cove
|
|
99
|
-
|
|
100
|
-
# [3.5.0](https://github.com/lumiastream/rgb/compare/v3.4.0...v3.5.0) (2023-05-01)
|
|
101
|
-
|
|
102
|
-
**Note:** Version bump only for package @lumiastream/tapo-cove
|
|
103
|
-
|
|
104
|
-
# [3.3.0](https://github.com/lumiastream/rgb/compare/v3.2.0...v3.3.0) (2023-04-05)
|
|
105
|
-
|
|
106
|
-
### Features
|
|
107
|
-
|
|
108
|
-
- nanoleaf theme brightness ([62f32e7](https://github.com/lumiastream/rgb/commit/62f32e7993493a93015c139e5da79858ce1afbc3))
|
|
109
|
-
|
|
110
|
-
# [3.2.0](https://github.com/lumiastream/rgb/compare/v3.1.0...v3.2.0) (2023-03-24)
|
|
111
|
-
|
|
112
|
-
### Bug Fixes
|
|
113
|
-
|
|
114
|
-
- tapo bypass cookie ([39f5dec](https://github.com/lumiastream/rgb/commit/39f5dec51c403d7b99f662b75f4c32a76546e56a))
|
|
115
|
-
|
|
116
|
-
### Features
|
|
117
|
-
|
|
118
|
-
- tapo timoeut in 3 seconds ([6d7bf1b](https://github.com/lumiastream/rgb/commit/6d7bf1b81a89ddb867677bff0b6f816547239981))
|
|
119
|
-
|
|
120
|
-
# [3.1.0](https://github.com/lumiastream/rgb/compare/v3.0.15...v3.1.0) (2023-03-21)
|
|
121
|
-
|
|
122
|
-
### Bug Fixes
|
|
123
|
-
|
|
124
|
-
- tapo using promise.all instead of allsettled ([a6dc480](https://github.com/lumiastream/rgb/commit/a6dc480f86cc129535b6eac7bf1acdc5cdff06b6))
|
package/UNIFIED_README.md
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
# Unified TP-Link Library
|
|
2
|
-
|
|
3
|
-
This library provides unified support for both **Kasa** (older TP-Link devices) and **Tapo** (newer TP-Link devices) in a single package.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
✅ **Unified API** - Control both Kasa and Tapo devices with the same interface
|
|
8
|
-
✅ **Auto Protocol Detection** - Automatically detects whether a device uses Kasa or Tapo protocol
|
|
9
|
-
✅ **Dual Discovery** - Discovers both Kasa devices (UDP) and Tapo devices (cloud API)
|
|
10
|
-
✅ **Backward Compatible** - All existing Tapo and Kasa code continues to work
|
|
11
|
-
✅ **Regional Support** - Automatically tries multiple regional endpoints for Tapo
|
|
12
|
-
✅ **Modern Features** - HSL colors, energy monitoring, multi-zone support
|
|
13
|
-
|
|
14
|
-
## Quick Start
|
|
15
|
-
|
|
16
|
-
```javascript
|
|
17
|
-
import { UnifiedTpLinkApi } from '@lumiastream/tplink-unified-cove';
|
|
18
|
-
|
|
19
|
-
// Initialize with Tapo credentials (optional - only needed for Tapo devices)
|
|
20
|
-
const api = new UnifiedTpLinkApi({
|
|
21
|
-
email: 'your-tapo-email@example.com',
|
|
22
|
-
password: 'your-tapo-password'
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
// Discover all TP-Link devices (both Kasa and Tapo)
|
|
26
|
-
const devices = await api.discover();
|
|
27
|
-
|
|
28
|
-
console.log(`Found ${devices.allDevices.length} devices:`);
|
|
29
|
-
devices.allDevices.forEach(device => {
|
|
30
|
-
console.log(`${device.protocol.toUpperCase()}: ${device.name} (${device.model})`);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// Control any device using the same API
|
|
34
|
-
const deviceId = devices.allDevices[0].id;
|
|
35
|
-
|
|
36
|
-
// Basic controls
|
|
37
|
-
await api.turnOn(deviceId);
|
|
38
|
-
await api.setBrightness(deviceId, 75);
|
|
39
|
-
await api.setRgb(deviceId, 255, 0, 0); // Red
|
|
40
|
-
await api.setHsl(deviceId, 240, 100, 50); // Blue
|
|
41
|
-
await api.turnOff(deviceId);
|
|
42
|
-
|
|
43
|
-
// Get device information
|
|
44
|
-
const info = await api.getDeviceInfo(deviceId);
|
|
45
|
-
console.log('Device info:', info);
|
|
46
|
-
|
|
47
|
-
// Get energy usage (for compatible devices)
|
|
48
|
-
try {
|
|
49
|
-
const energy = await api.getEnergyUsage(deviceId);
|
|
50
|
-
console.log('Energy usage:', energy);
|
|
51
|
-
} catch (error) {
|
|
52
|
-
console.log('Energy monitoring not supported');
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Discovery Options
|
|
57
|
-
|
|
58
|
-
```javascript
|
|
59
|
-
// Discover only Kasa devices (no credentials needed)
|
|
60
|
-
const kasaOnly = await api.discover({
|
|
61
|
-
includeKasa: true,
|
|
62
|
-
includeTapo: false,
|
|
63
|
-
kasaTimeout: 3000
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
// Discover only Tapo devices (credentials required)
|
|
67
|
-
const tapoOnly = await api.discover({
|
|
68
|
-
includeKasa: false,
|
|
69
|
-
includeTapo: true,
|
|
70
|
-
email: 'your-email@example.com',
|
|
71
|
-
password: 'your-password'
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// Filter by device type
|
|
75
|
-
const lightsOnly = await api.discover({
|
|
76
|
-
types: [ILumiaDeviceType.LIGHT]
|
|
77
|
-
});
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Device Protocol Detection
|
|
81
|
-
|
|
82
|
-
```javascript
|
|
83
|
-
// The library automatically detects device protocols
|
|
84
|
-
const device = devices.allDevices[0];
|
|
85
|
-
|
|
86
|
-
if (device.protocol === DeviceProtocol.KASA) {
|
|
87
|
-
console.log('This is an older Kasa device');
|
|
88
|
-
} else if (device.protocol === DeviceProtocol.TAPO) {
|
|
89
|
-
console.log('This is a newer Tapo device');
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Manual protocol detection
|
|
93
|
-
const protocol = UnifiedTpLinkApi.detectDeviceProtocol({
|
|
94
|
-
model: 'HS110' // Returns DeviceProtocol.KASA
|
|
95
|
-
});
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## Advanced Usage
|
|
99
|
-
|
|
100
|
-
```javascript
|
|
101
|
-
// Use protocol-specific light states
|
|
102
|
-
const LightStateClass = api.getLightStateClass(deviceId);
|
|
103
|
-
if (LightStateClass) {
|
|
104
|
-
const lightState = new LightStateClass()
|
|
105
|
-
.on()
|
|
106
|
-
.brightness(80)
|
|
107
|
-
.rgb([0, 255, 0])
|
|
108
|
-
.transition(1000);
|
|
109
|
-
|
|
110
|
-
await api.setLightState(deviceId, lightState.getValues());
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Access underlying APIs
|
|
114
|
-
const tapoApi = api.getTapoApi(); // Get TapoApi instance
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Backward Compatibility
|
|
118
|
-
|
|
119
|
-
All existing code continues to work:
|
|
120
|
-
|
|
121
|
-
```javascript
|
|
122
|
-
// Legacy Tapo usage still works
|
|
123
|
-
import { TapoApi, TapoLightState } from '@lumiastream/tplink-unified-cove';
|
|
124
|
-
|
|
125
|
-
// Legacy Kasa usage still works
|
|
126
|
-
import { KasaLightState, TplinkStream } from '@lumiastream/tplink-unified-cove';
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## Supported Devices
|
|
130
|
-
|
|
131
|
-
### Kasa Devices (UDP Protocol)
|
|
132
|
-
- **Bulbs**: LB100, LB110, LB120, LB130, KL110, KL120, KL130
|
|
133
|
-
- **Plugs**: HS100, HS103, HS105, HS110, KP100, KP105, KP115, KP125
|
|
134
|
-
- **Strips**: KL400, KL430
|
|
135
|
-
|
|
136
|
-
### Tapo Devices (Cloud + KLAP/SecurePassthrough Protocol)
|
|
137
|
-
- **Bulbs**: L510E, L530E, L900-10, L920-5, L930-5
|
|
138
|
-
- **Plugs**: P100, P105, P110, P115, P300 (smart strip)
|
|
139
|
-
- **Cameras**: C320WS (basic support)
|
|
140
|
-
|
|
141
|
-
## Authentication
|
|
142
|
-
|
|
143
|
-
- **Kasa devices**: No authentication required (local UDP)
|
|
144
|
-
- **Tapo devices**: Requires TP-Link account credentials
|
|
145
|
-
- **Regional support**: Automatically tries EU, US, Global, and Asia-Pacific endpoints
|
|
146
|
-
|
|
147
|
-
## Error Handling
|
|
148
|
-
|
|
149
|
-
```javascript
|
|
150
|
-
try {
|
|
151
|
-
await api.turnOn(deviceId);
|
|
152
|
-
} catch (error) {
|
|
153
|
-
if (error instanceof TapoError) {
|
|
154
|
-
console.log(`Tapo error ${error.code}: ${error.message}`);
|
|
155
|
-
} else {
|
|
156
|
-
console.log(`General error: ${error.message}`);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
## Migration Guide
|
|
162
|
-
|
|
163
|
-
### From separate Kasa/Tapo libraries:
|
|
164
|
-
```javascript
|
|
165
|
-
// Before (separate libraries)
|
|
166
|
-
import kasaDiscover from '@lumiastream/tplink-cove';
|
|
167
|
-
import { tapoDiscover } from '@lumiastream/tapo-cove';
|
|
168
|
-
|
|
169
|
-
// After (unified)
|
|
170
|
-
import { UnifiedTpLinkApi } from '@lumiastream/tplink-unified-cove';
|
|
171
|
-
const api = new UnifiedTpLinkApi();
|
|
172
|
-
const devices = await api.discover(); // Gets both!
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### From legacy Tapo-only usage:
|
|
176
|
-
```javascript
|
|
177
|
-
// Before
|
|
178
|
-
import { discover, TapoApi } from '@lumiastream/tapo-cove';
|
|
179
|
-
|
|
180
|
-
// After (backward compatible)
|
|
181
|
-
import { discover, TapoApi } from '@lumiastream/tplink-unified-cove';
|
|
182
|
-
|
|
183
|
-
// Or use new unified API
|
|
184
|
-
import { UnifiedTpLinkApi } from '@lumiastream/tplink-unified-cove';
|
|
185
|
-
```
|