homebridge-tsvesync 1.0.0 → 1.0.2
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/config.schema.json +77 -0
- package/dist/platform.d.ts +7 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +69 -21
- package/dist/platform.js.map +1 -1
- package/dist/platformAccessory.d.ts +8 -15
- package/dist/platformAccessory.d.ts.map +1 -1
- package/dist/platformAccessory.js +82 -50
- package/dist/platformAccessory.js.map +1 -1
- package/package/LICENSE +21 -0
- package/package/README.md +227 -0
- package/package/api/vesync/VeSync.yaml +33 -0
- package/package/api/vesyncbulb/ESL100.yaml +74 -0
- package/package/api/vesyncbulb/ESL100CW.yaml +123 -0
- package/package/api/vesyncbulb/ESL100MC.yaml +169 -0
- package/package/api/vesyncbulb/XYD0001.yaml +193 -0
- package/package/api/vesyncfan/Classic200S.yaml +280 -0
- package/package/api/vesyncfan/Classic300S.yaml +278 -0
- package/package/api/vesyncfan/Core200S.yaml +256 -0
- package/package/api/vesyncfan/Core300S.yaml +281 -0
- package/package/api/vesyncfan/Core400S.yaml +281 -0
- package/package/api/vesyncfan/Core600S.yaml +281 -0
- package/package/api/vesyncfan/Dual200S.yaml +278 -0
- package/package/api/vesyncfan/LAP-C201S-AUSR.yaml +256 -0
- package/package/api/vesyncfan/LAP-C202S-WUSR.yaml +256 -0
- package/package/api/vesyncfan/LAP-C301S-WAAA.yaml +281 -0
- package/package/api/vesyncfan/LAP-C301S-WJP.yaml +281 -0
- package/package/api/vesyncfan/LAP-C302S-WUSB.yaml +281 -0
- package/package/api/vesyncfan/LAP-C401S-WAAA.yaml +281 -0
- package/package/api/vesyncfan/LAP-C401S-WJP.yaml +281 -0
- package/package/api/vesyncfan/LAP-C401S-WUSR.yaml +281 -0
- package/package/api/vesyncfan/LAP-C601S-WEU.yaml +281 -0
- package/package/api/vesyncfan/LAP-C601S-WUS.yaml +281 -0
- package/package/api/vesyncfan/LAP-C601S-WUSR.yaml +281 -0
- package/package/api/vesyncfan/LAP-EL551S-AEUR.yaml +167 -0
- package/package/api/vesyncfan/LAP-EL551S-AUS.yaml +167 -0
- package/package/api/vesyncfan/LAP-EL551S-WEU.yaml +167 -0
- package/package/api/vesyncfan/LAP-EL551S-WUS.yaml +167 -0
- package/package/api/vesyncfan/LAP-V102S-AASR.yaml +167 -0
- package/package/api/vesyncfan/LAP-V102S-AUSR.yaml +167 -0
- package/package/api/vesyncfan/LAP-V102S-WEU.yaml +167 -0
- package/package/api/vesyncfan/LAP-V102S-WJP.yaml +167 -0
- package/package/api/vesyncfan/LAP-V102S-WUS.yaml +167 -0
- package/package/api/vesyncfan/LAP-V201-AUSR.yaml +167 -0
- package/package/api/vesyncfan/LAP-V201S-AASR.yaml +167 -0
- package/package/api/vesyncfan/LAP-V201S-AEUR.yaml +167 -0
- package/package/api/vesyncfan/LAP-V201S-AUSR.yaml +167 -0
- package/package/api/vesyncfan/LAP-V201S-WEU.yaml +167 -0
- package/package/api/vesyncfan/LAP-V201S-WJP.yaml +167 -0
- package/package/api/vesyncfan/LAP-V201S-WUS.yaml +167 -0
- package/package/api/vesyncfan/LEH-S601S-WUS.yaml +303 -0
- package/package/api/vesyncfan/LEH-S601S-WUSR.yaml +82 -0
- package/package/api/vesyncfan/LTF-F422S-KEU.yaml +165 -0
- package/package/api/vesyncfan/LTF-F422S-WUS.yaml +165 -0
- package/package/api/vesyncfan/LTF-F422S-WUSR.yaml +167 -0
- package/package/api/vesyncfan/LTF-F422_WJP.yaml +165 -0
- package/package/api/vesyncfan/LUH-A601S-AUSW.yaml +82 -0
- package/package/api/vesyncfan/LUH-A601S-WUSB.yaml +305 -0
- package/package/api/vesyncfan/LUH-A602S-WEU.yaml +305 -0
- package/package/api/vesyncfan/LUH-A602S-WEUR.yaml +305 -0
- package/package/api/vesyncfan/LUH-A602S-WJP.yaml +305 -0
- package/package/api/vesyncfan/LUH-A602S-WUS.yaml +305 -0
- package/package/api/vesyncfan/LUH-A602S-WUSC.yaml +305 -0
- package/package/api/vesyncfan/LUH-A602S-WUSR.yaml +305 -0
- package/package/api/vesyncfan/LUH-D301S-WEU.yaml +305 -0
- package/package/api/vesyncfan/LUH-D301S-WJP.yaml +305 -0
- package/package/api/vesyncfan/LUH-D301S-WUSR.yaml +305 -0
- package/package/api/vesyncfan/LUH-M101S-WUS.yaml +278 -0
- package/package/api/vesyncfan/LUH-O451S-WEU.yaml +278 -0
- package/package/api/vesyncfan/LUH-O451S-WUS.yaml +278 -0
- package/package/api/vesyncfan/LUH-O451S-WUSR.yaml +305 -0
- package/package/api/vesyncfan/LUH-O601S-KUS.yaml +305 -0
- package/package/api/vesyncfan/LUH-O601S-WUS.yaml +305 -0
- package/package/api/vesyncfan/LV-PUR131S.yaml +108 -0
- package/package/api/vesyncfan/LV-RH131S.yaml +108 -0
- package/package/api/vesyncoutlet/ESO15-TB.yaml +124 -0
- package/package/api/vesyncoutlet/ESW01-EU.yaml +122 -0
- package/package/api/vesyncoutlet/ESW03-USA.yaml +122 -0
- package/package/api/vesyncoutlet/ESW15-USA.yaml +156 -0
- package/package/api/vesyncoutlet/wifi-switch-1.3.yaml +60 -0
- package/package/api/vesyncswitch/ESWD16.yaml +128 -0
- package/package/api/vesyncswitch/ESWL01.yaml +56 -0
- package/package/api/vesyncswitch/ESWL03.yaml +56 -0
- package/package/package.json +53 -0
- package/package/src/lib/helpers.ts +290 -0
- package/package/src/lib/vesync.ts +530 -0
- package/package/src/lib/vesyncBaseDevice.ts +114 -0
- package/package/src/lib/vesyncBulb.ts +252 -0
- package/package/src/lib/vesyncBulbImpl.ts +215 -0
- package/package/src/lib/vesyncFan.ts +447 -0
- package/package/src/lib/vesyncFanImpl.ts +848 -0
- package/package/src/lib/vesyncOutlet.ts +148 -0
- package/package/src/lib/vesyncOutletImpl.ts +284 -0
- package/package/src/lib/vesyncSwitch.ts +546 -0
- package/package/src/lib/vesyncSwitchImpl.ts +408 -0
- package/package.json +34 -10
- package/src/platform.ts +87 -22
- package/src/platformAccessory.ts +104 -51
- package/tsvesync-1.0.11.tgz +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pluginAlias": "TSVESyncPlatform",
|
|
3
|
+
"pluginType": "platform",
|
|
4
|
+
"singular": true,
|
|
5
|
+
"headerDisplay": "Homebridge plugin for VeSync devices including Levoit air purifiers, humidifiers, and Etekcity smart outlets.",
|
|
6
|
+
"footerDisplay": "For help please visit the [GitHub repository](https://github.com/mickgiles/homebridge-tsvesync).",
|
|
7
|
+
"schema": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"name": {
|
|
11
|
+
"title": "Name",
|
|
12
|
+
"type": "string",
|
|
13
|
+
"required": true,
|
|
14
|
+
"default": "TSVESync"
|
|
15
|
+
},
|
|
16
|
+
"username": {
|
|
17
|
+
"title": "Email",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"required": true,
|
|
20
|
+
"description": "Your VeSync account email address"
|
|
21
|
+
},
|
|
22
|
+
"password": {
|
|
23
|
+
"title": "Password",
|
|
24
|
+
"type": "string",
|
|
25
|
+
"required": true,
|
|
26
|
+
"description": "Your VeSync account password",
|
|
27
|
+
"typeahead": {
|
|
28
|
+
"source": []
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"updateInterval": {
|
|
32
|
+
"title": "Update Interval",
|
|
33
|
+
"type": "integer",
|
|
34
|
+
"minimum": 10,
|
|
35
|
+
"maximum": 600,
|
|
36
|
+
"default": 30,
|
|
37
|
+
"required": false,
|
|
38
|
+
"description": "How often to update device states (in seconds). Default is 30 seconds."
|
|
39
|
+
},
|
|
40
|
+
"debug": {
|
|
41
|
+
"title": "Debug Logging",
|
|
42
|
+
"type": "boolean",
|
|
43
|
+
"required": false,
|
|
44
|
+
"default": false,
|
|
45
|
+
"description": "Enable debug logging"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"layout": [
|
|
50
|
+
{
|
|
51
|
+
"type": "flex",
|
|
52
|
+
"flex-flow": "row wrap",
|
|
53
|
+
"items": [
|
|
54
|
+
{
|
|
55
|
+
"type": "flex",
|
|
56
|
+
"flex-flow": "column",
|
|
57
|
+
"items": [
|
|
58
|
+
"name",
|
|
59
|
+
"username",
|
|
60
|
+
{
|
|
61
|
+
"key": "password",
|
|
62
|
+
"type": "password"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"type": "flex",
|
|
68
|
+
"flex-flow": "column",
|
|
69
|
+
"items": [
|
|
70
|
+
"updateInterval",
|
|
71
|
+
"debug"
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
package/dist/platform.d.ts
CHANGED
|
@@ -8,13 +8,19 @@ export declare class TSVESyncPlatform implements DynamicPlatformPlugin {
|
|
|
8
8
|
readonly accessories: PlatformAccessory[];
|
|
9
9
|
private client;
|
|
10
10
|
private deviceUpdateInterval?;
|
|
11
|
+
private readonly updateInterval;
|
|
12
|
+
private readonly debug;
|
|
11
13
|
constructor(log: Logger, config: PlatformConfig, api: API);
|
|
12
14
|
/**
|
|
13
15
|
* This function is invoked when homebridge restores cached accessories from disk at startup.
|
|
14
16
|
*/
|
|
15
17
|
configureAccessory(accessory: PlatformAccessory): void;
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
19
|
+
* Get all devices from all categories
|
|
20
|
+
*/
|
|
21
|
+
private getAllDevices;
|
|
22
|
+
/**
|
|
23
|
+
* Discover VeSync devices and register them as accessories
|
|
18
24
|
*/
|
|
19
25
|
discoverDevices(): Promise<void>;
|
|
20
26
|
/**
|
package/dist/platform.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAK5H,qBAAa,gBAAiB,YAAW,qBAAqB;
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAK5H,qBAAa,gBAAiB,YAAW,qBAAqB;aAa1C,GAAG,EAAE,MAAM;aACX,MAAM,EAAE,cAAc;aACtB,GAAG,EAAE,GAAG;IAd1B,SAAgB,OAAO,EAAE,OAAO,OAAO,CAAwB;IAC/D,SAAgB,cAAc,EAAE,OAAO,cAAc,CAA+B;IAGpF,SAAgB,WAAW,EAAE,iBAAiB,EAAE,CAAM;IAEtD,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAC9C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAU;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAW;gBAGf,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG;IAqD1B;;OAEG;IACH,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAK/C;;OAEG;IACH,OAAO,CAAC,aAAa;IASrB;;OAEG;IACG,eAAe;IA0DrB;;OAEG;YACW,kBAAkB;CA6BjC"}
|
package/dist/platform.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TSVESyncPlatform = void 0;
|
|
4
4
|
const settings_1 = require("./settings");
|
|
5
5
|
const platformAccessory_1 = require("./platformAccessory");
|
|
6
|
-
const
|
|
6
|
+
const vesync_1 = require("tsvesync/dist/src/lib/vesync");
|
|
7
7
|
class TSVESyncPlatform {
|
|
8
8
|
constructor(log, config, api) {
|
|
9
9
|
this.log = log;
|
|
@@ -18,21 +18,31 @@ class TSVESyncPlatform {
|
|
|
18
18
|
log.error('Missing required configuration. Please check your config.json');
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
//
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
this.
|
|
21
|
+
// Get config values with defaults
|
|
22
|
+
this.updateInterval = config.updateInterval || 30;
|
|
23
|
+
this.debug = config.debug || false;
|
|
24
|
+
// Initialize VeSync client
|
|
25
|
+
this.client = new vesync_1.VeSync(config.username, config.password, Intl.DateTimeFormat().resolvedOptions().timeZone, this.debug);
|
|
26
|
+
if (this.debug) {
|
|
27
|
+
this.log.debug('Initialized platform with config:', {
|
|
28
|
+
name: config.name,
|
|
29
|
+
username: config.username,
|
|
30
|
+
updateInterval: this.updateInterval,
|
|
31
|
+
debug: this.debug,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
this.log.info('Finished initializing platform:', this.config.name);
|
|
27
35
|
// When this event is fired it means Homebridge has restored all cached accessories from disk.
|
|
28
36
|
this.api.on('didFinishLaunching', () => {
|
|
29
|
-
|
|
37
|
+
if (this.debug) {
|
|
38
|
+
this.log.debug('Executed didFinishLaunching callback');
|
|
39
|
+
}
|
|
30
40
|
// run the method to discover / register your devices as accessories
|
|
31
41
|
this.discoverDevices();
|
|
32
|
-
// Set up periodic device updates
|
|
42
|
+
// Set up periodic device updates
|
|
33
43
|
this.deviceUpdateInterval = setInterval(() => {
|
|
34
44
|
this.updateDeviceStates();
|
|
35
|
-
},
|
|
45
|
+
}, this.updateInterval * 1000); // Convert to milliseconds
|
|
36
46
|
});
|
|
37
47
|
// Clean up when shutting down
|
|
38
48
|
this.api.on('shutdown', () => {
|
|
@@ -49,34 +59,61 @@ class TSVESyncPlatform {
|
|
|
49
59
|
this.accessories.push(accessory);
|
|
50
60
|
}
|
|
51
61
|
/**
|
|
52
|
-
*
|
|
62
|
+
* Get all devices from all categories
|
|
63
|
+
*/
|
|
64
|
+
getAllDevices() {
|
|
65
|
+
return [
|
|
66
|
+
...this.client.fans,
|
|
67
|
+
...this.client.outlets,
|
|
68
|
+
...this.client.switches,
|
|
69
|
+
...this.client.bulbs,
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Discover VeSync devices and register them as accessories
|
|
53
74
|
*/
|
|
54
75
|
async discoverDevices() {
|
|
55
76
|
try {
|
|
77
|
+
if (this.debug) {
|
|
78
|
+
this.log.debug('Starting device discovery');
|
|
79
|
+
}
|
|
56
80
|
// Login and get devices
|
|
57
81
|
await this.client.login();
|
|
58
|
-
const
|
|
82
|
+
const success = await this.client.getDevices();
|
|
83
|
+
if (!success) {
|
|
84
|
+
this.log.error('Failed to get devices');
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const devices = this.getAllDevices();
|
|
88
|
+
if (this.debug) {
|
|
89
|
+
this.log.debug('Found devices:', devices.length);
|
|
90
|
+
}
|
|
59
91
|
// Loop over the discovered devices and register each one
|
|
60
92
|
for (const device of devices) {
|
|
61
|
-
const uuid = this.api.hap.uuid.generate(device.
|
|
93
|
+
const uuid = this.api.hap.uuid.generate(device.cid);
|
|
62
94
|
const existingAccessory = this.accessories.find(accessory => accessory.UUID === uuid);
|
|
63
95
|
if (existingAccessory) {
|
|
64
|
-
this.
|
|
96
|
+
if (this.debug) {
|
|
97
|
+
this.log.debug('Restoring existing accessory from cache:', existingAccessory.displayName);
|
|
98
|
+
}
|
|
65
99
|
existingAccessory.context.device = device;
|
|
66
|
-
new platformAccessory_1.TSVESyncAccessory(this, existingAccessory,
|
|
100
|
+
new platformAccessory_1.TSVESyncAccessory(this, existingAccessory, device);
|
|
67
101
|
}
|
|
68
102
|
else {
|
|
69
|
-
this.log.info('Adding new accessory:', device.
|
|
70
|
-
const accessory = new this.api.platformAccessory(device.
|
|
103
|
+
this.log.info('Adding new accessory:', device.deviceName);
|
|
104
|
+
const accessory = new this.api.platformAccessory(device.deviceName, uuid);
|
|
71
105
|
accessory.context.device = device;
|
|
72
|
-
new platformAccessory_1.TSVESyncAccessory(this, accessory,
|
|
106
|
+
new platformAccessory_1.TSVESyncAccessory(this, accessory, device);
|
|
73
107
|
this.api.registerPlatformAccessories(settings_1.PLUGIN_NAME, settings_1.PLATFORM_NAME, [accessory]);
|
|
74
108
|
}
|
|
75
109
|
}
|
|
76
110
|
// Remove accessories that are no longer present
|
|
77
111
|
this.accessories.forEach(accessory => {
|
|
78
|
-
const device = devices.find(device => this.api.hap.uuid.generate(device.
|
|
112
|
+
const device = devices.find(device => this.api.hap.uuid.generate(device.cid) === accessory.UUID);
|
|
79
113
|
if (!device) {
|
|
114
|
+
if (this.debug) {
|
|
115
|
+
this.log.debug('Removing accessory no longer present:', accessory.displayName);
|
|
116
|
+
}
|
|
80
117
|
this.api.unregisterPlatformAccessories(settings_1.PLUGIN_NAME, settings_1.PLATFORM_NAME, [accessory]);
|
|
81
118
|
}
|
|
82
119
|
});
|
|
@@ -90,11 +127,22 @@ class TSVESyncPlatform {
|
|
|
90
127
|
*/
|
|
91
128
|
async updateDeviceStates() {
|
|
92
129
|
try {
|
|
130
|
+
if (this.debug) {
|
|
131
|
+
this.log.debug('Updating device states');
|
|
132
|
+
}
|
|
93
133
|
await this.client.login();
|
|
94
|
-
const
|
|
134
|
+
const success = await this.client.getDevices();
|
|
135
|
+
if (!success) {
|
|
136
|
+
this.log.error('Failed to get devices');
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const devices = this.getAllDevices();
|
|
95
140
|
this.accessories.forEach(accessory => {
|
|
96
|
-
const device = devices.find(d => this.api.hap.uuid.generate(d.
|
|
141
|
+
const device = devices.find(d => this.api.hap.uuid.generate(d.cid) === accessory.UUID);
|
|
97
142
|
if (device) {
|
|
143
|
+
if (this.debug) {
|
|
144
|
+
this.log.debug('Updated state for device:', accessory.displayName);
|
|
145
|
+
}
|
|
98
146
|
accessory.context.device = device;
|
|
99
147
|
}
|
|
100
148
|
});
|
package/dist/platform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,2DAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,2DAAwD;AACxD,yDAAsD;AAEtD,MAAa,gBAAgB;IAY3B,YACkB,GAAW,EACX,MAAsB,EACtB,GAAQ;QAFR,QAAG,GAAH,GAAG,CAAQ;QACX,WAAM,GAAN,MAAM,CAAgB;QACtB,QAAG,GAAH,GAAG,CAAK;QAdV,YAAO,GAAmB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;QAC/C,mBAAc,GAA0B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC;QAEpF,oDAAoD;QACpC,gBAAW,GAAwB,EAAE,CAAC;QAYpD,yBAAyB;QACzB,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;YACxC,GAAG,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;YAC3E,OAAO;SACR;QAED,kCAAkC;QAClC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,EAAE,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC;QAEnC,2BAA2B;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CACtB,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,QAAQ,EACf,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ,EAChD,IAAI,CAAC,KAAK,CACX,CAAC;QAEF,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mCAAmC,E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IAED;;OAEG;IACK,KAAK,CAAC,kBAAkB;QAC9B,IAAI;YACF,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;aAC1C;YAED,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAC1B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAE/C,IAAI,CAAC,OAAO,EAAE;gBACZ,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;gBACxC,OAAO;aACR;YAED,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YAErC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;gBACnC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC;gBACvF,IAAI,MAAM,EAAE;oBACV,IAAI,IAAI,CAAC,KAAK,EAAE;wBACd,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,2BAA2B,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;qBACpE;oBACD,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;iBACnC;YACH,CAAC,CAAC,CAAC;SACJ;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;SAC1D;IACH,CAAC;CACF;AArLD,4CAqLC"}
|
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
import { PlatformAccessory, CharacteristicValue } from 'homebridge';
|
|
2
2
|
import { TSVESyncPlatform } from './platform';
|
|
3
|
-
import {
|
|
3
|
+
import { VeSyncBaseDevice } from 'tsvesync/dist/src/lib/vesyncBaseDevice';
|
|
4
4
|
export declare class TSVESyncAccessory {
|
|
5
5
|
private readonly platform;
|
|
6
6
|
private readonly accessory;
|
|
7
|
-
private readonly
|
|
7
|
+
private readonly device;
|
|
8
8
|
private service;
|
|
9
|
-
constructor(platform: TSVESyncPlatform, accessory: PlatformAccessory,
|
|
9
|
+
constructor(platform: TSVESyncPlatform, accessory: PlatformAccessory, device: VeSyncBaseDevice);
|
|
10
10
|
private setupService;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
private setupBulb;
|
|
12
|
+
private setupFan;
|
|
13
|
+
private setupSwitch;
|
|
14
14
|
setOn(value: CharacteristicValue): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Handle "GET" requests from HomeKit for power state
|
|
17
|
-
*/
|
|
18
15
|
getOn(): Promise<CharacteristicValue>;
|
|
19
|
-
/**
|
|
20
|
-
* Handle "SET" requests from HomeKit for brightness
|
|
21
|
-
*/
|
|
22
16
|
setBrightness(value: CharacteristicValue): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Handle "GET" requests from HomeKit for brightness
|
|
25
|
-
*/
|
|
26
17
|
getBrightness(): Promise<CharacteristicValue>;
|
|
18
|
+
setFanSpeed(value: CharacteristicValue): Promise<void>;
|
|
19
|
+
getFanSpeed(): Promise<CharacteristicValue>;
|
|
27
20
|
}
|
|
28
21
|
//# sourceMappingURL=platformAccessory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformAccessory.d.ts","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"platformAccessory.d.ts","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAmB1E,qBAAa,iBAAiB;IAI1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,OAAO,CAAC,OAAO,CAAW;gBAGP,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,gBAAgB;IAY3C,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,SAAS;IAiBjB,OAAO,CAAC,QAAQ;IAgBhB,OAAO,CAAC,WAAW;IASb,KAAK,CAAC,KAAK,EAAE,mBAAmB;IAgBhC,KAAK,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAUrC,aAAa,CAAC,KAAK,EAAE,mBAAmB;IAWxC,aAAa,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAU7C,WAAW,CAAC,KAAK,EAAE,mBAAmB;IAatC,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAUlD"}
|
|
@@ -2,48 +2,74 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TSVESyncAccessory = void 0;
|
|
4
4
|
class TSVESyncAccessory {
|
|
5
|
-
constructor(platform, accessory,
|
|
5
|
+
constructor(platform, accessory, device) {
|
|
6
6
|
this.platform = platform;
|
|
7
7
|
this.accessory = accessory;
|
|
8
|
-
this.
|
|
9
|
-
// Get the device from context
|
|
10
|
-
const device = accessory.context.device;
|
|
8
|
+
this.device = device;
|
|
11
9
|
// set accessory information
|
|
12
10
|
this.accessory.getService(this.platform.Service.AccessoryInformation)
|
|
13
|
-
.setCharacteristic(this.platform.Characteristic.Manufacturer, '
|
|
14
|
-
.setCharacteristic(this.platform.Characteristic.Model, device.
|
|
15
|
-
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.
|
|
11
|
+
.setCharacteristic(this.platform.Characteristic.Manufacturer, 'VeSync')
|
|
12
|
+
.setCharacteristic(this.platform.Characteristic.Model, device.deviceType)
|
|
13
|
+
.setCharacteristic(this.platform.Characteristic.SerialNumber, device.cid);
|
|
16
14
|
// Set up the appropriate service based on device type
|
|
17
|
-
this.setupService(
|
|
15
|
+
this.setupService();
|
|
18
16
|
}
|
|
19
|
-
setupService(
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
setupService() {
|
|
18
|
+
const deviceType = this.device.deviceType;
|
|
19
|
+
if (deviceType.includes('BULB')) {
|
|
20
|
+
this.setupBulb();
|
|
21
|
+
}
|
|
22
|
+
else if (deviceType.includes('FAN') || deviceType.includes('AIR')) {
|
|
23
|
+
this.setupFan();
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.setupSwitch();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
setupBulb() {
|
|
30
|
+
this.service = this.accessory.getService(this.platform.Service.Lightbulb)
|
|
31
|
+
|| this.accessory.addService(this.platform.Service.Lightbulb);
|
|
32
|
+
// Add brightness characteristic if device supports it
|
|
33
|
+
const bulb = this.device;
|
|
34
|
+
if ('setBrightness' in bulb) {
|
|
26
35
|
this.service.getCharacteristic(this.platform.Characteristic.Brightness)
|
|
27
36
|
.onSet(this.setBrightness.bind(this))
|
|
28
37
|
.onGet(this.getBrightness.bind(this));
|
|
29
38
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
this.service.getCharacteristic(this.platform.Characteristic.On)
|
|
40
|
+
.onSet(this.setOn.bind(this))
|
|
41
|
+
.onGet(this.getOn.bind(this));
|
|
42
|
+
}
|
|
43
|
+
setupFan() {
|
|
44
|
+
this.service = this.accessory.getService(this.platform.Service.Fan)
|
|
45
|
+
|| this.accessory.addService(this.platform.Service.Fan);
|
|
46
|
+
this.service.getCharacteristic(this.platform.Characteristic.On)
|
|
47
|
+
.onSet(this.setOn.bind(this))
|
|
48
|
+
.onGet(this.getOn.bind(this));
|
|
49
|
+
const fan = this.device;
|
|
50
|
+
if ('setSpeed' in fan) {
|
|
51
|
+
this.service.getCharacteristic(this.platform.Characteristic.RotationSpeed)
|
|
52
|
+
.onSet(this.setFanSpeed.bind(this))
|
|
53
|
+
.onGet(this.getFanSpeed.bind(this));
|
|
34
54
|
}
|
|
35
|
-
|
|
55
|
+
}
|
|
56
|
+
setupSwitch() {
|
|
57
|
+
this.service = this.accessory.getService(this.platform.Service.Switch)
|
|
58
|
+
|| this.accessory.addService(this.platform.Service.Switch);
|
|
36
59
|
this.service.getCharacteristic(this.platform.Characteristic.On)
|
|
37
60
|
.onSet(this.setOn.bind(this))
|
|
38
61
|
.onGet(this.getOn.bind(this));
|
|
39
62
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Handle "SET" requests from HomeKit for power state
|
|
42
|
-
*/
|
|
43
63
|
async setOn(value) {
|
|
44
64
|
try {
|
|
45
|
-
const device = this.
|
|
46
|
-
|
|
65
|
+
const device = this.device;
|
|
66
|
+
const newState = value;
|
|
67
|
+
if (newState) {
|
|
68
|
+
await device.turnOn();
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
await device.turnOff();
|
|
72
|
+
}
|
|
47
73
|
this.platform.log.debug('Set power state ->', value);
|
|
48
74
|
}
|
|
49
75
|
catch (error) {
|
|
@@ -51,55 +77,61 @@ class TSVESyncAccessory {
|
|
|
51
77
|
throw error;
|
|
52
78
|
}
|
|
53
79
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Handle "GET" requests from HomeKit for power state
|
|
56
|
-
*/
|
|
57
80
|
async getOn() {
|
|
58
81
|
try {
|
|
59
|
-
const device = this.
|
|
60
|
-
|
|
61
|
-
this.platform.log.debug('Get power state ->', state);
|
|
62
|
-
return state;
|
|
82
|
+
const device = this.device;
|
|
83
|
+
return device.deviceStatus === 'on';
|
|
63
84
|
}
|
|
64
85
|
catch (error) {
|
|
65
86
|
this.platform.log.error('Failed to get power state:', error);
|
|
66
87
|
throw error;
|
|
67
88
|
}
|
|
68
89
|
}
|
|
69
|
-
/**
|
|
70
|
-
* Handle "SET" requests from HomeKit for brightness
|
|
71
|
-
*/
|
|
72
90
|
async setBrightness(value) {
|
|
73
91
|
try {
|
|
74
|
-
const device = this.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this.platform.log.debug('Set brightness ->', value);
|
|
78
|
-
}
|
|
92
|
+
const device = this.device;
|
|
93
|
+
await device.setBrightness(value);
|
|
94
|
+
this.platform.log.debug('Set brightness ->', value);
|
|
79
95
|
}
|
|
80
96
|
catch (error) {
|
|
81
97
|
this.platform.log.error('Failed to set brightness:', error);
|
|
82
98
|
throw error;
|
|
83
99
|
}
|
|
84
100
|
}
|
|
85
|
-
/**
|
|
86
|
-
* Handle "GET" requests from HomeKit for brightness
|
|
87
|
-
*/
|
|
88
101
|
async getBrightness() {
|
|
89
102
|
try {
|
|
90
|
-
const device = this.
|
|
91
|
-
|
|
92
|
-
const brightness = await this.client.getBrightness(device.id);
|
|
93
|
-
this.platform.log.debug('Get brightness ->', brightness);
|
|
94
|
-
return brightness;
|
|
95
|
-
}
|
|
96
|
-
return 100;
|
|
103
|
+
const device = this.device;
|
|
104
|
+
return device.brightness || 100;
|
|
97
105
|
}
|
|
98
106
|
catch (error) {
|
|
99
107
|
this.platform.log.error('Failed to get brightness:', error);
|
|
100
108
|
throw error;
|
|
101
109
|
}
|
|
102
110
|
}
|
|
111
|
+
async setFanSpeed(value) {
|
|
112
|
+
try {
|
|
113
|
+
const device = this.device;
|
|
114
|
+
// Convert HomeKit 0-100 to device speed levels
|
|
115
|
+
const speed = Math.ceil(value / (100 / device.maxSpeed));
|
|
116
|
+
await device.setSpeed(speed);
|
|
117
|
+
this.platform.log.debug('Set fan speed ->', speed);
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
this.platform.log.error('Failed to set fan speed:', error);
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
async getFanSpeed() {
|
|
125
|
+
try {
|
|
126
|
+
const device = this.device;
|
|
127
|
+
// Convert device speed levels to HomeKit 0-100
|
|
128
|
+
return (device.speed || 0) * (100 / device.maxSpeed);
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
this.platform.log.error('Failed to get fan speed:', error);
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
103
135
|
}
|
|
104
136
|
exports.TSVESyncAccessory = TSVESyncAccessory;
|
|
105
137
|
//# sourceMappingURL=platformAccessory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformAccessory.js","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"platformAccessory.js","sourceRoot":"","sources":["../src/platformAccessory.ts"],"names":[],"mappings":";;;AAqBA,MAAa,iBAAiB;IAG5B,YACmB,QAA0B,EAC1B,SAA4B,EAC5B,MAAwB;QAFxB,aAAQ,GAAR,QAAQ,CAAkB;QAC1B,cAAS,GAAT,SAAS,CAAmB;QAC5B,WAAM,GAAN,MAAM,CAAkB;QAEzC,4BAA4B;QAC5B,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CAAE;aACnE,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,YAAY,EAAE,QAAQ,CAAC;aACtE,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC;aACxE,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,YAAY,EAAE,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AE,KAAK,CAAC,CAAC;YAC3D,MAAM,KAAK,CAAC;SACb;IACH,CAAC;CACF;AA9ID,8CA8IC"}
|
package/package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Mick Giles
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|