@riddix/hamh 2.1.0-alpha.711 → 2.1.0-alpha.712
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/dist/backend/cli.js
CHANGED
|
@@ -145361,6 +145361,15 @@ var ServerModeServerNode = class extends ServerNode {
|
|
|
145361
145361
|
);
|
|
145362
145362
|
}
|
|
145363
145363
|
}
|
|
145364
|
+
// align the pairing device-type hint with the real device (default is vacuum)
|
|
145365
|
+
async updateAdvertisedDeviceType(deviceType) {
|
|
145366
|
+
try {
|
|
145367
|
+
await this.set({ productDescription: { deviceType } });
|
|
145368
|
+
} catch (e) {
|
|
145369
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
145370
|
+
logger180.warn(`Failed to set server-mode device type: ${msg}`);
|
|
145371
|
+
}
|
|
145372
|
+
}
|
|
145364
145373
|
async factoryReset() {
|
|
145365
145374
|
await this.cancel();
|
|
145366
145375
|
await this.erase();
|
|
@@ -160218,10 +160227,29 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
|
|
|
160218
160227
|
}
|
|
160219
160228
|
};
|
|
160220
160229
|
|
|
160230
|
+
// src/matter/endpoints/standalone-endpoint-type.ts
|
|
160231
|
+
init_esm7();
|
|
160232
|
+
var BRIDGED_INFO_ID = "bridgedDeviceBasicInformation";
|
|
160233
|
+
function asStandaloneEndpointType(type) {
|
|
160234
|
+
const behaviors = type.behaviors;
|
|
160235
|
+
if (!(BRIDGED_INFO_ID in behaviors)) {
|
|
160236
|
+
return type;
|
|
160237
|
+
}
|
|
160238
|
+
const kept = Object.entries(behaviors).filter(([id]) => id !== BRIDGED_INFO_ID).map(([, behavior]) => behavior);
|
|
160239
|
+
return MutableEndpoint({
|
|
160240
|
+
name: type.name,
|
|
160241
|
+
deviceType: type.deviceType,
|
|
160242
|
+
deviceRevision: type.deviceRevision,
|
|
160243
|
+
deviceClass: type.deviceClass,
|
|
160244
|
+
requirements: type.requirements,
|
|
160245
|
+
behaviors: SupportedBehaviors(...kept)
|
|
160246
|
+
});
|
|
160247
|
+
}
|
|
160248
|
+
|
|
160221
160249
|
// src/matter/endpoints/legacy/legacy-endpoint.ts
|
|
160222
160250
|
var logger225 = Logger.get("LegacyEndpoint");
|
|
160223
160251
|
var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
160224
|
-
static async create(registry2, entityId, mapping, pluginDomainMappings) {
|
|
160252
|
+
static async create(registry2, entityId, mapping, pluginDomainMappings, standalone = false) {
|
|
160225
160253
|
const deviceRegistry = registry2.deviceOf(entityId);
|
|
160226
160254
|
let state = registry2.initialState(entityId);
|
|
160227
160255
|
const entity = registry2.entity(entityId);
|
|
@@ -160547,7 +160575,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
160547
160575
|
}
|
|
160548
160576
|
}
|
|
160549
160577
|
const areaName = registry2.getAreaName(entityId);
|
|
160550
|
-
|
|
160578
|
+
let type = createLegacyEndpointType(payload, effectiveMapping, areaName, {
|
|
160551
160579
|
vacuumOnOff: registry2.isVacuumOnOffEnabled(),
|
|
160552
160580
|
cleaningModeOptions,
|
|
160553
160581
|
pluginDomainMappings
|
|
@@ -160555,6 +160583,9 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
160555
160583
|
if (!type) {
|
|
160556
160584
|
return;
|
|
160557
160585
|
}
|
|
160586
|
+
if (standalone) {
|
|
160587
|
+
type = asStandaloneEndpointType(type);
|
|
160588
|
+
}
|
|
160558
160589
|
const customName = effectiveMapping?.customName;
|
|
160559
160590
|
const mappedIds = getMappedEntityIds(effectiveMapping);
|
|
160560
160591
|
return new _LegacyEndpoint(type, entityId, customName, mappedIds);
|
|
@@ -163243,7 +163274,9 @@ var ServerModeEndpointManager = class extends Service {
|
|
|
163243
163274
|
const endpoint = await LegacyEndpoint.create(
|
|
163244
163275
|
this.registry,
|
|
163245
163276
|
entityId,
|
|
163246
|
-
mapping
|
|
163277
|
+
mapping,
|
|
163278
|
+
void 0,
|
|
163279
|
+
true
|
|
163247
163280
|
);
|
|
163248
163281
|
if (!endpoint) {
|
|
163249
163282
|
this._failedEntities.push({
|
|
@@ -163286,6 +163319,10 @@ var ServerModeEndpointManager = class extends Service {
|
|
|
163286
163319
|
mapping,
|
|
163287
163320
|
friendlyName
|
|
163288
163321
|
);
|
|
163322
|
+
const deviceType = this.deviceEndpoint?.type?.deviceType;
|
|
163323
|
+
if (deviceType != null) {
|
|
163324
|
+
await this.serverNode.updateAdvertisedDeviceType(deviceType);
|
|
163325
|
+
}
|
|
163289
163326
|
}
|
|
163290
163327
|
/**
|
|
163291
163328
|
* Creates a Server Mode Vacuum endpoint without BridgedDeviceBasicInformation.
|