@homebridge-plugins/homebridge-smarthq 0.5.0-beta.4 → 0.5.0-beta.41
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/.github/ISSUE_TEMPLATE/config.yml +1 -1
- package/.github/copilot-instructions.md +361 -0
- package/.github/scripts/branch-helper.sh +41 -0
- package/.github/workflows/beta-release.yml +1 -1
- package/.github/workflows/release.yml +53 -17
- package/CHANGELOG.md +563 -18
- package/MATTER.md +304 -0
- package/README.md +15 -0
- package/config.schema.json +24 -5
- package/dist/devices/OpalIceMaker/Managers/OpalDescaleSvcManager.d.ts.map +1 -1
- package/dist/devices/OpalIceMaker/Managers/OpalDescaleSvcManager.js +3 -1
- package/dist/devices/OpalIceMaker/Managers/OpalDescaleSvcManager.js.map +1 -1
- package/dist/devices/OpalIceMaker/Managers/OpalFilterMaintenanceSvcManager.d.ts.map +1 -1
- package/dist/devices/OpalIceMaker/Managers/OpalFilterMaintenanceSvcManager.js +3 -1
- package/dist/devices/OpalIceMaker/Managers/OpalFilterMaintenanceSvcManager.js.map +1 -1
- package/dist/devices/OpalIceMaker/Managers/OpalPowerSvcManager.js +1 -1
- package/dist/devices/OpalIceMaker/Managers/OpalPowerSvcManager.js.map +1 -1
- package/dist/devices/OpalIceMaker/Managers/OpalProgressSvcManager.d.ts +1 -1
- package/dist/devices/OpalIceMaker/Managers/OpalProgressSvcManager.d.ts.map +1 -1
- package/dist/devices/OpalIceMaker/Managers/OpalProgressSvcManager.js +12 -5
- package/dist/devices/OpalIceMaker/Managers/OpalProgressSvcManager.js.map +1 -1
- package/dist/devices/OpalIceMaker/Managers/StatusManagers/OpalStatusBase.d.ts.map +1 -1
- package/dist/devices/OpalIceMaker/Managers/StatusManagers/OpalStatusBase.js +4 -2
- package/dist/devices/OpalIceMaker/Managers/StatusManagers/OpalStatusBase.js.map +1 -1
- package/dist/devices/OpalIceMaker/OpalDeviceBase.d.ts +3 -4
- package/dist/devices/OpalIceMaker/OpalDeviceBase.d.ts.map +1 -1
- package/dist/devices/OpalIceMaker/OpalDeviceBase.js +3 -18
- package/dist/devices/OpalIceMaker/OpalDeviceBase.js.map +1 -1
- package/dist/devices/advantium.d.ts +10 -0
- package/dist/devices/advantium.d.ts.map +1 -0
- package/dist/devices/advantium.js +75 -0
- package/dist/devices/advantium.js.map +1 -0
- package/dist/devices/airConditioner.d.ts +11 -2
- package/dist/devices/airConditioner.d.ts.map +1 -1
- package/dist/devices/airConditioner.js +111 -17
- package/dist/devices/airConditioner.js.map +1 -1
- package/dist/devices/beverageCenter.d.ts +10 -0
- package/dist/devices/beverageCenter.d.ts.map +1 -0
- package/dist/devices/beverageCenter.js +125 -0
- package/dist/devices/beverageCenter.js.map +1 -0
- package/dist/devices/clothesDryer.d.ts +21 -0
- package/dist/devices/clothesDryer.d.ts.map +1 -0
- package/dist/devices/clothesDryer.js +273 -0
- package/dist/devices/clothesDryer.js.map +1 -0
- package/dist/devices/clothesWasher.d.ts +21 -0
- package/dist/devices/clothesWasher.d.ts.map +1 -0
- package/dist/devices/clothesWasher.js +284 -0
- package/dist/devices/clothesWasher.js.map +1 -0
- package/dist/devices/coffeeMaker.d.ts +10 -0
- package/dist/devices/coffeeMaker.d.ts.map +1 -0
- package/dist/devices/coffeeMaker.js +79 -0
- package/dist/devices/coffeeMaker.js.map +1 -0
- package/dist/devices/device.d.ts +108 -13
- package/dist/devices/device.d.ts.map +1 -1
- package/dist/devices/device.js +381 -60
- package/dist/devices/device.js.map +1 -1
- package/dist/devices/dishwasher.d.ts +9 -3
- package/dist/devices/dishwasher.d.ts.map +1 -1
- package/dist/devices/dishwasher.js +164 -29
- package/dist/devices/dishwasher.js.map +1 -1
- package/dist/devices/hood.d.ts +41 -0
- package/dist/devices/hood.d.ts.map +1 -0
- package/dist/devices/hood.js +336 -0
- package/dist/devices/hood.js.map +1 -0
- package/dist/devices/microwave.d.ts +19 -0
- package/dist/devices/microwave.d.ts.map +1 -0
- package/dist/devices/microwave.js +147 -0
- package/dist/devices/microwave.js.map +1 -0
- package/dist/devices/oven.d.ts +9 -2
- package/dist/devices/oven.d.ts.map +1 -1
- package/dist/devices/oven.js +267 -43
- package/dist/devices/oven.js.map +1 -1
- package/dist/devices/refrigerator.d.ts +37 -2
- package/dist/devices/refrigerator.d.ts.map +1 -1
- package/dist/devices/refrigerator.js +583 -34
- package/dist/devices/refrigerator.js.map +1 -1
- package/dist/devices/waterFilter.d.ts +10 -0
- package/dist/devices/waterFilter.d.ts.map +1 -0
- package/dist/devices/waterFilter.js +67 -0
- package/dist/devices/waterFilter.js.map +1 -0
- package/dist/devices/waterHeater.d.ts +19 -0
- package/dist/devices/waterHeater.d.ts.map +1 -0
- package/dist/devices/waterHeater.js +161 -0
- package/dist/devices/waterHeater.js.map +1 -0
- package/dist/devices/waterSoftener.d.ts +10 -0
- package/dist/devices/waterSoftener.d.ts.map +1 -0
- package/dist/devices/waterSoftener.js +67 -0
- package/dist/devices/waterSoftener.js.map +1 -0
- package/dist/getAccessToken.d.ts.map +1 -1
- package/dist/getAccessToken.js +190 -2
- package/dist/getAccessToken.js.map +1 -1
- package/dist/platform.d.ts +32 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +853 -151
- package/dist/platform.js.map +1 -1
- package/dist/platform.test.d.ts +2 -0
- package/dist/platform.test.d.ts.map +1 -0
- package/dist/platform.test.js +80 -0
- package/dist/platform.test.js.map +1 -0
- package/dist/settings.d.ts +24 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +13 -0
- package/dist/settings.js.map +1 -1
- package/docs/assets/highlight.css +7 -0
- package/docs/assets/main.js +5 -5
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +248 -226
- package/docs/classes/SmartHQPlatform.html +54 -56
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +22 -12
- package/docs/interfaces/DeviceOptions.html +2 -3
- package/docs/interfaces/SmartHQPlatformConfig.html +6 -17
- package/docs/interfaces/SmartHqContext.html +6 -4
- package/docs/interfaces/SmartHqERDResponse.html +7 -8
- package/docs/interfaces/credentials.html +3 -4
- package/docs/interfaces/devicesConfig.html +9 -8
- package/docs/interfaces/options.html +7 -8
- package/docs/media/copilot-instructions.md +361 -0
- package/docs/modules.html +1 -2
- package/docs/variables/API_URL.html +1 -2
- package/docs/variables/ERD_CODES.html +1 -2
- package/docs/variables/ERD_TYPES.html +1 -2
- package/docs/variables/KEEPALIVE_TIMEOUT.html +1 -2
- package/docs/variables/LOGIN_URL.html +2 -3
- package/docs/variables/OAUTH2_CLIENT_ID.html +1 -2
- package/docs/variables/OAUTH2_CLIENT_SECRET.html +1 -2
- package/docs/variables/OAUTH2_REDIRECT_URI.html +1 -2
- package/docs/variables/PLATFORM_NAME.html +2 -3
- package/docs/variables/PLUGIN_NAME.html +2 -3
- package/docs/variables/SECURE_URL.html +2 -3
- package/docs/variables/default.html +1 -0
- package/package.json +22 -33
- package/typedoc.json +0 -4
- package/vitest.config.ts +6 -5
- package/.github/workflows/build.yml +0 -18
- package/.github/workflows/changerelease.yml +0 -11
- package/.github/workflows/labeler.yml +0 -9
- package/.github/workflows/release-drafter.yml +0 -14
- package/docs/assets/dmt/dmt-component-data.js +0 -1
- package/docs/assets/dmt/dmt-components.css +0 -20
- package/docs/assets/dmt/dmt-components.js +0 -67
- package/docs/assets/dmt/dmt-search.cmp +0 -0
- package/docs/assets/dmt/dmt-theme.css +0 -1
- package/docs/functions/default.html +0 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PlatformAccessory } from 'homebridge';
|
|
2
|
+
import type { SmartHQPlatform } from '../platform.js';
|
|
3
|
+
import type { devicesConfig, SmartHqContext } from '../settings.js';
|
|
4
|
+
import { deviceBase } from './device.js';
|
|
5
|
+
export declare class SmartHQCoffeeMaker extends deviceBase {
|
|
6
|
+
readonly platform: SmartHQPlatform;
|
|
7
|
+
readonly device: SmartHqContext['device'] & devicesConfig;
|
|
8
|
+
constructor(platform: SmartHQPlatform, accessory: PlatformAccessory<SmartHqContext>, device: SmartHqContext['device'] & devicesConfig);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=coffeeMaker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coffeeMaker.d.ts","sourceRoot":"","sources":["../../src/devices/coffeeMaker.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,qBAAa,kBAAmB,SAAQ,UAAU;IAE9C,QAAQ,CAAC,QAAQ,EAAE,eAAe;IAElC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,aAAa;gBAFhD,QAAQ,EAAE,eAAe,EAClC,SAAS,EAAE,iBAAiB,CAAC,cAAc,CAAC,EACnC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,aAAa;CAuE5D"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { deviceBase } from './device.js';
|
|
2
|
+
export class SmartHQCoffeeMaker extends deviceBase {
|
|
3
|
+
platform;
|
|
4
|
+
device;
|
|
5
|
+
constructor(platform, accessory, device) {
|
|
6
|
+
super(platform, accessory, device);
|
|
7
|
+
this.platform = platform;
|
|
8
|
+
this.device = device;
|
|
9
|
+
this.debugLog(`Coffee Maker Features: ${JSON.stringify(accessory.context.device.features)}`);
|
|
10
|
+
// Coffee Maker Brewing State (Valve)
|
|
11
|
+
const brewValve = this.accessory.getService('Coffee Maker') ?? this.accessory.addService(this.platform.Service.Valve, 'Coffee Maker', 'CoffeeMaker');
|
|
12
|
+
brewValve.setCharacteristic(this.platform.Characteristic.Name, 'Coffee Maker');
|
|
13
|
+
brewValve.setCharacteristic(this.platform.Characteristic.ValveType, this.platform.Characteristic.ValveType.GENERIC_VALVE);
|
|
14
|
+
brewValve
|
|
15
|
+
.getCharacteristic(this.platform.Characteristic.Active)
|
|
16
|
+
.onGet(async () => {
|
|
17
|
+
try {
|
|
18
|
+
// TODO: Implement brewing state ERD
|
|
19
|
+
return this.platform.Characteristic.Active.INACTIVE;
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
this.warnLog?.(`Coffee Maker Active error: ${error?.message ?? error}`);
|
|
23
|
+
return this.platform.Characteristic.Active.INACTIVE;
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
.onSet(async (value) => {
|
|
27
|
+
try {
|
|
28
|
+
// TODO: Implement brew control ERD
|
|
29
|
+
this.debugLog(`Coffee Maker brew set to: ${value}`);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
this.warnLog?.(`Coffee Maker brew set error: ${error?.message ?? error}`);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
brewValve
|
|
36
|
+
.getCharacteristic(this.platform.Characteristic.InUse)
|
|
37
|
+
.onGet(async () => {
|
|
38
|
+
try {
|
|
39
|
+
// TODO: Implement brewing state ERD
|
|
40
|
+
return this.platform.Characteristic.InUse.NOT_IN_USE;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
this.warnLog?.(`Coffee Maker InUse error: ${error?.message ?? error}`);
|
|
44
|
+
return this.platform.Characteristic.InUse.NOT_IN_USE;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
// Water Level Sensor (Humidity as proxy)
|
|
48
|
+
const waterLevel = this.accessory.getService('Water Level') ?? this.accessory.addService(this.platform.Service.HumiditySensor, 'Water Level', 'WaterLevel');
|
|
49
|
+
waterLevel.setCharacteristic(this.platform.Characteristic.Name, 'Water Level');
|
|
50
|
+
waterLevel
|
|
51
|
+
.getCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity)
|
|
52
|
+
.onGet(async () => {
|
|
53
|
+
try {
|
|
54
|
+
// TODO: Implement water level ERD (0-100%)
|
|
55
|
+
return 100;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
this.warnLog?.(`Coffee Maker Water Level error: ${error?.message ?? error}`);
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
// Filter/Cleaning Status
|
|
63
|
+
const filterService = this.accessory.getService('Coffee Filter') ?? this.accessory.addService(this.platform.Service.FilterMaintenance, 'Coffee Filter', 'CoffeeFilter');
|
|
64
|
+
filterService.setCharacteristic(this.platform.Characteristic.Name, 'Coffee Filter');
|
|
65
|
+
filterService
|
|
66
|
+
.getCharacteristic(this.platform.Characteristic.FilterChangeIndication)
|
|
67
|
+
.onGet(async () => {
|
|
68
|
+
try {
|
|
69
|
+
// TODO: Implement filter/cleaning status ERD
|
|
70
|
+
return this.platform.Characteristic.FilterChangeIndication.FILTER_OK;
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
this.warnLog?.(`Coffee Filter Status error: ${error?.message ?? error}`);
|
|
74
|
+
return this.platform.Characteristic.FilterChangeIndication.FILTER_OK;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=coffeeMaker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coffeeMaker.js","sourceRoot":"","sources":["../../src/devices/coffeeMaker.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAErC;IAEA;IAHX,YACW,QAAyB,EAClC,SAA4C,EACnC,MAAgD;QAEzD,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;QAJzB,aAAQ,GAAR,QAAQ,CAAiB;QAEzB,WAAM,GAAN,MAAM,CA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CAAC,CAAA;gBAC5E,OAAO,CAAC,CAAA;YACV,CAAC;QACH,CAAC,CAAC,CAAA;QAEJ,yBAAyB;QACzB,MAAM,aAAa,GAAG,IAAI,CAAC,SAAU,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,SAAU,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,iBAAiB,EAAE,eAAe,EAAE,cAAc,CAAC,CAAA;QACzK,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,CAAA;QACnF,aAAa;aACV,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC;aACtE,KAAK,CAAC,KAAK,IAAI,EAAE;YAChB,IAAI,CAAC;gBACH,6CAA6C;gBAC7C,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC,SAAS,CAAA;YACtE,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,CAAC,OAAO,EAAE,CAAC,+BAA+B,KAAK,EAAE,OAAO,IAAI,KAAK,EAAE,CAAC,CAAA;gBACxE,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC,SAAS,CAAA;YACtE,CAAC;QACH,CAAC,CAAC,CAAA;IACN,CAAC;CACF"}
|
package/dist/devices/device.d.ts
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import type { API, CharacteristicValue, HAP, Logging, PlatformAccessory, Service } from 'homebridge';
|
|
2
2
|
import type { SmartHQPlatform } from '../platform.js';
|
|
3
3
|
import type { devicesConfig, SmartHqContext, SmartHQPlatformConfig } from '../settings.js';
|
|
4
|
+
export interface MatterAccessory {
|
|
5
|
+
UUID: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
serialNumber: string;
|
|
8
|
+
manufacturer: string;
|
|
9
|
+
model: string;
|
|
10
|
+
firmwareRevision: string;
|
|
11
|
+
hardwareRevision: string;
|
|
12
|
+
deviceType: any;
|
|
13
|
+
clusters?: Record<string, unknown>;
|
|
14
|
+
handlers?: Record<string, unknown>;
|
|
15
|
+
parts?: Array<MatterAccessory>;
|
|
16
|
+
context?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Unified base class for SmartHQ devices supporting both HAP and Matter protocols
|
|
20
|
+
* Contains all shared functionality for ERD operations, logging, configuration, and protocol handling
|
|
21
|
+
*/
|
|
4
22
|
export declare abstract class deviceBase {
|
|
5
23
|
protected readonly platform: SmartHQPlatform;
|
|
6
|
-
protected accessory: PlatformAccessory<SmartHqContext>;
|
|
7
|
-
protected device: devicesConfig;
|
|
8
24
|
readonly api: API;
|
|
9
25
|
readonly log: Logging;
|
|
10
26
|
readonly config: SmartHQPlatformConfig;
|
|
@@ -14,22 +30,41 @@ export declare abstract class deviceBase {
|
|
|
14
30
|
protected deviceUpdateRate: number;
|
|
15
31
|
protected devicePushRate: number;
|
|
16
32
|
protected deviceFirmwareVersion: string;
|
|
17
|
-
|
|
33
|
+
private unsupportedErds;
|
|
34
|
+
protected accessory?: PlatformAccessory<SmartHqContext>;
|
|
35
|
+
protected matterAccessory?: MatterAccessory;
|
|
36
|
+
protected matterUuid?: string;
|
|
37
|
+
protected userId?: string;
|
|
38
|
+
protected matterRegistered: boolean;
|
|
39
|
+
protected useMatter: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Get the HAP accessory (throws if not in HAP mode)
|
|
42
|
+
*/
|
|
43
|
+
protected get hapAccessory(): PlatformAccessory<SmartHqContext>;
|
|
44
|
+
constructor(platform: SmartHQPlatform, accessoryOrDevice: PlatformAccessory<SmartHqContext> | devicesConfig, deviceOrUserId?: devicesConfig | string);
|
|
18
45
|
getDeviceLogSettings(device: devicesConfig): Promise<void>;
|
|
19
46
|
getDeviceRateSettings(device: devicesConfig): Promise<void>;
|
|
20
47
|
getDeviceConfigSettings(device: devicesConfig): Promise<void>;
|
|
21
|
-
getDeviceContext(accessory: PlatformAccessory, device: devicesConfig): Promise<void>;
|
|
22
48
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @param Service Service
|
|
26
|
-
* @param Characteristic Characteristic
|
|
27
|
-
* @param CharacteristicValue CharacteristicValue | undefined
|
|
28
|
-
* @param CharacteristicName string
|
|
29
|
-
* @return: void
|
|
30
|
-
*
|
|
49
|
+
* Get and parse device firmware version
|
|
31
50
|
*/
|
|
32
|
-
|
|
51
|
+
protected parseFirmwareVersion(firmware?: string): Promise<string>;
|
|
52
|
+
/**
|
|
53
|
+
* Initialize HAP accessory information
|
|
54
|
+
*/
|
|
55
|
+
private initializeHAPAccessory;
|
|
56
|
+
/**
|
|
57
|
+
* Get the appliance ID for ERD operations
|
|
58
|
+
*/
|
|
59
|
+
protected getApplianceId(): string;
|
|
60
|
+
/**
|
|
61
|
+
* Get the user ID for ERD operations
|
|
62
|
+
*/
|
|
63
|
+
protected getUserId(): string;
|
|
64
|
+
/**
|
|
65
|
+
* Get the device display name for logging
|
|
66
|
+
*/
|
|
67
|
+
protected getDisplayName(): string;
|
|
33
68
|
/**
|
|
34
69
|
* Logging for Device
|
|
35
70
|
*/
|
|
@@ -43,5 +78,65 @@ export declare abstract class deviceBase {
|
|
|
43
78
|
debugLog(...log: any[]): Promise<void>;
|
|
44
79
|
loggingIsDebug(): Promise<boolean>;
|
|
45
80
|
enablingDeviceLogging(): Promise<boolean>;
|
|
81
|
+
/**
|
|
82
|
+
* Check if an ERD code is supported by this appliance
|
|
83
|
+
*/
|
|
84
|
+
has_erd_code(erd: string): Promise<boolean>;
|
|
85
|
+
/**
|
|
86
|
+
* Try to get an ERD value without throwing errors
|
|
87
|
+
*/
|
|
88
|
+
try_get_erd_value(erd: string): Promise<string | undefined>;
|
|
89
|
+
/**
|
|
90
|
+
* Read an ERD (Electronic Refrigerator Descriptor) value from the SmartHQ API
|
|
91
|
+
*/
|
|
92
|
+
readErd(erd: string): Promise<string | undefined>;
|
|
93
|
+
/**
|
|
94
|
+
* Write an ERD (Electronic Refrigerator Descriptor) value to the SmartHQ API
|
|
95
|
+
*/
|
|
96
|
+
writeErd(erd: string, value: string | boolean): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Get device context for HAP accessories
|
|
99
|
+
*/
|
|
100
|
+
getDeviceContext(accessory: PlatformAccessory, device: devicesConfig): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Get device firmware version for Matter devices
|
|
103
|
+
*/
|
|
104
|
+
getDeviceFirmwareVersion(device: devicesConfig): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Update HAP characteristic value and log the change
|
|
107
|
+
*/
|
|
108
|
+
updateCharacteristic(Service: Service, Characteristic: any, CharacteristicValue: CharacteristicValue | undefined, CharacteristicName: string): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Create Matter accessory configuration
|
|
111
|
+
* Should be overridden by device-specific implementations that support Matter
|
|
112
|
+
*/
|
|
113
|
+
protected createMatterAccessory(): MatterAccessory | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Get the Matter accessory instance
|
|
116
|
+
*/
|
|
117
|
+
getMatterAccessory(): MatterAccessory | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Validate Matter API availability and log details for debugging
|
|
120
|
+
*/
|
|
121
|
+
protected validateMatterAPI(): {
|
|
122
|
+
valid: boolean;
|
|
123
|
+
api: any;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Helper to create base Matter accessory info
|
|
127
|
+
*/
|
|
128
|
+
protected createBaseMatterConfig(): {
|
|
129
|
+
UUID: any;
|
|
130
|
+
displayName: any;
|
|
131
|
+
serialNumber: any;
|
|
132
|
+
manufacturer: any;
|
|
133
|
+
model: any;
|
|
134
|
+
firmwareRevision: string;
|
|
135
|
+
hardwareRevision: string;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Update Matter cluster state
|
|
139
|
+
*/
|
|
140
|
+
protected updateMatterState(clusterName: string, attributes: Record<string, unknown>): Promise<void>;
|
|
46
141
|
}
|
|
47
142
|
//# sourceMappingURL=device.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/devices/device.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,mBAAmB,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/devices/device.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,mBAAmB,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAK1F,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,GAAG,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,KAAK,CAA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