homebridge-salus-cloud 0.1.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/LICENSE +176 -0
- package/README.md +112 -0
- package/config.schema.json +148 -0
- package/dist/deviceCatalog.d.ts +10 -0
- package/dist/deviceCatalog.js +237 -0
- package/dist/deviceCatalog.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/platform.d.ts +27 -0
- package/dist/platform.js +329 -0
- package/dist/platform.js.map +1 -0
- package/dist/platformAccessory.d.ts +62 -0
- package/dist/platformAccessory.js +820 -0
- package/dist/platformAccessory.js.map +1 -0
- package/dist/propertyUtils.d.ts +15 -0
- package/dist/propertyUtils.js +185 -0
- package/dist/propertyUtils.js.map +1 -0
- package/dist/salusCloudClient.d.ts +52 -0
- package/dist/salusCloudClient.js +1447 -0
- package/dist/salusCloudClient.js.map +1 -0
- package/dist/settings.d.ts +2 -0
- package/dist/settings.js +3 -0
- package/dist/settings.js.map +1 -0
- package/dist/types.d.ts +56 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +52 -0
- package/scripts/publish.sh +117 -0
package/dist/platform.js
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
2
|
+
import { getCatalogEntry, inferKindFromCatalog } from './deviceCatalog.js';
|
|
3
|
+
import { hasAnyPropertyBase } from './propertyUtils.js';
|
|
4
|
+
import { SalusCloudClient } from './salusCloudClient.js';
|
|
5
|
+
import { SalusPlatformAccessory } from './platformAccessory.js';
|
|
6
|
+
import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js';
|
|
7
|
+
const DEFAULT_POLL_INTERVAL_SECONDS = 20;
|
|
8
|
+
const DEFAULT_MAX_PARALLEL_PROPERTY_REQUESTS = 4;
|
|
9
|
+
const MIN_POLL_INTERVAL_SECONDS = 10;
|
|
10
|
+
const MAX_POLL_INTERVAL_SECONDS = 300;
|
|
11
|
+
const THERMOSTAT_PROPERTY_BASES = [
|
|
12
|
+
'LocalTemperature_x100',
|
|
13
|
+
'HeatingSetpoint_x100',
|
|
14
|
+
'CoolingSetpoint_x100',
|
|
15
|
+
'SetHeatingSetpoint_x100',
|
|
16
|
+
'SetCoolingSetpoint_x100',
|
|
17
|
+
'SetSystemMode',
|
|
18
|
+
'SystemMode',
|
|
19
|
+
'RunningState',
|
|
20
|
+
'RunningMode',
|
|
21
|
+
];
|
|
22
|
+
const LOCK_PROPERTY_BASES = ['Lock', 'LockState', 'LockStatus', 'DoorLock'];
|
|
23
|
+
const POSITION_PROPERTY_BASES = ['CurrentLevel', 'TargetLevel', 'LiftPercentage', 'CurrentPosition'];
|
|
24
|
+
const ONOFF_PROPERTY_BASES = ['OnOff', 'SetOnOff', 'ValveStatus', 'ButtonStatus', 'Mode'];
|
|
25
|
+
const BRIGHTNESS_PROPERTY_BASES = ['CurrentLevel', 'SetLevel', 'Brightness', 'DimLevel'];
|
|
26
|
+
const MOTION_PROPERTY_BASES = ['Motion', 'Occupancy', 'IASZSAlarmed', 'ErrorIASZSAlarmed1'];
|
|
27
|
+
const CONTACT_PROPERTY_BASES = ['Open', 'Door', 'Window', 'Contact'];
|
|
28
|
+
const LEAK_PROPERTY_BASES = ['Leak', 'WaterLeak', 'ErrorIASZSAlarmed1'];
|
|
29
|
+
const SMOKE_PROPERTY_BASES = ['Smoke', 'Heat', 'ErrorIASZSAlarmed1'];
|
|
30
|
+
const CO_PROPERTY_BASES = ['CO', 'CarbonMonoxide'];
|
|
31
|
+
const TEMPERATURE_PROPERTY_BASES = ['LocalTemperature_x100', 'MeasuredValue_x100', 'Temperature_x100'];
|
|
32
|
+
const HUMIDITY_PROPERTY_BASES = ['Humidity', 'RelativeHumidity'];
|
|
33
|
+
const AIR_QUALITY_PROPERTY_BASES = ['CO2', 'CarbonDioxide'];
|
|
34
|
+
const UNSUPPORTED_CONSTRAINTS = [
|
|
35
|
+
'Schedules and calendar programs are not directly editable via HomeKit characteristics.',
|
|
36
|
+
'Salus multi-stage hold modes (holiday/boost/permanent/follow) are collapsed to HomeKit mode + target temperature.',
|
|
37
|
+
'Firmware management, binding/pairing topology and low-level diagnostics are cloud-only and not represented in HomeKit.',
|
|
38
|
+
'Advanced thermostat installer parameters (control algorithm, floor limits, valve protection tuning) are not exposed by HomeKit.',
|
|
39
|
+
'Energy history/consumption charts and alert-rule automation are not representable in the Home app UI.',
|
|
40
|
+
];
|
|
41
|
+
export class SalusHomebridgePlatform {
|
|
42
|
+
log;
|
|
43
|
+
api;
|
|
44
|
+
Service;
|
|
45
|
+
Characteristic;
|
|
46
|
+
accessories = new Map();
|
|
47
|
+
accessoryHandlers = new Map();
|
|
48
|
+
configTyped;
|
|
49
|
+
cloudClient;
|
|
50
|
+
pollIntervalMs;
|
|
51
|
+
maxParallelPropertyRequests;
|
|
52
|
+
pollTimer = null;
|
|
53
|
+
pollInProgress = false;
|
|
54
|
+
launchCompleted = false;
|
|
55
|
+
constructor(log, config, api) {
|
|
56
|
+
this.log = log;
|
|
57
|
+
this.api = api;
|
|
58
|
+
this.Service = api.hap.Service;
|
|
59
|
+
this.Characteristic = api.hap.Characteristic;
|
|
60
|
+
this.configTyped = config;
|
|
61
|
+
this.pollIntervalMs = Math.round(clamp(this.configTyped.pollIntervalSeconds ?? DEFAULT_POLL_INTERVAL_SECONDS, MIN_POLL_INTERVAL_SECONDS, MAX_POLL_INTERVAL_SECONDS) * 1_000);
|
|
62
|
+
this.maxParallelPropertyRequests = Math.max(1, Math.floor(this.configTyped.maxParallelPropertyRequests ?? DEFAULT_MAX_PARALLEL_PROPERTY_REQUESTS));
|
|
63
|
+
if (!this.configTyped.email || !this.configTyped.password) {
|
|
64
|
+
this.cloudClient = null;
|
|
65
|
+
this.log.error('Salus credentials are missing. Configure both "email" and "password" in Homebridge settings.');
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.cloudClient = new SalusCloudClient(this.log, this.configTyped);
|
|
69
|
+
this.log.info(`Configured Salus cloud endpoint: ${this.cloudClient.getCloudBaseUrl()}`);
|
|
70
|
+
}
|
|
71
|
+
this.api.on('didFinishLaunching', () => {
|
|
72
|
+
this.launchCompleted = true;
|
|
73
|
+
this.log.info('Homebridge launch completed. Starting Salus device discovery.');
|
|
74
|
+
this.schedulePoll(0);
|
|
75
|
+
});
|
|
76
|
+
this.api.on('shutdown', () => {
|
|
77
|
+
if (this.pollTimer) {
|
|
78
|
+
clearTimeout(this.pollTimer);
|
|
79
|
+
this.pollTimer = null;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
configureAccessory(accessory) {
|
|
84
|
+
this.accessories.set(accessory.UUID, accessory);
|
|
85
|
+
this.log.debug(`Restored cached accessory: ${accessory.displayName}`);
|
|
86
|
+
}
|
|
87
|
+
async writeDeviceProperty(device, propertyName, value) {
|
|
88
|
+
if (!this.cloudClient) {
|
|
89
|
+
throw new Error('Salus cloud client is not initialized due to missing credentials.');
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
await this.cloudClient.setDatapoint(device.dsn, propertyName, value);
|
|
93
|
+
this.log.debug(`Set datapoint ${propertyName}=${JSON.stringify(value)} for ${device.name} (${device.dsn})`);
|
|
94
|
+
this.schedulePoll(2_000);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
this.log.error(`Failed to set datapoint ${propertyName} on ${device.name}: ${asErrorMessage(error)}`);
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
getUnmappedConstraintList() {
|
|
102
|
+
return [...UNSUPPORTED_CONSTRAINTS];
|
|
103
|
+
}
|
|
104
|
+
schedulePoll(delayMs) {
|
|
105
|
+
if (!this.launchCompleted) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (!this.cloudClient) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (this.pollTimer) {
|
|
112
|
+
clearTimeout(this.pollTimer);
|
|
113
|
+
this.pollTimer = null;
|
|
114
|
+
}
|
|
115
|
+
this.pollTimer = setTimeout(() => {
|
|
116
|
+
void this.pollDevices();
|
|
117
|
+
}, Math.max(0, delayMs));
|
|
118
|
+
}
|
|
119
|
+
async pollDevices() {
|
|
120
|
+
if (!this.cloudClient) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (this.pollInProgress) {
|
|
124
|
+
this.log.warn('Previous Salus poll is still in progress; delaying next cycle.');
|
|
125
|
+
this.schedulePoll(2_000);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.pollInProgress = true;
|
|
129
|
+
const discoveredUuids = new Set();
|
|
130
|
+
try {
|
|
131
|
+
const devices = await this.cloudClient.listDevices();
|
|
132
|
+
const uniqueDevices = dedupeDevicesByDsn(devices)
|
|
133
|
+
.filter((device) => !shouldIgnoreInfrastructureDevice(device));
|
|
134
|
+
for (const device of uniqueDevices) {
|
|
135
|
+
discoveredUuids.add(this.api.hap.uuid.generate(`salus:${device.dsn}`));
|
|
136
|
+
}
|
|
137
|
+
const deviceSnapshots = await mapWithConcurrency(uniqueDevices, this.maxParallelPropertyRequests, async (device) => {
|
|
138
|
+
try {
|
|
139
|
+
const properties = await this.cloudClient.listProperties(device.dsn);
|
|
140
|
+
const profile = this.deriveProfile(device, properties);
|
|
141
|
+
return { device, properties, profile };
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
this.log.error(`Failed to fetch properties for ${device.name} (${device.dsn}): ${asErrorMessage(error)}`);
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
let updatedDeviceCount = 0;
|
|
149
|
+
for (const snapshot of deviceSnapshots) {
|
|
150
|
+
if (!snapshot) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
updatedDeviceCount++;
|
|
154
|
+
const uuid = this.api.hap.uuid.generate(`salus:${snapshot.device.dsn}`);
|
|
155
|
+
const existingAccessory = this.accessories.get(uuid);
|
|
156
|
+
if (existingAccessory) {
|
|
157
|
+
this.restoreOrUpdateAccessory(existingAccessory, snapshot.device, snapshot.profile, snapshot.properties);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
this.addAccessory(snapshot.device, snapshot.profile, snapshot.properties, uuid);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
this.removeStaleAccessories(discoveredUuids);
|
|
164
|
+
this.log.info(`Salus sync completed: ${uniqueDevices.length} device(s) discovered, ${updatedDeviceCount} device(s) refreshed.`);
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
this.log.error(`Salus sync failed: ${asErrorMessage(error)}`);
|
|
168
|
+
}
|
|
169
|
+
finally {
|
|
170
|
+
this.pollInProgress = false;
|
|
171
|
+
this.schedulePoll(this.pollIntervalMs);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
addAccessory(device, profile, properties, uuid) {
|
|
175
|
+
const accessory = new this.api.platformAccessory(device.name, uuid);
|
|
176
|
+
const context = accessory.context;
|
|
177
|
+
context.device = {
|
|
178
|
+
id: device.id,
|
|
179
|
+
dsn: device.dsn,
|
|
180
|
+
key: device.key,
|
|
181
|
+
model: device.model,
|
|
182
|
+
name: device.name,
|
|
183
|
+
};
|
|
184
|
+
context.profile = profile;
|
|
185
|
+
const handler = new SalusPlatformAccessory(this, accessory, device, profile);
|
|
186
|
+
handler.updateFromCloud(device, profile, properties);
|
|
187
|
+
this.accessories.set(uuid, accessory);
|
|
188
|
+
this.accessoryHandlers.set(uuid, handler);
|
|
189
|
+
this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
|
|
190
|
+
this.log.info(`Added accessory: ${device.name} [${device.model}] (${device.dsn})`);
|
|
191
|
+
}
|
|
192
|
+
restoreOrUpdateAccessory(accessory, device, profile, properties) {
|
|
193
|
+
const needsNameUpdate = accessory.displayName !== device.name;
|
|
194
|
+
if (needsNameUpdate) {
|
|
195
|
+
accessory.displayName = device.name;
|
|
196
|
+
}
|
|
197
|
+
const context = accessory.context;
|
|
198
|
+
context.device = {
|
|
199
|
+
id: device.id,
|
|
200
|
+
dsn: device.dsn,
|
|
201
|
+
key: device.key,
|
|
202
|
+
model: device.model,
|
|
203
|
+
name: device.name,
|
|
204
|
+
};
|
|
205
|
+
context.profile = profile;
|
|
206
|
+
this.api.updatePlatformAccessories([accessory]);
|
|
207
|
+
let handler = this.accessoryHandlers.get(accessory.UUID);
|
|
208
|
+
if (!handler) {
|
|
209
|
+
handler = new SalusPlatformAccessory(this, accessory, device, profile);
|
|
210
|
+
this.accessoryHandlers.set(accessory.UUID, handler);
|
|
211
|
+
}
|
|
212
|
+
handler.updateFromCloud(device, profile, properties);
|
|
213
|
+
}
|
|
214
|
+
removeStaleAccessories(discoveredUuids) {
|
|
215
|
+
for (const [uuid, accessory] of this.accessories) {
|
|
216
|
+
if (discoveredUuids.has(uuid)) {
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
this.log.info(`Removing stale accessory from cache: ${accessory.displayName}`);
|
|
220
|
+
this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
|
|
221
|
+
this.accessories.delete(uuid);
|
|
222
|
+
this.accessoryHandlers.delete(uuid);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
deriveProfile(device, properties) {
|
|
226
|
+
const catalog = getCatalogEntry(device.model);
|
|
227
|
+
const propertyInferredKind = inferKindFromProperties(properties);
|
|
228
|
+
const catalogInferredKind = inferKindFromCatalog(device.model);
|
|
229
|
+
const kind = propertyInferredKind ?? catalogInferredKind ?? 'switch';
|
|
230
|
+
const constraints = [...UNSUPPORTED_CONSTRAINTS];
|
|
231
|
+
if (kind === 'thermostat') {
|
|
232
|
+
constraints.push('Fan modes and multi-point cooling/heating bands are simplified to HomeKit thermostat controls.');
|
|
233
|
+
}
|
|
234
|
+
if (kind === 'lightbulb') {
|
|
235
|
+
constraints.push('Color scenes/vendor presets are not represented as HomeKit characteristics.');
|
|
236
|
+
}
|
|
237
|
+
if (kind === 'windowCovering') {
|
|
238
|
+
constraints.push('Proprietary roller modes (single/double light relay mode) are mapped to standard position controls.');
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
kind,
|
|
242
|
+
catalog,
|
|
243
|
+
constraints,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function inferKindFromProperties(properties) {
|
|
248
|
+
if (hasAnyPropertyBase(properties, THERMOSTAT_PROPERTY_BASES)) {
|
|
249
|
+
return 'thermostat';
|
|
250
|
+
}
|
|
251
|
+
if (hasAnyPropertyBase(properties, LOCK_PROPERTY_BASES)) {
|
|
252
|
+
return 'lock';
|
|
253
|
+
}
|
|
254
|
+
if (hasAnyPropertyBase(properties, POSITION_PROPERTY_BASES)) {
|
|
255
|
+
return 'windowCovering';
|
|
256
|
+
}
|
|
257
|
+
if (hasAnyPropertyBase(properties, LEAK_PROPERTY_BASES)) {
|
|
258
|
+
return 'leakSensor';
|
|
259
|
+
}
|
|
260
|
+
if (hasAnyPropertyBase(properties, SMOKE_PROPERTY_BASES)) {
|
|
261
|
+
return 'smokeSensor';
|
|
262
|
+
}
|
|
263
|
+
if (hasAnyPropertyBase(properties, CO_PROPERTY_BASES)) {
|
|
264
|
+
return 'carbonMonoxideSensor';
|
|
265
|
+
}
|
|
266
|
+
if (hasAnyPropertyBase(properties, MOTION_PROPERTY_BASES)) {
|
|
267
|
+
return 'motionSensor';
|
|
268
|
+
}
|
|
269
|
+
if (hasAnyPropertyBase(properties, CONTACT_PROPERTY_BASES)) {
|
|
270
|
+
return 'contactSensor';
|
|
271
|
+
}
|
|
272
|
+
if (hasAnyPropertyBase(properties, AIR_QUALITY_PROPERTY_BASES)) {
|
|
273
|
+
return 'airQualitySensor';
|
|
274
|
+
}
|
|
275
|
+
if (hasAnyPropertyBase(properties, HUMIDITY_PROPERTY_BASES) && !hasAnyPropertyBase(properties, TEMPERATURE_PROPERTY_BASES)) {
|
|
276
|
+
return 'humiditySensor';
|
|
277
|
+
}
|
|
278
|
+
if (hasAnyPropertyBase(properties, TEMPERATURE_PROPERTY_BASES)) {
|
|
279
|
+
return 'temperatureSensor';
|
|
280
|
+
}
|
|
281
|
+
if (hasAnyPropertyBase(properties, BRIGHTNESS_PROPERTY_BASES)) {
|
|
282
|
+
return 'lightbulb';
|
|
283
|
+
}
|
|
284
|
+
if (hasAnyPropertyBase(properties, ONOFF_PROPERTY_BASES)) {
|
|
285
|
+
return 'switch';
|
|
286
|
+
}
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
function shouldIgnoreInfrastructureDevice(device) {
|
|
290
|
+
return device.model.includes('AG1') || device.model.includes('UG600') || device.model.includes('WZ600');
|
|
291
|
+
}
|
|
292
|
+
function dedupeDevicesByDsn(devices) {
|
|
293
|
+
const byDsn = new Map();
|
|
294
|
+
for (const device of devices) {
|
|
295
|
+
byDsn.set(device.dsn, device);
|
|
296
|
+
}
|
|
297
|
+
return [...byDsn.values()];
|
|
298
|
+
}
|
|
299
|
+
async function mapWithConcurrency(items, concurrency, mapper) {
|
|
300
|
+
if (items.length === 0) {
|
|
301
|
+
return [];
|
|
302
|
+
}
|
|
303
|
+
const workers = Math.max(1, Math.min(concurrency, items.length));
|
|
304
|
+
const results = new Array(items.length);
|
|
305
|
+
let nextIndex = 0;
|
|
306
|
+
const runner = async () => {
|
|
307
|
+
for (;;) {
|
|
308
|
+
const index = nextIndex;
|
|
309
|
+
nextIndex += 1;
|
|
310
|
+
if (index >= items.length) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
const mapped = await mapper(items[index]);
|
|
314
|
+
results[index] = mapped;
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
await Promise.all(Array.from({ length: workers }, () => runner()));
|
|
318
|
+
return results;
|
|
319
|
+
}
|
|
320
|
+
function asErrorMessage(error) {
|
|
321
|
+
if (error instanceof Error) {
|
|
322
|
+
return error.message;
|
|
323
|
+
}
|
|
324
|
+
return String(error);
|
|
325
|
+
}
|
|
326
|
+
function clamp(value, minValue, maxValue) {
|
|
327
|
+
return Math.max(minValue, Math.min(maxValue, value));
|
|
328
|
+
}
|
|
329
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAI5D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG3D,MAAM,6BAA6B,GAAG,EAAE,CAAC;AACzC,MAAM,sCAAsC,GAAG,CAAC,CAAC;AACjD,MAAM,yBAAyB,GAAG,EAAE,CAAC;AACrC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAEtC,MAAM,yBAAyB,GAAG;IAChC,uBAAuB;IACvB,sBAAsB;IACtB,sBAAsB;IACtB,yBAAyB;IACzB,yBAAyB;IACzB,eAAe;IACf,YAAY;IACZ,cAAc;IACd,aAAa;CACd,CAAC;AACF,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAC5E,MAAM,uBAAuB,GAAG,CAAC,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;AACrG,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;AAC1F,MAAM,yBAAyB,GAAG,CAAC,cA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C,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACjE,MAAM,OAAO,GAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,MAAM,MAAM,GAAG,KAAK,IAAI,EAAE;QACxB,SAAS,CAAC;YACR,MAAM,KAAK,GAAG,SAAS,CAAC;YACxB,SAAS,IAAI,CAAC,CAAC;YACf,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gBAC1B,OAAO;YACT,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,KAAK,CAAE,CAAC,CAAC;YAC3C,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACnE,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,KAAK,CAAC,KAAa,EAAE,QAAgB,EAAE,QAAgB;IAC9D,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { PlatformAccessory } from 'homebridge';
|
|
2
|
+
import type { HomeKitDeviceKind } from './deviceCatalog.js';
|
|
3
|
+
import type { SalusHomebridgePlatform } from './platform.js';
|
|
4
|
+
import type { DeviceProfile, SalusDevice, SalusPropertyMap } from './types.js';
|
|
5
|
+
export declare class SalusPlatformAccessory {
|
|
6
|
+
private readonly platform;
|
|
7
|
+
private readonly accessory;
|
|
8
|
+
private device;
|
|
9
|
+
private profile;
|
|
10
|
+
private service;
|
|
11
|
+
private currentKind;
|
|
12
|
+
private readonly context;
|
|
13
|
+
private latestProperties;
|
|
14
|
+
private writeTargets;
|
|
15
|
+
private cachedTargetState;
|
|
16
|
+
private cachedSystemMode;
|
|
17
|
+
constructor(platform: SalusHomebridgePlatform, accessory: PlatformAccessory, device: SalusDevice, profile: DeviceProfile);
|
|
18
|
+
updateFromCloud(device: SalusDevice, profile: DeviceProfile, properties: SalusPropertyMap): void;
|
|
19
|
+
getCurrentKind(): HomeKitDeviceKind;
|
|
20
|
+
private setAccessoryInformation;
|
|
21
|
+
private ensureService;
|
|
22
|
+
private configureHandlersForCurrentKind;
|
|
23
|
+
private configureThermostat;
|
|
24
|
+
private configureSwitch;
|
|
25
|
+
private configureOutlet;
|
|
26
|
+
private configureLightbulb;
|
|
27
|
+
private configureWindowCovering;
|
|
28
|
+
private configureValve;
|
|
29
|
+
private configureLock;
|
|
30
|
+
private refreshWriteTargets;
|
|
31
|
+
private updateServiceCharacteristics;
|
|
32
|
+
private updateThermostatCharacteristics;
|
|
33
|
+
private updateSwitchCharacteristics;
|
|
34
|
+
private updateOutletCharacteristics;
|
|
35
|
+
private updateLightbulbCharacteristics;
|
|
36
|
+
private updateWindowCoveringCharacteristics;
|
|
37
|
+
private updateValveCharacteristics;
|
|
38
|
+
private updateLockCharacteristics;
|
|
39
|
+
private updateMotionSensorCharacteristics;
|
|
40
|
+
private updateContactSensorCharacteristics;
|
|
41
|
+
private updateLeakSensorCharacteristics;
|
|
42
|
+
private updateSmokeSensorCharacteristics;
|
|
43
|
+
private updateCarbonMonoxideCharacteristics;
|
|
44
|
+
private updateTemperatureSensorCharacteristics;
|
|
45
|
+
private updateHumiditySensorCharacteristics;
|
|
46
|
+
private updateAirQualityCharacteristics;
|
|
47
|
+
private updateOccupancySensorCharacteristics;
|
|
48
|
+
private resolveOnOffState;
|
|
49
|
+
private resolveLockState;
|
|
50
|
+
private resolveGenericBoolean;
|
|
51
|
+
private getPropertyValue;
|
|
52
|
+
private setTargetTemperature;
|
|
53
|
+
private setTargetHeatingCoolingState;
|
|
54
|
+
private setOnOff;
|
|
55
|
+
private setBrightness;
|
|
56
|
+
private setTargetPosition;
|
|
57
|
+
private setValveActive;
|
|
58
|
+
private setLockTargetState;
|
|
59
|
+
private communicationFailure;
|
|
60
|
+
private getServiceDisplayName;
|
|
61
|
+
private getServiceConstructor;
|
|
62
|
+
}
|