@riddix/hamh 2.1.0-alpha.837 → 2.1.0-alpha.838
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
|
@@ -1767,8 +1767,8 @@ var init_Cancelable = __esm({
|
|
|
1767
1767
|
};
|
|
1768
1768
|
return result;
|
|
1769
1769
|
}
|
|
1770
|
-
static set logger(
|
|
1771
|
-
this.#logger =
|
|
1770
|
+
static set logger(logger248) {
|
|
1771
|
+
this.#logger = logger248;
|
|
1772
1772
|
}
|
|
1773
1773
|
static get logger() {
|
|
1774
1774
|
return this.#logger;
|
|
@@ -3475,13 +3475,13 @@ var init_Logger = __esm({
|
|
|
3475
3475
|
*
|
|
3476
3476
|
* @deprecated use {@link destinations}
|
|
3477
3477
|
*/
|
|
3478
|
-
static addLogger(identifier,
|
|
3478
|
+
static addLogger(identifier, logger248, options) {
|
|
3479
3479
|
if (identifier in this.destinations) {
|
|
3480
3480
|
throw new ImplementationError(`Logger "${identifier}" already exists`);
|
|
3481
3481
|
}
|
|
3482
3482
|
const dest = LogDestination({ name: identifier });
|
|
3483
3483
|
const legacy = adaptDestinationToLegacy(dest);
|
|
3484
|
-
legacy.log =
|
|
3484
|
+
legacy.log = logger248;
|
|
3485
3485
|
if (options?.defaultLogLevel !== void 0) {
|
|
3486
3486
|
legacy.defaultLogLevel = options.defaultLogLevel;
|
|
3487
3487
|
}
|
|
@@ -5687,8 +5687,8 @@ var init_Construction = __esm({
|
|
|
5687
5687
|
}
|
|
5688
5688
|
}
|
|
5689
5689
|
#unhandledError(...args) {
|
|
5690
|
-
const
|
|
5691
|
-
|
|
5690
|
+
const logger248 = Logger.get(this.#subject.constructor.name);
|
|
5691
|
+
logger248.error(...args);
|
|
5692
5692
|
}
|
|
5693
5693
|
#createErrorHandler(name) {
|
|
5694
5694
|
return (e) => {
|
|
@@ -64070,8 +64070,8 @@ var init_NodeSession = __esm({
|
|
|
64070
64070
|
return session?.type === SessionType.Unicast;
|
|
64071
64071
|
}
|
|
64072
64072
|
NodeSession2.is = is;
|
|
64073
|
-
function logNew(
|
|
64074
|
-
|
|
64073
|
+
function logNew(logger248, operation, session, messenger, fabric, peerNodeId) {
|
|
64074
|
+
logger248.info(
|
|
64075
64075
|
session.via,
|
|
64076
64076
|
`${operation} session with`,
|
|
64077
64077
|
Diagnostic.strong(PeerAddress({ fabricIndex: fabric.fabricIndex, nodeId: peerNodeId }).toString()),
|
|
@@ -117714,11 +117714,11 @@ var init_Api = __esm({
|
|
|
117714
117714
|
}
|
|
117715
117715
|
Api2.resourceFor = resourceFor;
|
|
117716
117716
|
function log(level, facility, id, ...message) {
|
|
117717
|
-
let
|
|
117718
|
-
if (!
|
|
117719
|
-
loggers.set(facility,
|
|
117717
|
+
let logger248 = loggers.get(facility);
|
|
117718
|
+
if (!logger248) {
|
|
117719
|
+
loggers.set(facility, logger248 = Logger.get(facility));
|
|
117720
117720
|
}
|
|
117721
|
-
|
|
117721
|
+
logger248[level](Diagnostic.via(id || "(anon)"), message);
|
|
117722
117722
|
}
|
|
117723
117723
|
Api2.log = log;
|
|
117724
117724
|
function logRequest(facility, id, method, target) {
|
|
@@ -131221,6 +131221,13 @@ var init_controller_compat = __esm({
|
|
|
131221
131221
|
aqara: "yes",
|
|
131222
131222
|
note: "Aqara lists battery storage; others show battery inside a device."
|
|
131223
131223
|
},
|
|
131224
|
+
1292: {
|
|
131225
|
+
apple: "no",
|
|
131226
|
+
google: "no",
|
|
131227
|
+
alexa: "no",
|
|
131228
|
+
aqara: "yes",
|
|
131229
|
+
note: "HA and Aqara render EnergyEvse; SmartThings announced support, unconfirmed. Bridged EVSE can break Alexa device recognition, keep it off Alexa bridges."
|
|
131230
|
+
},
|
|
131224
131231
|
39: {
|
|
131225
131232
|
apple: "no",
|
|
131226
131233
|
google: "no",
|
|
@@ -132624,10 +132631,10 @@ var init_home_assistant_actions = __esm({
|
|
|
132624
132631
|
circuitBreakerResetMs: 3e4
|
|
132625
132632
|
};
|
|
132626
132633
|
HomeAssistantActions = class extends Service {
|
|
132627
|
-
constructor(
|
|
132634
|
+
constructor(logger248, client, config11) {
|
|
132628
132635
|
super("HomeAssistantActions");
|
|
132629
132636
|
this.client = client;
|
|
132630
|
-
this.log =
|
|
132637
|
+
this.log = logger248.get(this);
|
|
132631
132638
|
this.config = { ...defaultConfig, ...config11 };
|
|
132632
132639
|
this.circuitBreaker = new CircuitBreaker(
|
|
132633
132640
|
this.config.circuitBreakerThreshold,
|
|
@@ -132973,10 +132980,10 @@ var DiagnosticService = class {
|
|
|
132973
132980
|
};
|
|
132974
132981
|
|
|
132975
132982
|
// src/api/access-log.ts
|
|
132976
|
-
function accessLogger(
|
|
132983
|
+
function accessLogger(logger248) {
|
|
132977
132984
|
return (req, res, next) => {
|
|
132978
132985
|
res.on("finish", () => {
|
|
132979
|
-
|
|
132986
|
+
logger248.debug(
|
|
132980
132987
|
`${req.method} ${decodeURI(req.originalUrl)} ${res.statusCode} ${res.statusMessage} from ${req.socket.remoteAddress}`
|
|
132981
132988
|
);
|
|
132982
132989
|
});
|
|
@@ -133161,6 +133168,8 @@ WARNING: ${includeIdentity ? "This backup contains sensitive Matter identity dat
|
|
|
133161
133168
|
currentEntity: config11.currentEntity,
|
|
133162
133169
|
batteryPowerEntity: config11.batteryPowerEntity,
|
|
133163
133170
|
batteryEnergyEntity: config11.batteryEnergyEntity,
|
|
133171
|
+
chargingSwitchEntity: config11.chargingSwitchEntity,
|
|
133172
|
+
currentLimitEntity: config11.currentLimitEntity,
|
|
133164
133173
|
suctionLevelEntity: config11.suctionLevelEntity,
|
|
133165
133174
|
mopIntensityEntity: config11.mopIntensityEntity,
|
|
133166
133175
|
valetudoIdentifier: config11.valetudoIdentifier,
|
|
@@ -133322,6 +133331,8 @@ WARNING: ${includeIdentity ? "This backup contains sensitive Matter identity dat
|
|
|
133322
133331
|
currentEntity: config11.currentEntity,
|
|
133323
133332
|
batteryPowerEntity: config11.batteryPowerEntity,
|
|
133324
133333
|
batteryEnergyEntity: config11.batteryEnergyEntity,
|
|
133334
|
+
chargingSwitchEntity: config11.chargingSwitchEntity,
|
|
133335
|
+
currentLimitEntity: config11.currentLimitEntity,
|
|
133325
133336
|
suctionLevelEntity: config11.suctionLevelEntity,
|
|
133326
133337
|
mopIntensityEntity: config11.mopIntensityEntity,
|
|
133327
133338
|
temperatureEntity: config11.temperatureEntity,
|
|
@@ -134174,6 +134185,8 @@ function entityMappingApi(mappingStorage, identityStorage) {
|
|
|
134174
134185
|
currentEntity: body.currentEntity,
|
|
134175
134186
|
batteryPowerEntity: body.batteryPowerEntity,
|
|
134176
134187
|
batteryEnergyEntity: body.batteryEnergyEntity,
|
|
134188
|
+
chargingSwitchEntity: body.chargingSwitchEntity,
|
|
134189
|
+
currentLimitEntity: body.currentLimitEntity,
|
|
134177
134190
|
suctionLevelEntity: body.suctionLevelEntity,
|
|
134178
134191
|
mopIntensityEntity: body.mopIntensityEntity,
|
|
134179
134192
|
customServiceAreas: body.customServiceAreas,
|
|
@@ -134675,6 +134688,8 @@ function configToProfileEntry(config11) {
|
|
|
134675
134688
|
currentEntity: config11.currentEntity,
|
|
134676
134689
|
batteryPowerEntity: config11.batteryPowerEntity,
|
|
134677
134690
|
batteryEnergyEntity: config11.batteryEnergyEntity,
|
|
134691
|
+
chargingSwitchEntity: config11.chargingSwitchEntity,
|
|
134692
|
+
currentLimitEntity: config11.currentLimitEntity,
|
|
134678
134693
|
suctionLevelEntity: config11.suctionLevelEntity,
|
|
134679
134694
|
mopIntensityEntity: config11.mopIntensityEntity,
|
|
134680
134695
|
customServiceAreas: config11.customServiceAreas,
|
|
@@ -134814,6 +134829,8 @@ function mappingProfileApi(mappingStorage) {
|
|
|
134814
134829
|
currentEntity: entry.currentEntity,
|
|
134815
134830
|
batteryPowerEntity: entry.batteryPowerEntity,
|
|
134816
134831
|
batteryEnergyEntity: entry.batteryEnergyEntity,
|
|
134832
|
+
chargingSwitchEntity: entry.chargingSwitchEntity,
|
|
134833
|
+
currentLimitEntity: entry.currentLimitEntity,
|
|
134817
134834
|
suctionLevelEntity: entry.suctionLevelEntity,
|
|
134818
134835
|
mopIntensityEntity: entry.mopIntensityEntity,
|
|
134819
134836
|
customServiceAreas: entry.customServiceAreas,
|
|
@@ -135090,6 +135107,8 @@ function getMappedEntityIds(mapping) {
|
|
|
135090
135107
|
if (mapping.currentEntity) ids.push(mapping.currentEntity);
|
|
135091
135108
|
if (mapping.batteryPowerEntity) ids.push(mapping.batteryPowerEntity);
|
|
135092
135109
|
if (mapping.batteryEnergyEntity) ids.push(mapping.batteryEnergyEntity);
|
|
135110
|
+
if (mapping.chargingSwitchEntity) ids.push(mapping.chargingSwitchEntity);
|
|
135111
|
+
if (mapping.currentLimitEntity) ids.push(mapping.currentLimitEntity);
|
|
135093
135112
|
if (mapping.currentRoomEntity) ids.push(mapping.currentRoomEntity);
|
|
135094
135113
|
if (mapping.cleanedAreaEntity) ids.push(mapping.cleanedAreaEntity);
|
|
135095
135114
|
if (mapping.composedEntities) {
|
|
@@ -137511,7 +137530,7 @@ var WebSocketApi = class {
|
|
|
137511
137530
|
|
|
137512
137531
|
// src/api/web-api.ts
|
|
137513
137532
|
var WebApi = class extends Service {
|
|
137514
|
-
constructor(
|
|
137533
|
+
constructor(logger248, bridgeService, haClient, haRegistry, bridgeStorage, mappingStorage, identityStorage, lockCredentialStorage, settingsStorage, backupService, props) {
|
|
137515
137534
|
super("WebApi");
|
|
137516
137535
|
this.bridgeService = bridgeService;
|
|
137517
137536
|
this.haClient = haClient;
|
|
@@ -137523,8 +137542,8 @@ var WebApi = class extends Service {
|
|
|
137523
137542
|
this.settingsStorage = settingsStorage;
|
|
137524
137543
|
this.backupService = backupService;
|
|
137525
137544
|
this.props = props;
|
|
137526
|
-
this.logger =
|
|
137527
|
-
this.log =
|
|
137545
|
+
this.logger = logger248;
|
|
137546
|
+
this.log = logger248.get(this);
|
|
137528
137547
|
this.accessLogger = accessLogger(this.log.createChild("Access Log"));
|
|
137529
137548
|
this.startTime = Date.now();
|
|
137530
137549
|
this.wsApi = new WebSocketApi(
|
|
@@ -138715,10 +138734,10 @@ function isTransientConnectError(reason) {
|
|
|
138715
138734
|
return msg.includes("socket hang up") || msg.includes("tls") || msg.includes("TLS");
|
|
138716
138735
|
}
|
|
138717
138736
|
var HomeAssistantClient = class extends Service {
|
|
138718
|
-
constructor(
|
|
138737
|
+
constructor(logger248, options) {
|
|
138719
138738
|
super("HomeAssistantClient");
|
|
138720
138739
|
this.options = options;
|
|
138721
|
-
this.log =
|
|
138740
|
+
this.log = logger248.get(this);
|
|
138722
138741
|
}
|
|
138723
138742
|
options;
|
|
138724
138743
|
static Options = /* @__PURE__ */ Symbol.for("HomeAssistantClientProps");
|
|
@@ -139534,6 +139553,8 @@ var EntityMappingStorage = class extends Service {
|
|
|
139534
139553
|
currentEntity: request.currentEntity?.trim() || void 0,
|
|
139535
139554
|
batteryPowerEntity: request.batteryPowerEntity?.trim() || void 0,
|
|
139536
139555
|
batteryEnergyEntity: request.batteryEnergyEntity?.trim() || void 0,
|
|
139556
|
+
chargingSwitchEntity: request.chargingSwitchEntity?.trim() || void 0,
|
|
139557
|
+
currentLimitEntity: request.currentLimitEntity?.trim() || void 0,
|
|
139537
139558
|
pressureEntity: request.pressureEntity?.trim() || void 0,
|
|
139538
139559
|
suctionLevelEntity: request.suctionLevelEntity?.trim() || void 0,
|
|
139539
139560
|
mopIntensityEntity: request.mopIntensityEntity?.trim() || void 0,
|
|
@@ -139562,7 +139583,7 @@ var EntityMappingStorage = class extends Service {
|
|
|
139562
139583
|
composedEntities: request.composedEntities?.filter((e) => e.entityId?.trim()) ?? void 0,
|
|
139563
139584
|
disableMomentaryFlip: request.disableMomentaryFlip || void 0
|
|
139564
139585
|
};
|
|
139565
|
-
if (!config11.matterDeviceType && !config11.customName && !config11.customProductName && !config11.customVendorName && !config11.customSerialNumber && config11.customVendorId === void 0 && config11.disabled !== true && !config11.filterLifeEntity && !config11.cleaningModeEntity && !config11.temperatureEntity && !config11.humidityEntity && !config11.batteryEntity && !config11.disableBatteryMapping && !config11.chargingStateEntity && !config11.roomEntities && !config11.disableLockPin && !config11.lockUsercodeService && config11.lockUsercodeSlot === void 0 && config11.lockPinMinLength === void 0 && config11.lockPinMaxLength === void 0 && !config11.powerEntity && !config11.energyEntity && !config11.voltageEntity && !config11.currentEntity && !config11.batteryPowerEntity && !config11.batteryEnergyEntity && !config11.pressureEntity && !config11.suctionLevelEntity && !config11.mopIntensityEntity && (!config11.customServiceAreas || config11.customServiceAreas.length === 0) && (!config11.customFanSpeedTags || Object.keys(config11.customFanSpeedTags).length === 0) && (!config11.fanWindPresets || (config11.fanWindPresets.natural?.length ?? 0) === 0 && (config11.fanWindPresets.sleep?.length ?? 0) === 0) && !config11.fanRestoreSpeedOnPowerOn && !config11.currentRoomEntity && !config11.cleanedAreaEntity && !config11.disableCustomAreaRoomModes && !config11.valetudoIdentifier && !config11.coverSwapOpenClose && !config11.coverExposeAsDimmableLight && !config11.selectExposeAsSwitch && !config11.selectSwitchOnOption && !config11.selectSwitchOffOption && !config11.coverSliderDebounceMs && !config11.updateThrottleMs && !config11.disableClimateOnOff && !config11.disableClimateFanControl && !config11.climateKeepModeOnIdle && !config11.climateExposeFan && !config11.climateAutoMode && (!config11.composedEntities || config11.composedEntities.length === 0) && !config11.disableMomentaryFlip) {
|
|
139586
|
+
if (!config11.matterDeviceType && !config11.customName && !config11.customProductName && !config11.customVendorName && !config11.customSerialNumber && config11.customVendorId === void 0 && config11.disabled !== true && !config11.filterLifeEntity && !config11.cleaningModeEntity && !config11.temperatureEntity && !config11.humidityEntity && !config11.batteryEntity && !config11.disableBatteryMapping && !config11.chargingStateEntity && !config11.roomEntities && !config11.disableLockPin && !config11.lockUsercodeService && config11.lockUsercodeSlot === void 0 && config11.lockPinMinLength === void 0 && config11.lockPinMaxLength === void 0 && !config11.powerEntity && !config11.energyEntity && !config11.voltageEntity && !config11.currentEntity && !config11.batteryPowerEntity && !config11.batteryEnergyEntity && !config11.chargingSwitchEntity && !config11.currentLimitEntity && !config11.pressureEntity && !config11.suctionLevelEntity && !config11.mopIntensityEntity && (!config11.customServiceAreas || config11.customServiceAreas.length === 0) && (!config11.customFanSpeedTags || Object.keys(config11.customFanSpeedTags).length === 0) && (!config11.fanWindPresets || (config11.fanWindPresets.natural?.length ?? 0) === 0 && (config11.fanWindPresets.sleep?.length ?? 0) === 0) && !config11.fanRestoreSpeedOnPowerOn && !config11.currentRoomEntity && !config11.cleanedAreaEntity && !config11.disableCustomAreaRoomModes && !config11.valetudoIdentifier && !config11.coverSwapOpenClose && !config11.coverExposeAsDimmableLight && !config11.selectExposeAsSwitch && !config11.selectSwitchOnOption && !config11.selectSwitchOffOption && !config11.coverSliderDebounceMs && !config11.updateThrottleMs && !config11.disableClimateOnOff && !config11.disableClimateFanControl && !config11.climateKeepModeOnIdle && !config11.climateExposeFan && !config11.climateAutoMode && (!config11.composedEntities || config11.composedEntities.length === 0) && !config11.disableMomentaryFlip) {
|
|
139566
139587
|
bridgeMap.delete(request.entityId);
|
|
139567
139588
|
} else {
|
|
139568
139589
|
bridgeMap.set(request.entityId, config11);
|
|
@@ -149523,6 +149544,7 @@ var EnergyEvseDeviceDefinition = MutableEndpoint({
|
|
|
149523
149544
|
)
|
|
149524
149545
|
});
|
|
149525
149546
|
Object.freeze(EnergyEvseDeviceDefinition);
|
|
149547
|
+
var EnergyEvseDevice = EnergyEvseDeviceDefinition;
|
|
149526
149548
|
|
|
149527
149549
|
// ../../node_modules/.pnpm/@matter+node@0.17.7_patch_hash=34f8224b2964673272e9f22613c0cb1f8ec12758dd46b4fe303d42373451ad4c/node_modules/@matter/node/dist/esm/devices/extended-color-light.js
|
|
149528
149550
|
init_IdentifyServer();
|
|
@@ -157249,11 +157271,11 @@ var AUTO_FORCE_SYNC_INTERVAL_MS = 9e4;
|
|
|
157249
157271
|
var SHUTDOWN_SESSION_CLOSE_TIMEOUT_MS = 2500;
|
|
157250
157272
|
var MDNS_ADDRESS_CHECK_INTERVAL_MS = 6e4;
|
|
157251
157273
|
var Bridge = class {
|
|
157252
|
-
constructor(env,
|
|
157274
|
+
constructor(env, logger248, dataProvider, endpointManager, serverOptions) {
|
|
157253
157275
|
this.dataProvider = dataProvider;
|
|
157254
157276
|
this.endpointManager = endpointManager;
|
|
157255
157277
|
this.serverOptions = serverOptions;
|
|
157256
|
-
this.log =
|
|
157278
|
+
this.log = logger248.get(`Bridge / ${dataProvider.id}`);
|
|
157257
157279
|
this.server = new BridgeServerNode(
|
|
157258
157280
|
env,
|
|
157259
157281
|
this.dataProvider,
|
|
@@ -167877,6 +167899,284 @@ var ElectricalMeterType = ElectricalMeterDevice.with(
|
|
|
167877
167899
|
EnergyServer
|
|
167878
167900
|
);
|
|
167879
167901
|
|
|
167902
|
+
// src/matter/endpoints/legacy/sensor/devices/energy-evse.ts
|
|
167903
|
+
init_esm();
|
|
167904
|
+
init_home_assistant_actions();
|
|
167905
|
+
init_home_assistant_entity_behavior();
|
|
167906
|
+
|
|
167907
|
+
// src/matter/endpoints/legacy/sensor/devices/evse-status.ts
|
|
167908
|
+
function mapEvseStatus(rawState, chargingSwitchOn) {
|
|
167909
|
+
const raw = rawState.toLowerCase().trim();
|
|
167910
|
+
const switchSupply = chargingSwitchOn ? EnergyEvse3.SupplyState.ChargingEnabled : EnergyEvse3.SupplyState.Disabled;
|
|
167911
|
+
if (raw === "" || raw === "unknown" || raw === "unavailable") {
|
|
167912
|
+
return {
|
|
167913
|
+
state: null,
|
|
167914
|
+
supplyState: EnergyEvse3.SupplyState.Disabled,
|
|
167915
|
+
faultState: EnergyEvse3.FaultState.NoError
|
|
167916
|
+
};
|
|
167917
|
+
}
|
|
167918
|
+
if (raw.includes("error") || raw.includes("fault")) {
|
|
167919
|
+
return {
|
|
167920
|
+
state: EnergyEvse3.State.Fault,
|
|
167921
|
+
supplyState: EnergyEvse3.SupplyState.DisabledError,
|
|
167922
|
+
faultState: EnergyEvse3.FaultState.Other
|
|
167923
|
+
};
|
|
167924
|
+
}
|
|
167925
|
+
if (raw.includes("not connected") || raw.includes("not_connected") || raw.includes("disconnected") || raw.includes("no vehicle")) {
|
|
167926
|
+
return {
|
|
167927
|
+
state: EnergyEvse3.State.NotPluggedIn,
|
|
167928
|
+
supplyState: switchSupply,
|
|
167929
|
+
faultState: EnergyEvse3.FaultState.NoError
|
|
167930
|
+
};
|
|
167931
|
+
}
|
|
167932
|
+
if (raw.includes("not charging") || raw.includes("not_charging") || raw.includes("not-charging")) {
|
|
167933
|
+
return {
|
|
167934
|
+
state: EnergyEvse3.State.PluggedInNoDemand,
|
|
167935
|
+
supplyState: switchSupply,
|
|
167936
|
+
faultState: EnergyEvse3.FaultState.NoError
|
|
167937
|
+
};
|
|
167938
|
+
}
|
|
167939
|
+
if (raw.includes("charg") && !raw.includes("discharg")) {
|
|
167940
|
+
return {
|
|
167941
|
+
state: EnergyEvse3.State.PluggedInCharging,
|
|
167942
|
+
supplyState: EnergyEvse3.SupplyState.ChargingEnabled,
|
|
167943
|
+
faultState: EnergyEvse3.FaultState.NoError
|
|
167944
|
+
};
|
|
167945
|
+
}
|
|
167946
|
+
if (raw.includes("connected") || raw.includes("ready") || raw.includes("awaiting") || raw.includes("completed") || raw.includes("sleep") || raw.includes("paused")) {
|
|
167947
|
+
return {
|
|
167948
|
+
state: EnergyEvse3.State.PluggedInNoDemand,
|
|
167949
|
+
supplyState: switchSupply,
|
|
167950
|
+
faultState: EnergyEvse3.FaultState.NoError
|
|
167951
|
+
};
|
|
167952
|
+
}
|
|
167953
|
+
return {
|
|
167954
|
+
state: null,
|
|
167955
|
+
supplyState: EnergyEvse3.SupplyState.Disabled,
|
|
167956
|
+
faultState: EnergyEvse3.FaultState.NoError
|
|
167957
|
+
};
|
|
167958
|
+
}
|
|
167959
|
+
|
|
167960
|
+
// src/matter/endpoints/legacy/sensor/devices/energy-evse.ts
|
|
167961
|
+
var logger229 = Logger.get("EnergyEvse");
|
|
167962
|
+
var MIN_CHARGE_CURRENT_MA = 6e3;
|
|
167963
|
+
var MAX_CHARGE_CURRENT_MA = 32e3;
|
|
167964
|
+
var CIRCUIT_CAPACITY_MA = 32e3;
|
|
167965
|
+
var MAX_TIMER_MS = 2147483647;
|
|
167966
|
+
function clampMa(ma) {
|
|
167967
|
+
return Math.min(CIRCUIT_CAPACITY_MA, Math.max(MIN_CHARGE_CURRENT_MA, ma));
|
|
167968
|
+
}
|
|
167969
|
+
var evseChargingTimers = /* @__PURE__ */ new WeakMap();
|
|
167970
|
+
function clearEvseChargingTimer(endpoint) {
|
|
167971
|
+
const timer = evseChargingTimers.get(endpoint);
|
|
167972
|
+
if (timer) {
|
|
167973
|
+
clearTimeout(timer);
|
|
167974
|
+
evseChargingTimers.delete(endpoint);
|
|
167975
|
+
}
|
|
167976
|
+
}
|
|
167977
|
+
var EvseStatusServer = class _EvseStatusServer extends EnergyEvseServer {
|
|
167978
|
+
async initialize() {
|
|
167979
|
+
await super.initialize();
|
|
167980
|
+
const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
|
|
167981
|
+
this.update();
|
|
167982
|
+
this.reactTo(homeAssistant.onChange, this.update, { offline: true });
|
|
167983
|
+
}
|
|
167984
|
+
async [Symbol.asyncDispose]() {
|
|
167985
|
+
clearEvseChargingTimer(this.endpoint);
|
|
167986
|
+
await super[Symbol.asyncDispose]();
|
|
167987
|
+
}
|
|
167988
|
+
chargingSwitchIsOn() {
|
|
167989
|
+
const mapping = this.agent.get(HomeAssistantEntityBehavior).state.mapping;
|
|
167990
|
+
const switchEntity = mapping?.chargingSwitchEntity;
|
|
167991
|
+
if (!switchEntity) return false;
|
|
167992
|
+
const stateProvider = this.agent.env.get(EntityStateProvider);
|
|
167993
|
+
return stateProvider.getState(switchEntity)?.state === "on";
|
|
167994
|
+
}
|
|
167995
|
+
update() {
|
|
167996
|
+
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
167997
|
+
const raw = homeAssistant.entity.state?.state ?? "";
|
|
167998
|
+
const status3 = mapEvseStatus(raw, this.chargingSwitchIsOn());
|
|
167999
|
+
const patch = {
|
|
168000
|
+
state: status3.state,
|
|
168001
|
+
supplyState: status3.supplyState,
|
|
168002
|
+
faultState: status3.faultState
|
|
168003
|
+
};
|
|
168004
|
+
const mapping = homeAssistant.state.mapping;
|
|
168005
|
+
if (mapping?.currentLimitEntity) {
|
|
168006
|
+
const stateProvider = this.agent.env.get(EntityStateProvider);
|
|
168007
|
+
const amps = stateProvider.getNumericState(mapping.currentLimitEntity);
|
|
168008
|
+
if (amps != null) {
|
|
168009
|
+
patch.maximumChargeCurrent = clampMa(Math.round(amps * 1e3));
|
|
168010
|
+
}
|
|
168011
|
+
}
|
|
168012
|
+
applyPatchState(this.state, patch);
|
|
168013
|
+
}
|
|
168014
|
+
enableCharging(request) {
|
|
168015
|
+
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
168016
|
+
const mapping = homeAssistant.state.mapping;
|
|
168017
|
+
const until = request.chargingEnabledUntil;
|
|
168018
|
+
if (until != null && until * 1e3 <= Date.now()) {
|
|
168019
|
+
this.disable();
|
|
168020
|
+
return;
|
|
168021
|
+
}
|
|
168022
|
+
clearEvseChargingTimer(this.endpoint);
|
|
168023
|
+
let dispatched = false;
|
|
168024
|
+
if (mapping?.chargingSwitchEntity) {
|
|
168025
|
+
homeAssistant.callAction({
|
|
168026
|
+
action: "switch.turn_on",
|
|
168027
|
+
target: mapping.chargingSwitchEntity
|
|
168028
|
+
});
|
|
168029
|
+
dispatched = true;
|
|
168030
|
+
}
|
|
168031
|
+
const maxCurrent = request.maximumChargeCurrent;
|
|
168032
|
+
if (mapping?.currentLimitEntity && maxCurrent != null) {
|
|
168033
|
+
const amps = Math.max(
|
|
168034
|
+
MIN_CHARGE_CURRENT_MA / 1e3,
|
|
168035
|
+
Math.floor(clampMa(Number(maxCurrent)) / 1e3)
|
|
168036
|
+
);
|
|
168037
|
+
homeAssistant.callAction({
|
|
168038
|
+
action: "number.set_value",
|
|
168039
|
+
target: mapping.currentLimitEntity,
|
|
168040
|
+
data: { value: amps }
|
|
168041
|
+
});
|
|
168042
|
+
dispatched = true;
|
|
168043
|
+
}
|
|
168044
|
+
if (!dispatched) {
|
|
168045
|
+
logger229.debug(
|
|
168046
|
+
`enableCharging ignored for ${homeAssistant.entityId}: no charging switch or current limit mapped`
|
|
168047
|
+
);
|
|
168048
|
+
return;
|
|
168049
|
+
}
|
|
168050
|
+
const patch = {
|
|
168051
|
+
supplyState: EnergyEvse3.SupplyState.ChargingEnabled,
|
|
168052
|
+
chargingEnabledUntil: until ?? null
|
|
168053
|
+
};
|
|
168054
|
+
if (request.minimumChargeCurrent != null) {
|
|
168055
|
+
patch.minimumChargeCurrent = clampMa(
|
|
168056
|
+
Number(request.minimumChargeCurrent)
|
|
168057
|
+
);
|
|
168058
|
+
}
|
|
168059
|
+
if (maxCurrent != null) {
|
|
168060
|
+
patch.maximumChargeCurrent = clampMa(Number(maxCurrent));
|
|
168061
|
+
}
|
|
168062
|
+
applyPatchState(this.state, patch);
|
|
168063
|
+
if (until != null) {
|
|
168064
|
+
const delay = until * 1e3 - Date.now();
|
|
168065
|
+
if (delay > 0 && delay <= MAX_TIMER_MS) {
|
|
168066
|
+
const endpoint = this.endpoint;
|
|
168067
|
+
const actions = this.env.get(HomeAssistantActions);
|
|
168068
|
+
const entityId = homeAssistant.entityId;
|
|
168069
|
+
const switchEntity = mapping?.chargingSwitchEntity;
|
|
168070
|
+
const timer = setTimeout(() => {
|
|
168071
|
+
void (async () => {
|
|
168072
|
+
try {
|
|
168073
|
+
if (evseChargingTimers.get(endpoint) !== timer) return;
|
|
168074
|
+
if (switchEntity) {
|
|
168075
|
+
actions.call(
|
|
168076
|
+
{ action: "switch.turn_off", target: switchEntity },
|
|
168077
|
+
entityId
|
|
168078
|
+
);
|
|
168079
|
+
}
|
|
168080
|
+
await endpoint.setStateOf(_EvseStatusServer, {
|
|
168081
|
+
supplyState: EnergyEvse3.SupplyState.Disabled,
|
|
168082
|
+
chargingEnabledUntil: null
|
|
168083
|
+
});
|
|
168084
|
+
} catch (error) {
|
|
168085
|
+
logger229.debug(
|
|
168086
|
+
`EVSE charge-window expiry write failed (endpoint may be closing): ${error}`
|
|
168087
|
+
);
|
|
168088
|
+
} finally {
|
|
168089
|
+
if (evseChargingTimers.get(endpoint) === timer) {
|
|
168090
|
+
evseChargingTimers.delete(endpoint);
|
|
168091
|
+
}
|
|
168092
|
+
}
|
|
168093
|
+
})();
|
|
168094
|
+
}, delay);
|
|
168095
|
+
timer.unref?.();
|
|
168096
|
+
evseChargingTimers.set(endpoint, timer);
|
|
168097
|
+
}
|
|
168098
|
+
}
|
|
168099
|
+
}
|
|
168100
|
+
disable() {
|
|
168101
|
+
clearEvseChargingTimer(this.endpoint);
|
|
168102
|
+
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
168103
|
+
const mapping = homeAssistant.state.mapping;
|
|
168104
|
+
if (mapping?.chargingSwitchEntity) {
|
|
168105
|
+
homeAssistant.callAction({
|
|
168106
|
+
action: "switch.turn_off",
|
|
168107
|
+
target: mapping.chargingSwitchEntity
|
|
168108
|
+
});
|
|
168109
|
+
}
|
|
168110
|
+
if (mapping?.chargingSwitchEntity || mapping?.currentLimitEntity) {
|
|
168111
|
+
applyPatchState(this.state, {
|
|
168112
|
+
supplyState: EnergyEvse3.SupplyState.Disabled,
|
|
168113
|
+
chargingEnabledUntil: null
|
|
168114
|
+
});
|
|
168115
|
+
} else {
|
|
168116
|
+
logger229.debug(
|
|
168117
|
+
`disable ignored for ${homeAssistant.entityId}: no charging switch mapped`
|
|
168118
|
+
);
|
|
168119
|
+
}
|
|
168120
|
+
}
|
|
168121
|
+
};
|
|
168122
|
+
var EvseStatusSeeded = EvseStatusServer.set({
|
|
168123
|
+
supplyState: EnergyEvse3.SupplyState.Disabled,
|
|
168124
|
+
faultState: EnergyEvse3.FaultState.NoError,
|
|
168125
|
+
circuitCapacity: CIRCUIT_CAPACITY_MA,
|
|
168126
|
+
minimumChargeCurrent: MIN_CHARGE_CURRENT_MA,
|
|
168127
|
+
maximumChargeCurrent: MAX_CHARGE_CURRENT_MA
|
|
168128
|
+
});
|
|
168129
|
+
var EvseModeSeeded = EnergyEvseModeServer.set({
|
|
168130
|
+
supportedModes: [
|
|
168131
|
+
{
|
|
168132
|
+
label: "Manual",
|
|
168133
|
+
mode: 1,
|
|
168134
|
+
modeTags: [{ value: EnergyEvseMode3.ModeTag.Manual }]
|
|
168135
|
+
}
|
|
168136
|
+
],
|
|
168137
|
+
currentMode: 1
|
|
168138
|
+
});
|
|
168139
|
+
var WiredPowerSourceBase = PowerSourceServer.with("Wired");
|
|
168140
|
+
var EvsePowerSourceServer = class extends WiredPowerSourceBase {
|
|
168141
|
+
async initialize() {
|
|
168142
|
+
await super.initialize();
|
|
168143
|
+
const endpointNumber = this.endpoint.number;
|
|
168144
|
+
if (endpointNumber != null) {
|
|
168145
|
+
applyPatchState(this.state, { endpointList: [endpointNumber] });
|
|
168146
|
+
}
|
|
168147
|
+
}
|
|
168148
|
+
};
|
|
168149
|
+
var EvsePowerSource = EvsePowerSourceServer.set({
|
|
168150
|
+
status: PowerSource3.PowerSourceStatus.Active,
|
|
168151
|
+
order: 0,
|
|
168152
|
+
description: "Mains",
|
|
168153
|
+
wiredCurrentType: PowerSource3.WiredCurrentType.Ac
|
|
168154
|
+
});
|
|
168155
|
+
var EnergyEvseBase = EnergyEvseDevice.with(
|
|
168156
|
+
BasicInformationServer2,
|
|
168157
|
+
IdentifyServer2,
|
|
168158
|
+
HomeAssistantEntityBehavior,
|
|
168159
|
+
EvseStatusSeeded,
|
|
168160
|
+
EvseModeSeeded,
|
|
168161
|
+
EvsePowerSource,
|
|
168162
|
+
// Always mount the measurement clusters; both seed safe defaults when no
|
|
168163
|
+
// power/energy entity is mapped, so the endpoint honestly carries the
|
|
168164
|
+
// ElectricalSensor device type.
|
|
168165
|
+
PowerServer,
|
|
168166
|
+
EnergyServer,
|
|
168167
|
+
DescriptorServer
|
|
168168
|
+
).set({
|
|
168169
|
+
descriptor: {
|
|
168170
|
+
deviceTypeList: [
|
|
168171
|
+
{ deviceType: DeviceTypeId(1292), revision: 2 },
|
|
168172
|
+
{ deviceType: DeviceTypeId(1296), revision: 1 }
|
|
168173
|
+
]
|
|
168174
|
+
}
|
|
168175
|
+
});
|
|
168176
|
+
function energyEvseType() {
|
|
168177
|
+
return EnergyEvseBase;
|
|
168178
|
+
}
|
|
168179
|
+
|
|
167880
168180
|
// src/matter/behaviors/flow-measurement-server.ts
|
|
167881
168181
|
init_home_assistant_entity_behavior();
|
|
167882
168182
|
var FlowMeasurementServerBase = class extends FlowMeasurementServer {
|
|
@@ -168616,7 +168916,7 @@ var TvocConcentrationMeasurementServer = class extends TvocConcentrationMeasurem
|
|
|
168616
168916
|
};
|
|
168617
168917
|
|
|
168618
168918
|
// src/matter/endpoints/legacy/sensor/devices/tvoc-sensor.ts
|
|
168619
|
-
var
|
|
168919
|
+
var logger230 = Logger.get("TvocSensor");
|
|
168620
168920
|
function airQualityFromUgm3(value) {
|
|
168621
168921
|
if (value <= 300) return AirQuality3.AirQualityEnum.Good;
|
|
168622
168922
|
if (value <= 1e3) return AirQuality3.AirQualityEnum.Fair;
|
|
@@ -168657,17 +168957,17 @@ var TvocAirQualityServer = class extends TvocAirQualityServerBase {
|
|
|
168657
168957
|
const attributes9 = entity.state.attributes;
|
|
168658
168958
|
const deviceClass = attributes9.device_class;
|
|
168659
168959
|
let airQuality = AirQuality3.AirQualityEnum.Unknown;
|
|
168660
|
-
|
|
168960
|
+
logger230.debug(
|
|
168661
168961
|
`[${entity.entity_id}] TVOC update: state="${state}", device_class="${deviceClass}"`
|
|
168662
168962
|
);
|
|
168663
168963
|
if (state != null && !Number.isNaN(+state)) {
|
|
168664
168964
|
const value = +state;
|
|
168665
168965
|
airQuality = deviceClass === SensorDeviceClass.volatile_organic_compounds ? airQualityFromUgm3(value) : airQualityFromPpb(value);
|
|
168666
|
-
|
|
168966
|
+
logger230.debug(
|
|
168667
168967
|
`[${entity.entity_id}] TVOC value=${value} (${deviceClass}) -> airQuality=${AirQuality3.AirQualityEnum[airQuality]}`
|
|
168668
168968
|
);
|
|
168669
168969
|
} else {
|
|
168670
|
-
|
|
168970
|
+
logger230.warn(
|
|
168671
168971
|
`[${entity.entity_id}] TVOC state not a valid number: "${state}"`
|
|
168672
168972
|
);
|
|
168673
168973
|
}
|
|
@@ -168881,7 +169181,7 @@ init_home_assistant_entity_behavior();
|
|
|
168881
169181
|
// src/matter/behaviors/pm25-concentration-measurement-server.ts
|
|
168882
169182
|
init_esm();
|
|
168883
169183
|
init_home_assistant_entity_behavior();
|
|
168884
|
-
var
|
|
169184
|
+
var logger231 = Logger.get("Pm25ConcentrationMeasurementServer");
|
|
168885
169185
|
var Pm25ConcentrationMeasurementServerBase = Pm25ConcentrationMeasurementServer.with(
|
|
168886
169186
|
ConcentrationMeasurement3.Feature.NumericMeasurement
|
|
168887
169187
|
);
|
|
@@ -168905,11 +169205,11 @@ var Pm25ConcentrationMeasurementServer2 = class extends Pm25ConcentrationMeasure
|
|
|
168905
169205
|
if (this.state.measurementMedium === void 0) {
|
|
168906
169206
|
this.state.measurementMedium = ConcentrationMeasurement3.MeasurementMedium.Air;
|
|
168907
169207
|
}
|
|
168908
|
-
|
|
169208
|
+
logger231.debug(
|
|
168909
169209
|
"Pm25ConcentrationMeasurementServer: before super.initialize()"
|
|
168910
169210
|
);
|
|
168911
169211
|
await super.initialize();
|
|
168912
|
-
|
|
169212
|
+
logger231.debug(
|
|
168913
169213
|
"Pm25ConcentrationMeasurementServer: after super.initialize()"
|
|
168914
169214
|
);
|
|
168915
169215
|
const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
|
|
@@ -168932,7 +169232,7 @@ var Pm25ConcentrationMeasurementServer2 = class extends Pm25ConcentrationMeasure
|
|
|
168932
169232
|
};
|
|
168933
169233
|
|
|
168934
169234
|
// src/matter/endpoints/legacy/sensor/devices/pm25-sensor.ts
|
|
168935
|
-
var
|
|
169235
|
+
var logger232 = Logger.get("Pm25AirQualityServer");
|
|
168936
169236
|
var Pm25AirQualityServerBase = AirQualityServer.with(
|
|
168937
169237
|
AirQuality3.Feature.Fair,
|
|
168938
169238
|
AirQuality3.Feature.Moderate,
|
|
@@ -168944,9 +169244,9 @@ var Pm25AirQualityServer = class extends Pm25AirQualityServerBase {
|
|
|
168944
169244
|
if (this.state.airQuality === void 0) {
|
|
168945
169245
|
this.state.airQuality = AirQuality3.AirQualityEnum.Unknown;
|
|
168946
169246
|
}
|
|
168947
|
-
|
|
169247
|
+
logger232.debug("Pm25AirQualityServer: before super.initialize()");
|
|
168948
169248
|
await super.initialize();
|
|
168949
|
-
|
|
169249
|
+
logger232.debug("Pm25AirQualityServer: after super.initialize()");
|
|
168950
169250
|
const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
|
|
168951
169251
|
this.update(homeAssistant.entity);
|
|
168952
169252
|
this.reactTo(homeAssistant.onChange, this.update, { offline: true });
|
|
@@ -169371,7 +169671,7 @@ init_home_assistant_entity_behavior();
|
|
|
169371
169671
|
init_dist();
|
|
169372
169672
|
init_esm();
|
|
169373
169673
|
init_home_assistant_entity_behavior();
|
|
169374
|
-
var
|
|
169674
|
+
var logger233 = Logger.get("VacuumIdentifyServer");
|
|
169375
169675
|
var IDENTIFY_BUTTON_SUFFIXES = ["_identify", "_locate", "_find_me"];
|
|
169376
169676
|
var VacuumIdentifyServer = class extends IdentifyServer2 {
|
|
169377
169677
|
triggerEffect(effect) {
|
|
@@ -169388,19 +169688,19 @@ var VacuumIdentifyServer = class extends IdentifyServer2 {
|
|
|
169388
169688
|
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
169389
169689
|
const features3 = homeAssistant.entity.state.attributes.supported_features ?? 0;
|
|
169390
169690
|
if (testBit(features3, VacuumDeviceFeature.LOCATE)) {
|
|
169391
|
-
|
|
169691
|
+
logger233.info(`${source} \u2192 vacuum.locate for ${homeAssistant.entityId}`);
|
|
169392
169692
|
homeAssistant.callAction({ action: "vacuum.locate" });
|
|
169393
169693
|
return;
|
|
169394
169694
|
}
|
|
169395
169695
|
const sibling = this.#findIdentifyButton(homeAssistant);
|
|
169396
169696
|
if (sibling) {
|
|
169397
|
-
|
|
169697
|
+
logger233.info(
|
|
169398
169698
|
`${source} \u2192 button.press ${sibling} for ${homeAssistant.entityId}`
|
|
169399
169699
|
);
|
|
169400
169700
|
homeAssistant.callAction({ action: "button.press", target: sibling });
|
|
169401
169701
|
return;
|
|
169402
169702
|
}
|
|
169403
|
-
|
|
169703
|
+
logger233.warn(
|
|
169404
169704
|
`${source} for ${homeAssistant.entityId}, LOCATE not in supported_features (${features3}), trying vacuum.locate anyway`
|
|
169405
169705
|
);
|
|
169406
169706
|
homeAssistant.callAction({ action: "vacuum.locate" });
|
|
@@ -169599,14 +169899,14 @@ init_esm();
|
|
|
169599
169899
|
|
|
169600
169900
|
// src/matter/behaviors/service-area-server.ts
|
|
169601
169901
|
init_esm();
|
|
169602
|
-
var
|
|
169902
|
+
var logger234 = Logger.get("ServiceAreaServer");
|
|
169603
169903
|
var ServiceAreaWithProgress = ServiceAreaBehavior.with(
|
|
169604
169904
|
ServiceArea3.Feature.ProgressReporting
|
|
169605
169905
|
);
|
|
169606
169906
|
var ServiceAreaServerBase = class extends ServiceAreaWithProgress {
|
|
169607
169907
|
selectAreas(request) {
|
|
169608
169908
|
const { newAreas } = request;
|
|
169609
|
-
|
|
169909
|
+
logger234.info(
|
|
169610
169910
|
`ServiceArea selectAreas called with: ${JSON.stringify(newAreas)}`
|
|
169611
169911
|
);
|
|
169612
169912
|
const uniqueAreas = [...new Set(newAreas)];
|
|
@@ -169615,7 +169915,7 @@ var ServiceAreaServerBase = class extends ServiceAreaWithProgress {
|
|
|
169615
169915
|
(id) => !supportedAreaIds.includes(id)
|
|
169616
169916
|
);
|
|
169617
169917
|
if (invalidAreas.length > 0) {
|
|
169618
|
-
|
|
169918
|
+
logger234.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
|
|
169619
169919
|
return {
|
|
169620
169920
|
status: ServiceArea3.SelectAreasStatus.UnsupportedArea,
|
|
169621
169921
|
statusText: `Invalid area IDs: ${invalidAreas.join(", ")}`
|
|
@@ -169627,7 +169927,7 @@ var ServiceAreaServerBase = class extends ServiceAreaWithProgress {
|
|
|
169627
169927
|
status: ServiceArea3.OperationalStatus.Pending
|
|
169628
169928
|
}));
|
|
169629
169929
|
this.state.currentArea = null;
|
|
169630
|
-
|
|
169930
|
+
logger234.info(
|
|
169631
169931
|
`ServiceArea: Stored ${uniqueAreas.length} areas for cleaning: ${uniqueAreas.join(", ")}`
|
|
169632
169932
|
);
|
|
169633
169933
|
return {
|
|
@@ -169648,7 +169948,7 @@ var ServiceAreaServerBase = class extends ServiceAreaWithProgress {
|
|
|
169648
169948
|
ServiceAreaServerBase2.State = State;
|
|
169649
169949
|
})(ServiceAreaServerBase || (ServiceAreaServerBase = {}));
|
|
169650
169950
|
function ServiceAreaServer2(initialState) {
|
|
169651
|
-
|
|
169951
|
+
logger234.info(
|
|
169652
169952
|
`Creating ServiceAreaServer with ${initialState.supportedAreas.length} areas`
|
|
169653
169953
|
);
|
|
169654
169954
|
return ServiceAreaServerBase.set({
|
|
@@ -169665,7 +169965,7 @@ var ServiceAreaWithMapsAndProgress = ServiceAreaBehavior.with(
|
|
|
169665
169965
|
var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMapsAndProgress {
|
|
169666
169966
|
selectAreas(request) {
|
|
169667
169967
|
const { newAreas } = request;
|
|
169668
|
-
|
|
169968
|
+
logger234.info(
|
|
169669
169969
|
`ServiceArea selectAreas called with: ${JSON.stringify(newAreas)}`
|
|
169670
169970
|
);
|
|
169671
169971
|
const uniqueAreas = [...new Set(newAreas)];
|
|
@@ -169674,7 +169974,7 @@ var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMapsAndProgress
|
|
|
169674
169974
|
(id) => !supportedAreaIds.includes(id)
|
|
169675
169975
|
);
|
|
169676
169976
|
if (invalidAreas.length > 0) {
|
|
169677
|
-
|
|
169977
|
+
logger234.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
|
|
169678
169978
|
return {
|
|
169679
169979
|
status: ServiceArea3.SelectAreasStatus.UnsupportedArea,
|
|
169680
169980
|
statusText: `Invalid area IDs: ${invalidAreas.join(", ")}`
|
|
@@ -169686,7 +169986,7 @@ var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMapsAndProgress
|
|
|
169686
169986
|
status: ServiceArea3.OperationalStatus.Pending
|
|
169687
169987
|
}));
|
|
169688
169988
|
this.state.currentArea = null;
|
|
169689
|
-
|
|
169989
|
+
logger234.info(
|
|
169690
169990
|
`ServiceArea: Stored ${uniqueAreas.length} areas for cleaning: ${uniqueAreas.join(", ")}`
|
|
169691
169991
|
);
|
|
169692
169992
|
return {
|
|
@@ -169707,14 +170007,14 @@ var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMapsAndProgress
|
|
|
169707
170007
|
ServiceAreaServerWithMapsBase2.State = State;
|
|
169708
170008
|
})(ServiceAreaServerWithMapsBase || (ServiceAreaServerWithMapsBase = {}));
|
|
169709
170009
|
function ServiceAreaServerWithMaps(initialState) {
|
|
169710
|
-
|
|
170010
|
+
logger234.info(
|
|
169711
170011
|
`Creating ServiceAreaServer with Maps: ${initialState.supportedAreas.length} areas, ${initialState.supportedMaps.length} maps`
|
|
169712
170012
|
);
|
|
169713
170013
|
for (const map of initialState.supportedMaps) {
|
|
169714
170014
|
const areaCount = initialState.supportedAreas.filter(
|
|
169715
170015
|
(a) => a.mapId === map.mapId
|
|
169716
170016
|
).length;
|
|
169717
|
-
|
|
170017
|
+
logger234.info(` Map ${map.mapId}: "${map.name}" (${areaCount} areas)`);
|
|
169718
170018
|
}
|
|
169719
170019
|
return ServiceAreaServerWithMapsBase.set({
|
|
169720
170020
|
supportedAreas: initialState.supportedAreas,
|
|
@@ -169726,7 +170026,7 @@ function ServiceAreaServerWithMaps(initialState) {
|
|
|
169726
170026
|
}
|
|
169727
170027
|
|
|
169728
170028
|
// src/matter/endpoints/legacy/vacuum/behaviors/vacuum-service-area-server.ts
|
|
169729
|
-
var
|
|
170029
|
+
var logger235 = Logger.get("VacuumServiceAreaServer");
|
|
169730
170030
|
function toAreaId(roomId) {
|
|
169731
170031
|
if (typeof roomId === "number") {
|
|
169732
170032
|
return roomId;
|
|
@@ -169805,13 +170105,13 @@ function createVacuumServiceAreaServer(attributes9, roomEntities, includeUnnamed
|
|
|
169805
170105
|
let rooms;
|
|
169806
170106
|
if (roomEntities && roomEntities.length > 0) {
|
|
169807
170107
|
rooms = buttonEntitiesToRooms(roomEntities, attributes9);
|
|
169808
|
-
|
|
170108
|
+
logger235.info(
|
|
169809
170109
|
`Using ${rooms.length} button entities as rooms: ${rooms.map((r) => r.name).join(", ")}`
|
|
169810
170110
|
);
|
|
169811
170111
|
} else {
|
|
169812
170112
|
rooms = parseVacuumRooms(attributes9, includeUnnamedRooms);
|
|
169813
170113
|
if (rooms.length > 0) {
|
|
169814
|
-
|
|
170114
|
+
logger235.info(
|
|
169815
170115
|
`Using ${rooms.length} rooms from attributes: ${rooms.map((r) => r.name).join(", ")}`
|
|
169816
170116
|
);
|
|
169817
170117
|
}
|
|
@@ -169865,7 +170165,7 @@ function createCustomServiceAreaServer(customAreas) {
|
|
|
169865
170165
|
landmarkInfo: null
|
|
169866
170166
|
}
|
|
169867
170167
|
}));
|
|
169868
|
-
|
|
170168
|
+
logger235.info(
|
|
169869
170169
|
`Using ${customAreas.length} custom service areas: ${customAreas.map((a) => a.name).join(", ")}`
|
|
169870
170170
|
);
|
|
169871
170171
|
return ServiceAreaServer2({
|
|
@@ -169887,7 +170187,7 @@ function createCleanAreaServiceAreaServer(cleanAreaRooms) {
|
|
|
169887
170187
|
landmarkInfo: null
|
|
169888
170188
|
}
|
|
169889
170189
|
}));
|
|
169890
|
-
|
|
170190
|
+
logger235.info(
|
|
169891
170191
|
`Using ${cleanAreaRooms.length} HA areas via CLEAN_AREA: ${cleanAreaRooms.map((r) => r.name).join(", ")}`
|
|
169892
170192
|
);
|
|
169893
170193
|
return ServiceAreaServer2({
|
|
@@ -169898,11 +170198,11 @@ function createCleanAreaServiceAreaServer(cleanAreaRooms) {
|
|
|
169898
170198
|
}
|
|
169899
170199
|
|
|
169900
170200
|
// src/matter/endpoints/legacy/vacuum/behaviors/vacuum-rvc-run-mode-server.ts
|
|
169901
|
-
var
|
|
170201
|
+
var logger236 = Logger.get("VacuumRvcRunModeServer");
|
|
169902
170202
|
function buildValetudoSegmentAction(vacuumEntityId, segmentIds, valetudoIdentifier) {
|
|
169903
170203
|
const identifier = valetudoIdentifier || vacuumEntityId.replace(/^vacuum\.valetudo_/, "");
|
|
169904
170204
|
const topic = `valetudo/${identifier}/MapSegmentationCapability/clean/set`;
|
|
169905
|
-
|
|
170205
|
+
logger236.info(
|
|
169906
170206
|
`Valetudo: mqtt.publish to ${topic}, segments: ${segmentIds.join(", ")}`
|
|
169907
170207
|
);
|
|
169908
170208
|
return {
|
|
@@ -170007,14 +170307,14 @@ function mergeBatchData(areas) {
|
|
|
170007
170307
|
function handleCustomServiceAreas(selectedAreas, customAreas, session) {
|
|
170008
170308
|
const matched = selectedAreas.map((areaId) => ({ areaId, area: customAreas[areaId - 1] })).filter((m) => !!m.area);
|
|
170009
170309
|
if (matched.length === 0) {
|
|
170010
|
-
|
|
170310
|
+
logger236.warn(
|
|
170011
170311
|
`Custom service areas: no match for selected IDs ${selectedAreas.join(", ")}`
|
|
170012
170312
|
);
|
|
170013
170313
|
return { action: "vacuum.start" };
|
|
170014
170314
|
}
|
|
170015
170315
|
const batchArea = matched.find(({ area }) => area.batchDispatch === true);
|
|
170016
170316
|
if (batchArea) {
|
|
170017
|
-
|
|
170317
|
+
logger236.info(
|
|
170018
170318
|
`Custom service areas (batch): single call for ${matched.length} room(s): ${matched.map(({ area }) => area.name).join(", ")}`
|
|
170019
170319
|
);
|
|
170020
170320
|
session.pendingDispatches = [];
|
|
@@ -170035,7 +170335,7 @@ function handleCustomServiceAreas(selectedAreas, customAreas, session) {
|
|
|
170035
170335
|
}
|
|
170036
170336
|
};
|
|
170037
170337
|
}
|
|
170038
|
-
|
|
170338
|
+
logger236.info(
|
|
170039
170339
|
`Custom service areas: ${matched.length} room(s) queued: ${matched.map(({ area }) => `${area.service} (${area.name})`).join(", ")}`
|
|
170040
170340
|
);
|
|
170041
170341
|
session.pendingDispatches = matched.slice(1).map(({ areaId, area }) => ({
|
|
@@ -170073,7 +170373,7 @@ function vacuumIsCleaning(state) {
|
|
|
170073
170373
|
var vacuumRvcRunModeConfig = {
|
|
170074
170374
|
getCurrentMode: (entity) => {
|
|
170075
170375
|
const isCleaning = vacuumIsCleaning(entity.state);
|
|
170076
|
-
|
|
170376
|
+
logger236.debug(
|
|
170077
170377
|
`Vacuum state: "${entity.state}", isCleaning: ${isCleaning}, currentMode: ${isCleaning ? "Cleaning" : "Idle"}`
|
|
170078
170378
|
);
|
|
170079
170379
|
return isCleaning ? 1 /* Cleaning */ : 0 /* Idle */;
|
|
@@ -170107,7 +170407,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170107
170407
|
if (cleanAreaRooms && cleanAreaRooms.length > 0) {
|
|
170108
170408
|
const haAreaIds = resolveCleanAreaIds(selectedAreas, cleanAreaRooms);
|
|
170109
170409
|
if (haAreaIds.length > 0) {
|
|
170110
|
-
|
|
170410
|
+
logger236.info(
|
|
170111
170411
|
`CLEAN_AREA: cleaning HA areas: ${haAreaIds.join(", ")}`
|
|
170112
170412
|
);
|
|
170113
170413
|
return {
|
|
@@ -170126,7 +170426,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170126
170426
|
}
|
|
170127
170427
|
}
|
|
170128
170428
|
if (matched.length > 0) {
|
|
170129
|
-
|
|
170429
|
+
logger236.info(
|
|
170130
170430
|
`Roborock: ${matched.length} room button(s) queued: ${matched.map((m) => m.entityId).join(", ")}`
|
|
170131
170431
|
);
|
|
170132
170432
|
session.pendingDispatches = matched.slice(1).map(({ areaId, entityId }) => ({
|
|
@@ -170160,14 +170460,14 @@ var vacuumRvcRunModeConfig = {
|
|
|
170160
170460
|
}
|
|
170161
170461
|
}
|
|
170162
170462
|
if (roomIds.length > 0) {
|
|
170163
|
-
|
|
170463
|
+
logger236.info(
|
|
170164
170464
|
`Starting cleaning with selected areas: ${roomIds.join(", ")}`
|
|
170165
170465
|
);
|
|
170166
170466
|
if (isDreameVacuum(attributes9)) {
|
|
170167
170467
|
if (targetMapName) {
|
|
170168
170468
|
const vacName = vacuumEntityId.replace("vacuum.", "");
|
|
170169
170469
|
const selectedMapEntity = `select.${vacName}_selected_map`;
|
|
170170
|
-
|
|
170470
|
+
logger236.info(
|
|
170171
170471
|
`Dreame multi-floor: switching to map "${targetMapName}" via ${selectedMapEntity}`
|
|
170172
170472
|
);
|
|
170173
170473
|
homeAssistant.callAction({
|
|
@@ -170194,7 +170494,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170194
170494
|
}
|
|
170195
170495
|
if (isEcovacsVacuum(attributes9)) {
|
|
170196
170496
|
const roomIdStr = roomIds.join(",");
|
|
170197
|
-
|
|
170497
|
+
logger236.info(
|
|
170198
170498
|
`Ecovacs vacuum: Using spot_area for rooms: ${roomIdStr}`
|
|
170199
170499
|
);
|
|
170200
170500
|
return {
|
|
@@ -170209,14 +170509,14 @@ var vacuumRvcRunModeConfig = {
|
|
|
170209
170509
|
}
|
|
170210
170510
|
};
|
|
170211
170511
|
}
|
|
170212
|
-
|
|
170512
|
+
logger236.warn(
|
|
170213
170513
|
`Room cleaning via send_command not supported for this vacuum type. Rooms: ${roomIds.join(", ")}. Falling back to vacuum.start`
|
|
170214
170514
|
);
|
|
170215
170515
|
}
|
|
170216
170516
|
}
|
|
170217
170517
|
} catch {
|
|
170218
170518
|
}
|
|
170219
|
-
|
|
170519
|
+
logger236.info("Starting regular cleaning (no areas selected)");
|
|
170220
170520
|
return { action: "vacuum.start" };
|
|
170221
170521
|
},
|
|
170222
170522
|
returnToBase: () => ({ action: "vacuum.return_to_base" }),
|
|
@@ -170231,7 +170531,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170231
170531
|
const homeAssistant = agent.get(HomeAssistantEntityBehavior);
|
|
170232
170532
|
const entity = homeAssistant.entity;
|
|
170233
170533
|
const attributes9 = entity.state.attributes;
|
|
170234
|
-
|
|
170534
|
+
logger236.info(`cleanRoom called: roomMode=${roomMode}`);
|
|
170235
170535
|
const cleanAreaRooms = homeAssistant.state.mapping?.cleanAreaRooms;
|
|
170236
170536
|
if (cleanAreaRooms && cleanAreaRooms.length > 0) {
|
|
170237
170537
|
const sorted = [...cleanAreaRooms].sort(
|
|
@@ -170240,7 +170540,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170240
170540
|
const areaIndex = roomMode - ROOM_MODE_BASE2 - 1;
|
|
170241
170541
|
if (areaIndex >= 0 && areaIndex < sorted.length) {
|
|
170242
170542
|
const area = sorted[areaIndex];
|
|
170243
|
-
|
|
170543
|
+
logger236.info(
|
|
170244
170544
|
`cleanRoom: CLEAN_AREA "${area.name}" \u2192 vacuum.clean_area(${area.haAreaId})`
|
|
170245
170545
|
);
|
|
170246
170546
|
return {
|
|
@@ -170257,7 +170557,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170257
170557
|
const areaIndex = roomMode - ROOM_MODE_BASE2 - 1;
|
|
170258
170558
|
if (areaIndex >= 0 && areaIndex < sorted.length) {
|
|
170259
170559
|
const area = sorted[areaIndex];
|
|
170260
|
-
|
|
170560
|
+
logger236.info(
|
|
170261
170561
|
`cleanRoom: custom service area "${area.name}" \u2192 ${area.service}`
|
|
170262
170562
|
);
|
|
170263
170563
|
return {
|
|
@@ -170278,7 +170578,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170278
170578
|
}
|
|
170279
170579
|
const rooms = parseVacuumRooms(attributes9);
|
|
170280
170580
|
const numericIdFromMode = getRoomIdFromMode(roomMode);
|
|
170281
|
-
|
|
170581
|
+
logger236.info(
|
|
170282
170582
|
`cleanRoom: numericIdFromMode=${numericIdFromMode}, available rooms: ${JSON.stringify(rooms.map((r) => ({ id: r.id, name: r.name, modeValue: getRoomModeValue(r) })))}`
|
|
170283
170583
|
);
|
|
170284
170584
|
const room = rooms.find((r) => getRoomModeValue(r) === roomMode);
|
|
@@ -170288,7 +170588,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170288
170588
|
if (room.mapName) {
|
|
170289
170589
|
const vacuumName = vacuumEntityId.replace("vacuum.", "");
|
|
170290
170590
|
const selectedMapEntity = `select.${vacuumName}_selected_map`;
|
|
170291
|
-
|
|
170591
|
+
logger236.info(
|
|
170292
170592
|
`Dreame multi-floor: switching to map "${room.mapName}" via ${selectedMapEntity}`
|
|
170293
170593
|
);
|
|
170294
170594
|
homeAssistant.callAction({
|
|
@@ -170297,7 +170597,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170297
170597
|
data: { option: room.mapName }
|
|
170298
170598
|
});
|
|
170299
170599
|
}
|
|
170300
|
-
|
|
170600
|
+
logger236.debug(
|
|
170301
170601
|
`Dreame vacuum detected, using dreame_vacuum.vacuum_clean_segment for room ${room.name} (commandId: ${commandId3}, id: ${room.id})`
|
|
170302
170602
|
);
|
|
170303
170603
|
return {
|
|
@@ -170308,7 +170608,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170308
170608
|
};
|
|
170309
170609
|
}
|
|
170310
170610
|
if (isRoborockVacuum(attributes9) || isXiaomiMiotVacuum(attributes9)) {
|
|
170311
|
-
|
|
170611
|
+
logger236.debug(
|
|
170312
170612
|
`Using vacuum.send_command with app_segment_clean for room ${room.name} (commandId: ${commandId3}, id: ${room.id})`
|
|
170313
170613
|
);
|
|
170314
170614
|
return {
|
|
@@ -170321,7 +170621,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170321
170621
|
}
|
|
170322
170622
|
if (isEcovacsVacuum(attributes9)) {
|
|
170323
170623
|
const roomIdStr = String(commandId3);
|
|
170324
|
-
|
|
170624
|
+
logger236.info(
|
|
170325
170625
|
`Ecovacs vacuum: Using spot_area for room ${room.name} (id: ${roomIdStr})`
|
|
170326
170626
|
);
|
|
170327
170627
|
return {
|
|
@@ -170336,7 +170636,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
170336
170636
|
}
|
|
170337
170637
|
};
|
|
170338
170638
|
}
|
|
170339
|
-
|
|
170639
|
+
logger236.warn(
|
|
170340
170640
|
`Room cleaning via send_command not supported for this vacuum type. Room: ${room.name} (id=${commandId3}). Falling back to vacuum.start`
|
|
170341
170641
|
);
|
|
170342
170642
|
}
|
|
@@ -170353,20 +170653,20 @@ function createVacuumRvcRunModeServer(attributes9, includeUnnamedRooms = false,
|
|
|
170353
170653
|
customAreas,
|
|
170354
170654
|
disableRoomModes
|
|
170355
170655
|
);
|
|
170356
|
-
|
|
170656
|
+
logger236.info(
|
|
170357
170657
|
`Creating VacuumRvcRunModeServer with ${rooms.length} rooms, ${supportedModes2.length} total modes`
|
|
170358
170658
|
);
|
|
170359
170659
|
if (rooms.length > 0) {
|
|
170360
|
-
|
|
170660
|
+
logger236.info(`Rooms found: ${rooms.map((r) => r.name).join(", ")}`);
|
|
170361
170661
|
}
|
|
170362
170662
|
if (filteredCount > 0) {
|
|
170363
170663
|
const filtered = allRooms.filter((r) => !rooms.some((x) => x.id === r.id));
|
|
170364
|
-
|
|
170664
|
+
logger236.info(
|
|
170365
170665
|
`Filtered out ${filteredCount} unnamed room(s): ${filtered.map((r) => r.name).join(", ")}`
|
|
170366
170666
|
);
|
|
170367
170667
|
}
|
|
170368
170668
|
if (allRooms.length === 0) {
|
|
170369
|
-
|
|
170669
|
+
logger236.debug(
|
|
170370
170670
|
`No rooms found. Attributes: rooms=${JSON.stringify(attributes9.rooms)}, segments=${JSON.stringify(attributes9.segments)}, room_list=${attributes9.room_list}`
|
|
170371
170671
|
);
|
|
170372
170672
|
}
|
|
@@ -170400,7 +170700,7 @@ function createCleanAreaRvcRunModeServer(cleanAreaRooms) {
|
|
|
170400
170700
|
modeTags: [{ value: RvcRunMode3.ModeTag.Cleaning }]
|
|
170401
170701
|
});
|
|
170402
170702
|
}
|
|
170403
|
-
|
|
170703
|
+
logger236.info(
|
|
170404
170704
|
`Creating CLEAN_AREA RvcRunModeServer with ${cleanAreaRooms.length} HA areas, ${modes.length} total modes`
|
|
170405
170705
|
);
|
|
170406
170706
|
return RvcRunModeServer2(vacuumRvcRunModeConfig, {
|
|
@@ -170490,7 +170790,7 @@ init_nodejs();
|
|
|
170490
170790
|
|
|
170491
170791
|
// src/matter/behaviors/rvc-clean-mode-server.ts
|
|
170492
170792
|
init_home_assistant_entity_behavior();
|
|
170493
|
-
var
|
|
170793
|
+
var logger237 = Logger.get("RvcCleanModeServerBase");
|
|
170494
170794
|
var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeServer {
|
|
170495
170795
|
// Pending mode from a recent changeToMode command.
|
|
170496
170796
|
// Prevents stale HA state (from a different entity like select.xxx)
|
|
@@ -170537,14 +170837,14 @@ var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeS
|
|
|
170537
170837
|
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
170538
170838
|
const { newMode } = request;
|
|
170539
170839
|
if (newMode !== this.state.currentMode && !this.state.supportedModes.some((m) => m.mode === newMode)) {
|
|
170540
|
-
|
|
170840
|
+
logger237.warn(`changeToMode(${newMode}) rejected: unsupported mode`);
|
|
170541
170841
|
return {
|
|
170542
170842
|
status: ModeBase3.ModeChangeStatus.UnsupportedMode,
|
|
170543
170843
|
statusText: `Unsupported mode: ${newMode}`
|
|
170544
170844
|
};
|
|
170545
170845
|
}
|
|
170546
170846
|
const modeLabel = this.state.supportedModes.find((m) => m.mode === newMode);
|
|
170547
|
-
|
|
170847
|
+
logger237.info(
|
|
170548
170848
|
`changeToMode(${newMode}) "${modeLabel?.label ?? "unknown"}" for ${homeAssistant.entityId}`
|
|
170549
170849
|
);
|
|
170550
170850
|
this.pendingMode = newMode;
|
|
@@ -170552,7 +170852,7 @@ var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeS
|
|
|
170552
170852
|
this.state.currentMode = newMode;
|
|
170553
170853
|
const action = this.state.config.setCleanMode(newMode, this.agent);
|
|
170554
170854
|
if (action) {
|
|
170555
|
-
|
|
170855
|
+
logger237.info(
|
|
170556
170856
|
`changeToMode: dispatching action ${action.action} \u2192 ${action.target ?? homeAssistant.entityId}`
|
|
170557
170857
|
);
|
|
170558
170858
|
homeAssistant.callAction(action);
|
|
@@ -170585,7 +170885,7 @@ function RvcCleanModeServer2(config11, initialState) {
|
|
|
170585
170885
|
}
|
|
170586
170886
|
|
|
170587
170887
|
// src/matter/endpoints/legacy/vacuum/behaviors/vacuum-rvc-clean-mode-server.ts
|
|
170588
|
-
var
|
|
170888
|
+
var logger238 = Logger.get("VacuumRvcCleanModeServer");
|
|
170589
170889
|
var MODE_VACUUM = 0;
|
|
170590
170890
|
var MODE_VACUUM_AND_MOP = 1;
|
|
170591
170891
|
var MODE_MOP = 2;
|
|
@@ -170855,7 +171155,7 @@ function findMatchingCleanOption(ct, availableOptions) {
|
|
|
170855
171155
|
const match = availableOptions.find((o) => classifyCleanOption(o) === type);
|
|
170856
171156
|
if (match) return match;
|
|
170857
171157
|
}
|
|
170858
|
-
|
|
171158
|
+
logger238.warn(
|
|
170859
171159
|
`No match for ${CLEAN_TYPE_LABELS[ct]} in [${availableOptions.join(", ")}]`
|
|
170860
171160
|
);
|
|
170861
171161
|
return availableOptions[0];
|
|
@@ -170864,7 +171164,7 @@ function buildCleaningModeAction(targetCleanType, agent) {
|
|
|
170864
171164
|
const selectEntityId = getCleaningModeSelectEntity(agent);
|
|
170865
171165
|
const { options } = readSelectEntity(selectEntityId, agent);
|
|
170866
171166
|
const optionToUse = findMatchingCleanOption(targetCleanType, options);
|
|
170867
|
-
|
|
171167
|
+
logger238.info(
|
|
170868
171168
|
`Switching cleaning mode to: ${optionToUse} via ${selectEntityId}`
|
|
170869
171169
|
);
|
|
170870
171170
|
return {
|
|
@@ -170953,7 +171253,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
170953
171253
|
}
|
|
170954
171254
|
}
|
|
170955
171255
|
if (speedMode !== void 0) {
|
|
170956
|
-
|
|
171256
|
+
logger238.debug(
|
|
170957
171257
|
`Current mode: Vacuum + fan_speed="${speedState}" -> mode ${speedMode}`
|
|
170958
171258
|
);
|
|
170959
171259
|
return speedMode;
|
|
@@ -170974,7 +171274,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
170974
171274
|
}
|
|
170975
171275
|
}
|
|
170976
171276
|
if (mopMode !== void 0) {
|
|
170977
|
-
|
|
171277
|
+
logger238.debug(
|
|
170978
171278
|
`Current mode: Mop + intensity="${state}" -> mode ${mopMode}`
|
|
170979
171279
|
);
|
|
170980
171280
|
return mopMode;
|
|
@@ -170992,14 +171292,14 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
170992
171292
|
const homeAssistant = agent.get(HomeAssistantEntityBehavior);
|
|
170993
171293
|
const vacuumEntityId = homeAssistant.entityId;
|
|
170994
171294
|
const mapping = homeAssistant.state.mapping;
|
|
170995
|
-
|
|
171295
|
+
logger238.info(
|
|
170996
171296
|
`setCleanMode(${mode}) for ${vacuumEntityId}, suctionEntity=${mapping?.suctionLevelEntity ?? "none"}, mopEntity=${mapping?.mopIntensityEntity ?? "none"}, fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])}, customTags=${JSON.stringify(customFanSpeedTags ?? {})}`
|
|
170997
171297
|
);
|
|
170998
171298
|
if (mopIntensityList && mopIntensityList.length > 0 && isMopIntensityMode(mode)) {
|
|
170999
171299
|
const mopIndex = mode - MOP_INTENSITY_MODE_BASE;
|
|
171000
171300
|
const mopName = mopIntensityList[mopIndex];
|
|
171001
171301
|
if (!mopName) {
|
|
171002
|
-
|
|
171302
|
+
logger238.warn(`Invalid mop intensity mode index: ${mopIndex}`);
|
|
171003
171303
|
return void 0;
|
|
171004
171304
|
}
|
|
171005
171305
|
if (hasCleanTypes) {
|
|
@@ -171012,18 +171312,18 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
171012
171312
|
mapping.mopIntensityEntity,
|
|
171013
171313
|
agent
|
|
171014
171314
|
);
|
|
171015
|
-
|
|
171315
|
+
logger238.info(
|
|
171016
171316
|
`Mop intensity entity ${mapping.mopIntensityEntity}: current="${state}", options=${JSON.stringify(options ?? [])}`
|
|
171017
171317
|
);
|
|
171018
171318
|
let option = matchMopIntensityOption(mopName, options);
|
|
171019
171319
|
if (!option && options && mopIndex < options.length) {
|
|
171020
171320
|
option = options[mopIndex];
|
|
171021
|
-
|
|
171321
|
+
logger238.info(
|
|
171022
171322
|
`Positional match for mop "${mopName}" -> "${option}" (index ${mopIndex})`
|
|
171023
171323
|
);
|
|
171024
171324
|
}
|
|
171025
171325
|
if (option) {
|
|
171026
|
-
|
|
171326
|
+
logger238.info(
|
|
171027
171327
|
`Setting mop intensity to: ${option} via ${mapping.mopIntensityEntity}`
|
|
171028
171328
|
);
|
|
171029
171329
|
return {
|
|
@@ -171032,11 +171332,11 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
171032
171332
|
target: mapping.mopIntensityEntity
|
|
171033
171333
|
};
|
|
171034
171334
|
}
|
|
171035
|
-
|
|
171335
|
+
logger238.warn(
|
|
171036
171336
|
`No match for mop intensity "${mopName}" in options: [${(options ?? []).join(", ")}]`
|
|
171037
171337
|
);
|
|
171038
171338
|
} else {
|
|
171039
|
-
|
|
171339
|
+
logger238.warn(
|
|
171040
171340
|
`Mop intensity mode ${mode} requested but no mopIntensityEntity configured`
|
|
171041
171341
|
);
|
|
171042
171342
|
}
|
|
@@ -171046,7 +171346,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
171046
171346
|
const fanSpeedIndex = mode - FAN_SPEED_MODE_BASE;
|
|
171047
171347
|
const fanSpeedName = fanSpeedList[fanSpeedIndex];
|
|
171048
171348
|
if (!fanSpeedName) {
|
|
171049
|
-
|
|
171349
|
+
logger238.warn(`Invalid fan speed mode index: ${fanSpeedIndex}`);
|
|
171050
171350
|
return void 0;
|
|
171051
171351
|
}
|
|
171052
171352
|
if (mapping?.suctionLevelEntity) {
|
|
@@ -171059,7 +171359,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
171059
171359
|
mapping.suctionLevelEntity,
|
|
171060
171360
|
agent
|
|
171061
171361
|
);
|
|
171062
|
-
|
|
171362
|
+
logger238.info(
|
|
171063
171363
|
`Suction entity ${mapping.suctionLevelEntity}: current="${state}", options=${JSON.stringify(options ?? [])}`
|
|
171064
171364
|
);
|
|
171065
171365
|
let option = matchFanSpeedOption(
|
|
@@ -171069,12 +171369,12 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
171069
171369
|
);
|
|
171070
171370
|
if (!option && options && fanSpeedIndex < options.length) {
|
|
171071
171371
|
option = options[fanSpeedIndex];
|
|
171072
|
-
|
|
171372
|
+
logger238.info(
|
|
171073
171373
|
`Positional match for fan "${fanSpeedName}" -> "${option}" (index ${fanSpeedIndex})`
|
|
171074
171374
|
);
|
|
171075
171375
|
}
|
|
171076
171376
|
if (option) {
|
|
171077
|
-
|
|
171377
|
+
logger238.info(
|
|
171078
171378
|
`Setting suction to: ${option} via ${mapping.suctionLevelEntity}`
|
|
171079
171379
|
);
|
|
171080
171380
|
return {
|
|
@@ -171083,7 +171383,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
171083
171383
|
target: mapping.suctionLevelEntity
|
|
171084
171384
|
};
|
|
171085
171385
|
}
|
|
171086
|
-
|
|
171386
|
+
logger238.warn(
|
|
171087
171387
|
`No match for fan speed "${fanSpeedName}" in suction options: [${(options ?? []).join(", ")}]`
|
|
171088
171388
|
);
|
|
171089
171389
|
return void 0;
|
|
@@ -171093,7 +171393,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
171093
171393
|
buildCleaningModeAction(0 /* Sweeping */, agent)
|
|
171094
171394
|
);
|
|
171095
171395
|
}
|
|
171096
|
-
|
|
171396
|
+
logger238.info(
|
|
171097
171397
|
`Setting fan speed to: ${fanSpeedName} via vacuum.set_fan_speed`
|
|
171098
171398
|
);
|
|
171099
171399
|
return {
|
|
@@ -171103,7 +171403,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
171103
171403
|
};
|
|
171104
171404
|
}
|
|
171105
171405
|
if (!hasCleanTypes) {
|
|
171106
|
-
|
|
171406
|
+
logger238.debug(
|
|
171107
171407
|
`Ignoring cleaning type change (mode=${mode}): no cleaning mode entity`
|
|
171108
171408
|
);
|
|
171109
171409
|
return void 0;
|
|
@@ -171115,7 +171415,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
171115
171415
|
agent
|
|
171116
171416
|
);
|
|
171117
171417
|
const optionToUse = findMatchingCleanOption(cleanType, availableOptions);
|
|
171118
|
-
|
|
171418
|
+
logger238.info(
|
|
171119
171419
|
`Setting cleaning mode to: ${optionToUse} (mode=${mode}) via ${selectEntityId}`
|
|
171120
171420
|
);
|
|
171121
171421
|
return {
|
|
@@ -171133,10 +171433,10 @@ function createVacuumRvcCleanModeServer(_attributes, fanSpeedList, mopIntensityL
|
|
|
171133
171433
|
cleaningModeOptions,
|
|
171134
171434
|
customFanSpeedTags
|
|
171135
171435
|
);
|
|
171136
|
-
|
|
171436
|
+
logger238.info(
|
|
171137
171437
|
`Creating VacuumRvcCleanModeServer with ${supportedModes2.length} modes (fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])}, cleaningModeOptions=${JSON.stringify(cleaningModeOptions ?? [])}, customTags=${JSON.stringify(customFanSpeedTags ?? {})})`
|
|
171138
171438
|
);
|
|
171139
|
-
|
|
171439
|
+
logger238.info(
|
|
171140
171440
|
`Modes: ${supportedModes2.map((m) => `${m.mode}:${m.label}[${m.modeTags.map((t) => t.value).join(",")}]`).join(", ")}`
|
|
171141
171441
|
);
|
|
171142
171442
|
const initialState = {
|
|
@@ -171199,7 +171499,7 @@ function resolveMopIntensityList(mopIntensityEntity) {
|
|
|
171199
171499
|
init_dist();
|
|
171200
171500
|
init_esm();
|
|
171201
171501
|
init_home_assistant_entity_behavior();
|
|
171202
|
-
var
|
|
171502
|
+
var logger239 = Logger.get("VacuumRvcOperationalStateServer");
|
|
171203
171503
|
function batteryFromAttributes(attrs) {
|
|
171204
171504
|
const raw = attrs.battery_level ?? attrs.battery;
|
|
171205
171505
|
if (raw == null) return null;
|
|
@@ -171250,16 +171550,16 @@ function mapVacuumOperationalState(entity, batteryPercent = batteryFromAttribute
|
|
|
171250
171550
|
operationalState = RvcOperationalState4.OperationalState.Error;
|
|
171251
171551
|
} else {
|
|
171252
171552
|
if (state.toLowerCase().includes("clean")) {
|
|
171253
|
-
|
|
171553
|
+
logger239.info(
|
|
171254
171554
|
`Unknown vacuum state "${state}" contains 'clean', treating as Running`
|
|
171255
171555
|
);
|
|
171256
171556
|
operationalState = RvcOperationalState4.OperationalState.Running;
|
|
171257
171557
|
} else {
|
|
171258
|
-
|
|
171558
|
+
logger239.info(`Unknown vacuum state "${state}", treating as Stopped`);
|
|
171259
171559
|
operationalState = RvcOperationalState4.OperationalState.Stopped;
|
|
171260
171560
|
}
|
|
171261
171561
|
}
|
|
171262
|
-
|
|
171562
|
+
logger239.debug(
|
|
171263
171563
|
`Vacuum operationalState: "${state}" -> ${RvcOperationalState4.OperationalState[operationalState]}`
|
|
171264
171564
|
);
|
|
171265
171565
|
return operationalState;
|
|
@@ -171288,7 +171588,7 @@ var VacuumRvcOperationalStateServer = RvcOperationalStateServer2({
|
|
|
171288
171588
|
});
|
|
171289
171589
|
|
|
171290
171590
|
// src/matter/endpoints/legacy/vacuum/index.ts
|
|
171291
|
-
var
|
|
171591
|
+
var logger240 = Logger.get("VacuumDevice");
|
|
171292
171592
|
var VacuumEndpointType = RoboticVacuumCleanerDevice.with(
|
|
171293
171593
|
BasicInformationServer2,
|
|
171294
171594
|
VacuumIdentifyServer,
|
|
@@ -171302,7 +171602,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
|
|
|
171302
171602
|
const entityId = homeAssistantEntity.entity.entity_id;
|
|
171303
171603
|
const attributes9 = homeAssistantEntity.entity.state.attributes;
|
|
171304
171604
|
const customAreas = homeAssistantEntity.mapping?.customServiceAreas;
|
|
171305
|
-
|
|
171605
|
+
logger240.info(
|
|
171306
171606
|
`Creating vacuum endpoint for ${entityId}, mapping: ${JSON.stringify(homeAssistantEntity.mapping ?? "none")}`
|
|
171307
171607
|
);
|
|
171308
171608
|
const cleanAreaRooms = homeAssistantEntity.mapping?.cleanAreaRooms;
|
|
@@ -171315,32 +171615,32 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
|
|
|
171315
171615
|
)
|
|
171316
171616
|
).set({ homeAssistantEntity });
|
|
171317
171617
|
if (includeOnOff) {
|
|
171318
|
-
|
|
171618
|
+
logger240.info(`${entityId}: Adding OnOff cluster (vacuumOnOff flag enabled)`);
|
|
171319
171619
|
device = device.with(VacuumOnOffServer);
|
|
171320
171620
|
}
|
|
171321
171621
|
device = device.with(VacuumPowerSourceServer);
|
|
171322
171622
|
const roomEntities = homeAssistantEntity.mapping?.roomEntities;
|
|
171323
171623
|
const rooms = parseVacuumRooms(attributes9);
|
|
171324
|
-
|
|
171624
|
+
logger240.info(
|
|
171325
171625
|
`${entityId}: customAreas=${customAreas?.length ?? 0}, roomEntities=${JSON.stringify(roomEntities ?? [])}, parsedRooms=${rooms.length}, cleanAreaRooms=${cleanAreaRooms?.length ?? 0}`
|
|
171326
171626
|
);
|
|
171327
171627
|
if (cleanAreaRooms && cleanAreaRooms.length > 0) {
|
|
171328
|
-
|
|
171628
|
+
logger240.info(
|
|
171329
171629
|
`${entityId}: Adding ServiceArea (${cleanAreaRooms.length} HA areas via CLEAN_AREA)`
|
|
171330
171630
|
);
|
|
171331
171631
|
device = device.with(createCleanAreaServiceAreaServer(cleanAreaRooms));
|
|
171332
171632
|
} else if (customAreas && customAreas.length > 0) {
|
|
171333
|
-
|
|
171633
|
+
logger240.info(
|
|
171334
171634
|
`${entityId}: Adding ServiceArea (${customAreas.length} custom areas)`
|
|
171335
171635
|
);
|
|
171336
171636
|
device = device.with(createCustomServiceAreaServer(customAreas));
|
|
171337
171637
|
} else if (rooms.length > 0 || roomEntities && roomEntities.length > 0) {
|
|
171338
|
-
|
|
171638
|
+
logger240.info(`${entityId}: Adding ServiceArea (${rooms.length} rooms)`);
|
|
171339
171639
|
device = device.with(
|
|
171340
171640
|
createVacuumServiceAreaServer(attributes9, roomEntities)
|
|
171341
171641
|
);
|
|
171342
171642
|
} else {
|
|
171343
|
-
|
|
171643
|
+
logger240.info(`${entityId}: Adding ServiceArea (default single-area)`);
|
|
171344
171644
|
device = device.with(createDefaultServiceAreaServer());
|
|
171345
171645
|
}
|
|
171346
171646
|
const fanSpeedList = resolveFanSpeedList(
|
|
@@ -171351,7 +171651,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
|
|
|
171351
171651
|
homeAssistantEntity.mapping?.mopIntensityEntity
|
|
171352
171652
|
);
|
|
171353
171653
|
if (cleaningModeOptions || fanSpeedList || mopIntensityList) {
|
|
171354
|
-
|
|
171654
|
+
logger240.info(
|
|
171355
171655
|
`${entityId}: Adding RvcCleanMode (multi-mode, cleaningModeOptions=${JSON.stringify(cleaningModeOptions ?? [])}, fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])})`
|
|
171356
171656
|
);
|
|
171357
171657
|
device = device.with(
|
|
@@ -171364,7 +171664,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
|
|
|
171364
171664
|
)
|
|
171365
171665
|
);
|
|
171366
171666
|
} else {
|
|
171367
|
-
|
|
171667
|
+
logger240.info(`${entityId}: Adding RvcCleanMode (default single-mode)`);
|
|
171368
171668
|
device = device.with(createDefaultRvcCleanModeServer());
|
|
171369
171669
|
}
|
|
171370
171670
|
return device;
|
|
@@ -171530,7 +171830,7 @@ var WaterHeaterThermostatServer = ThermostatServer2(
|
|
|
171530
171830
|
);
|
|
171531
171831
|
|
|
171532
171832
|
// src/matter/endpoints/legacy/water-heater/index.ts
|
|
171533
|
-
var
|
|
171833
|
+
var logger241 = Logger.get("WaterHeaterDevice");
|
|
171534
171834
|
var WaterHeaterDeviceType = ThermostatDevice.with(
|
|
171535
171835
|
BasicInformationServer2,
|
|
171536
171836
|
IdentifyServer2,
|
|
@@ -171546,7 +171846,7 @@ function toMatterTemp2(value) {
|
|
|
171546
171846
|
}
|
|
171547
171847
|
function WaterHeaterDevice(homeAssistantEntity) {
|
|
171548
171848
|
const attributes9 = homeAssistantEntity.entity.state.attributes;
|
|
171549
|
-
|
|
171849
|
+
logger241.debug(
|
|
171550
171850
|
`Creating device for ${homeAssistantEntity.entity.entity_id}, min_temp=${attributes9.min_temp}, max_temp=${attributes9.max_temp}`
|
|
171551
171851
|
);
|
|
171552
171852
|
const minLimit = toMatterTemp2(attributes9.min_temp) ?? 0;
|
|
@@ -171786,6 +172086,7 @@ var matterDeviceTypeFactories = {
|
|
|
171786
172086
|
// Legacy SolarPower alias, kept for existing mappings.
|
|
171787
172087
|
electrical_sensor: (ha) => ElectricalSensorType.set({ homeAssistantEntity: ha }),
|
|
171788
172088
|
solar_power: (ha) => ElectricalSensorType.set({ homeAssistantEntity: ha }),
|
|
172089
|
+
evse: (ha) => energyEvseType().set({ homeAssistantEntity: ha }),
|
|
171789
172090
|
contact_sensor: (ha) => ContactSensorType.set({ homeAssistantEntity: ha }),
|
|
171790
172091
|
motion_sensor: (ha) => MotionSensorType.set({ homeAssistantEntity: ha }),
|
|
171791
172092
|
occupancy_sensor: (ha) => OccupancySensorType.set({ homeAssistantEntity: ha }),
|
|
@@ -171801,7 +172102,7 @@ var matterDeviceTypeFactories = {
|
|
|
171801
172102
|
};
|
|
171802
172103
|
|
|
171803
172104
|
// src/matter/endpoints/composed/user-composed-endpoint.ts
|
|
171804
|
-
var
|
|
172105
|
+
var logger242 = Logger.get("UserComposedEndpoint");
|
|
171805
172106
|
function stripBasicInformation(type) {
|
|
171806
172107
|
const behaviors = { ...type.behaviors };
|
|
171807
172108
|
delete behaviors.bridgedDeviceBasicInformation;
|
|
@@ -171877,7 +172178,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
|
|
|
171877
172178
|
{ vacuumOnOff: registry2.isVacuumOnOffEnabled() }
|
|
171878
172179
|
);
|
|
171879
172180
|
if (!primaryType) {
|
|
171880
|
-
|
|
172181
|
+
logger242.warn(
|
|
171881
172182
|
`Cannot create endpoint type for primary entity ${primaryEntityId}`
|
|
171882
172183
|
);
|
|
171883
172184
|
return void 0;
|
|
@@ -171892,7 +172193,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
|
|
|
171892
172193
|
if (!sub.entityId) continue;
|
|
171893
172194
|
const subPayload = buildEntityPayload4(registry2, sub.entityId);
|
|
171894
172195
|
if (!subPayload) {
|
|
171895
|
-
|
|
172196
|
+
logger242.warn(
|
|
171896
172197
|
`Cannot find state for composed sub-entity ${sub.entityId}, it does not exist in Home Assistant (removed or renamed?)`
|
|
171897
172198
|
);
|
|
171898
172199
|
continue;
|
|
@@ -171907,7 +172208,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
|
|
|
171907
172208
|
config11.areaName
|
|
171908
172209
|
);
|
|
171909
172210
|
if (!subType) {
|
|
171910
|
-
|
|
172211
|
+
logger242.warn(
|
|
171911
172212
|
`Cannot create endpoint type for composed sub-entity ${sub.entityId}`
|
|
171912
172213
|
);
|
|
171913
172214
|
continue;
|
|
@@ -171920,7 +172221,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
|
|
|
171920
172221
|
mappedIds.push(sub.entityId);
|
|
171921
172222
|
}
|
|
171922
172223
|
if (parts.length < 2) {
|
|
171923
|
-
|
|
172224
|
+
logger242.warn(
|
|
171924
172225
|
`User composed device ${primaryEntityId}: only ${parts.length} sub-endpoint(s), need at least 2 (primary + one sub-entity). Falling back to standalone.`
|
|
171925
172226
|
);
|
|
171926
172227
|
return void 0;
|
|
@@ -171944,7 +172245,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
|
|
|
171944
172245
|
const labels = parts.map(
|
|
171945
172246
|
(_, i) => i === 0 ? primaryEntityId.split(".")[0] : composedEntities[i - 1]?.entityId?.split(".")[0] ?? "?"
|
|
171946
172247
|
).join("+");
|
|
171947
|
-
|
|
172248
|
+
logger242.info(
|
|
171948
172249
|
`Created user composed device ${primaryEntityId}: ${parts.length} sub-endpoint(s) [${labels}]`
|
|
171949
172250
|
);
|
|
171950
172251
|
return endpoint;
|
|
@@ -172050,7 +172351,7 @@ function asStandaloneEndpointType(type) {
|
|
|
172050
172351
|
}
|
|
172051
172352
|
|
|
172052
172353
|
// src/matter/endpoints/legacy/legacy-endpoint.ts
|
|
172053
|
-
var
|
|
172354
|
+
var logger243 = Logger.get("LegacyEndpoint");
|
|
172054
172355
|
var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
172055
172356
|
static async create(registry2, entityId, mapping, pluginDomainMappings, standalone = false, endpointId, identityAnchor) {
|
|
172056
172357
|
const deviceRegistry = registry2.deviceOf(entityId);
|
|
@@ -172060,25 +172361,25 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172060
172361
|
return;
|
|
172061
172362
|
}
|
|
172062
172363
|
if (registry2.isAutoBatteryMappingEnabled() && registry2.isBatteryEntityUsed(entityId)) {
|
|
172063
|
-
|
|
172364
|
+
logger243.debug(
|
|
172064
172365
|
`Skipping ${entityId} - already auto-assigned as battery to another device`
|
|
172065
172366
|
);
|
|
172066
172367
|
return;
|
|
172067
172368
|
}
|
|
172068
172369
|
if (registry2.isAutoHumidityMappingEnabled() && registry2.isHumidityEntityUsed(entityId)) {
|
|
172069
|
-
|
|
172370
|
+
logger243.debug(
|
|
172070
172371
|
`Skipping ${entityId} - already auto-assigned as humidity to a temperature sensor`
|
|
172071
172372
|
);
|
|
172072
172373
|
return;
|
|
172073
172374
|
}
|
|
172074
172375
|
if (registry2.isAutoPressureMappingEnabled() && registry2.isPressureEntityUsed(entityId)) {
|
|
172075
|
-
|
|
172376
|
+
logger243.debug(
|
|
172076
172377
|
`Skipping ${entityId} - already auto-assigned as pressure to a temperature sensor`
|
|
172077
172378
|
);
|
|
172078
172379
|
return;
|
|
172079
172380
|
}
|
|
172080
172381
|
if (registry2.isAutoComposedDevicesEnabled() && registry2.isComposedSubEntityUsed(entityId)) {
|
|
172081
|
-
|
|
172382
|
+
logger243.debug(
|
|
172082
172383
|
`Skipping ${entityId} - already consumed by a composed device`
|
|
172083
172384
|
);
|
|
172084
172385
|
return;
|
|
@@ -172098,7 +172399,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172098
172399
|
humidityEntity: humidityEntityId
|
|
172099
172400
|
};
|
|
172100
172401
|
registry2.markHumidityEntityUsed(humidityEntityId);
|
|
172101
|
-
|
|
172402
|
+
logger243.debug(
|
|
172102
172403
|
`Auto-assigned humidity ${humidityEntityId} to ${entityId}`
|
|
172103
172404
|
);
|
|
172104
172405
|
}
|
|
@@ -172117,7 +172418,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172117
172418
|
pressureEntity: pressureEntityId
|
|
172118
172419
|
};
|
|
172119
172420
|
registry2.markPressureEntityUsed(pressureEntityId);
|
|
172120
|
-
|
|
172421
|
+
logger243.debug(
|
|
172121
172422
|
`Auto-assigned pressure ${pressureEntityId} to ${entityId}`
|
|
172122
172423
|
);
|
|
172123
172424
|
}
|
|
@@ -172135,7 +172436,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172135
172436
|
batteryEntity: batteryEntityId
|
|
172136
172437
|
};
|
|
172137
172438
|
registry2.markBatteryEntityUsed(batteryEntityId);
|
|
172138
|
-
|
|
172439
|
+
logger243.debug(
|
|
172139
172440
|
`Auto-assigned battery ${batteryEntityId} to ${entityId}`
|
|
172140
172441
|
);
|
|
172141
172442
|
}
|
|
@@ -172152,7 +172453,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172152
172453
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
172153
172454
|
faultEntity: faultEntityId
|
|
172154
172455
|
};
|
|
172155
|
-
|
|
172456
|
+
logger243.debug(`Auto-assigned fault ${faultEntityId} to ${entityId}`);
|
|
172156
172457
|
}
|
|
172157
172458
|
}
|
|
172158
172459
|
if (!mapping?.powerEntity) {
|
|
@@ -172168,7 +172469,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172168
172469
|
powerEntity: powerEntityId
|
|
172169
172470
|
};
|
|
172170
172471
|
registry2.markPowerEntityUsed(powerEntityId);
|
|
172171
|
-
|
|
172472
|
+
logger243.debug(`Auto-assigned power ${powerEntityId} to ${entityId}`);
|
|
172172
172473
|
}
|
|
172173
172474
|
}
|
|
172174
172475
|
}
|
|
@@ -172185,7 +172486,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172185
172486
|
energyEntity: energyEntityId
|
|
172186
172487
|
};
|
|
172187
172488
|
registry2.markEnergyEntityUsed(energyEntityId);
|
|
172188
|
-
|
|
172489
|
+
logger243.debug(
|
|
172189
172490
|
`Auto-assigned energy ${energyEntityId} to ${entityId}`
|
|
172190
172491
|
);
|
|
172191
172492
|
}
|
|
@@ -172201,7 +172502,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172201
172502
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
172202
172503
|
cleaningModeEntity: vacuumEntities.cleaningModeEntity
|
|
172203
172504
|
};
|
|
172204
|
-
|
|
172505
|
+
logger243.info(
|
|
172205
172506
|
`Auto-assigned cleaningMode ${vacuumEntities.cleaningModeEntity} to ${entityId}`
|
|
172206
172507
|
);
|
|
172207
172508
|
}
|
|
@@ -172211,7 +172512,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172211
172512
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
172212
172513
|
suctionLevelEntity: vacuumEntities.suctionLevelEntity
|
|
172213
172514
|
};
|
|
172214
|
-
|
|
172515
|
+
logger243.info(
|
|
172215
172516
|
`Auto-assigned suctionLevel ${vacuumEntities.suctionLevelEntity} to ${entityId}`
|
|
172216
172517
|
);
|
|
172217
172518
|
}
|
|
@@ -172221,7 +172522,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172221
172522
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
172222
172523
|
mopIntensityEntity: vacuumEntities.mopIntensityEntity
|
|
172223
172524
|
};
|
|
172224
|
-
|
|
172525
|
+
logger243.info(
|
|
172225
172526
|
`Auto-assigned mopIntensity ${vacuumEntities.mopIntensityEntity} to ${entityId}`
|
|
172226
172527
|
);
|
|
172227
172528
|
}
|
|
@@ -172231,7 +172532,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172231
172532
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
172232
172533
|
currentRoomEntity: vacuumEntities.currentRoomEntity
|
|
172233
172534
|
};
|
|
172234
|
-
|
|
172535
|
+
logger243.info(
|
|
172235
172536
|
`Auto-assigned currentRoom ${vacuumEntities.currentRoomEntity} to ${entityId}`
|
|
172236
172537
|
);
|
|
172237
172538
|
}
|
|
@@ -172246,7 +172547,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172246
172547
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
172247
172548
|
cleanAreaRooms
|
|
172248
172549
|
};
|
|
172249
|
-
|
|
172550
|
+
logger243.info(
|
|
172250
172551
|
`Using ${cleanAreaRooms.length} HA areas via CLEAN_AREA for ${entityId}`
|
|
172251
172552
|
);
|
|
172252
172553
|
}
|
|
@@ -172267,7 +172568,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172267
172568
|
rooms: roomsObj
|
|
172268
172569
|
}
|
|
172269
172570
|
};
|
|
172270
|
-
|
|
172571
|
+
logger243.debug(
|
|
172271
172572
|
`Auto-detected ${valetudoRooms.length} Valetudo segments for ${entityId}`
|
|
172272
172573
|
);
|
|
172273
172574
|
} else {
|
|
@@ -172284,7 +172585,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172284
172585
|
rooms: roomsObj
|
|
172285
172586
|
}
|
|
172286
172587
|
};
|
|
172287
|
-
|
|
172588
|
+
logger243.debug(
|
|
172288
172589
|
`Auto-detected ${roborockRooms.length} Roborock rooms for ${entityId}`
|
|
172289
172590
|
);
|
|
172290
172591
|
}
|
|
@@ -172293,7 +172594,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172293
172594
|
}
|
|
172294
172595
|
}
|
|
172295
172596
|
if (standalone && ((effectiveMapping?.composedEntities?.length ?? 0) > 0 || effectiveMapping?.climateExposeFan === true)) {
|
|
172296
|
-
|
|
172597
|
+
logger243.warn(
|
|
172297
172598
|
`Composed mappings are not supported in server mode, exposing ${entityId} as a flat standalone endpoint`
|
|
172298
172599
|
);
|
|
172299
172600
|
}
|
|
@@ -172312,7 +172613,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172312
172613
|
if (composed) {
|
|
172313
172614
|
return composed;
|
|
172314
172615
|
}
|
|
172315
|
-
|
|
172616
|
+
logger243.warn(
|
|
172316
172617
|
`User composed device creation failed for ${entityId}, falling back to standalone`
|
|
172317
172618
|
);
|
|
172318
172619
|
}
|
|
@@ -172377,7 +172678,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172377
172678
|
if (composed) {
|
|
172378
172679
|
return composed;
|
|
172379
172680
|
}
|
|
172380
|
-
|
|
172681
|
+
logger243.warn(
|
|
172381
172682
|
`Companion fan creation failed for ${entityId}, falling back to standalone`
|
|
172382
172683
|
);
|
|
172383
172684
|
}
|
|
@@ -172457,11 +172758,11 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
172457
172758
|
}
|
|
172458
172759
|
if (mappedChanged) {
|
|
172459
172760
|
this.pendingMappedChange = true;
|
|
172460
|
-
|
|
172761
|
+
logger243.debug(
|
|
172461
172762
|
`Mapped entity change detected for ${this.entityId}, forcing update`
|
|
172462
172763
|
);
|
|
172463
172764
|
}
|
|
172464
|
-
|
|
172765
|
+
logger243.debug(
|
|
172465
172766
|
`State update received for ${this.entityId}: state=${state.state}`
|
|
172466
172767
|
);
|
|
172467
172768
|
this.lastState = state;
|
|
@@ -173040,7 +173341,7 @@ import {
|
|
|
173040
173341
|
getCollection
|
|
173041
173342
|
} from "home-assistant-js-websocket";
|
|
173042
173343
|
import { atLeastHaVersion } from "home-assistant-js-websocket/dist/util.js";
|
|
173043
|
-
var
|
|
173344
|
+
var logger244 = Logger.get("SubscribeEntities");
|
|
173044
173345
|
function processEvent(store, updates) {
|
|
173045
173346
|
const state = { ...store.state };
|
|
173046
173347
|
if (updates.a) {
|
|
@@ -173066,7 +173367,7 @@ function processEvent(store, updates) {
|
|
|
173066
173367
|
for (const entityId in updates.c) {
|
|
173067
173368
|
let entityState = state[entityId];
|
|
173068
173369
|
if (!entityState) {
|
|
173069
|
-
|
|
173370
|
+
logger244.warn("Received state update for unknown entity", entityId);
|
|
173070
173371
|
continue;
|
|
173071
173372
|
}
|
|
173072
173373
|
entityState = { ...entityState };
|
|
@@ -173155,7 +173456,7 @@ var subscribeEntities = (conn, onChange, entityIds) => {
|
|
|
173155
173456
|
// src/services/bridges/entity-isolation-service.ts
|
|
173156
173457
|
init_esm();
|
|
173157
173458
|
init_diagnostic_event_bus();
|
|
173158
|
-
var
|
|
173459
|
+
var logger245 = Logger.get("EntityIsolation");
|
|
173159
173460
|
var EntityIsolationServiceImpl = class {
|
|
173160
173461
|
isolatedEntities = /* @__PURE__ */ new Map();
|
|
173161
173462
|
isolationCallbacks = /* @__PURE__ */ new Map();
|
|
@@ -173220,13 +173521,13 @@ var EntityIsolationServiceImpl = class {
|
|
|
173220
173521
|
}
|
|
173221
173522
|
const parsed = this.parseEndpointPath(msg);
|
|
173222
173523
|
if (!parsed) {
|
|
173223
|
-
|
|
173524
|
+
logger245.warn("Could not parse entity from error:", msg);
|
|
173224
173525
|
return false;
|
|
173225
173526
|
}
|
|
173226
173527
|
const { bridgeId, entityName } = parsed;
|
|
173227
173528
|
const callback = this.isolationCallbacks.get(bridgeId);
|
|
173228
173529
|
if (!callback) {
|
|
173229
|
-
|
|
173530
|
+
logger245.warn(
|
|
173230
173531
|
`No isolation callback registered for bridge ${bridgeId}, entity: ${entityName}`
|
|
173231
173532
|
);
|
|
173232
173533
|
return false;
|
|
@@ -173241,7 +173542,7 @@ var EntityIsolationServiceImpl = class {
|
|
|
173241
173542
|
reason,
|
|
173242
173543
|
failedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
173243
173544
|
});
|
|
173244
|
-
|
|
173545
|
+
logger245.warn(
|
|
173245
173546
|
`Isolating entity "${entityName}" from bridge ${bridgeId} due to: ${reason}`
|
|
173246
173547
|
);
|
|
173247
173548
|
diagnosticEventBus.emit("entity_error", `Entity isolated: ${entityName}`, {
|
|
@@ -173253,7 +173554,7 @@ var EntityIsolationServiceImpl = class {
|
|
|
173253
173554
|
await callback(entityName);
|
|
173254
173555
|
return true;
|
|
173255
173556
|
} catch (e) {
|
|
173256
|
-
|
|
173557
|
+
logger245.error(`Failed to isolate entity ${entityName}:`, e);
|
|
173257
173558
|
return false;
|
|
173258
173559
|
}
|
|
173259
173560
|
}
|
|
@@ -174771,11 +175072,11 @@ function makeWarmStartState(state, now = (/* @__PURE__ */ new Date()).toISOStrin
|
|
|
174771
175072
|
return { ...state, last_updated: now };
|
|
174772
175073
|
}
|
|
174773
175074
|
var ServerModeBridge = class {
|
|
174774
|
-
constructor(
|
|
175075
|
+
constructor(logger248, dataProvider, endpointManager, server) {
|
|
174775
175076
|
this.dataProvider = dataProvider;
|
|
174776
175077
|
this.endpointManager = endpointManager;
|
|
174777
175078
|
this.server = server;
|
|
174778
|
-
this.log =
|
|
175079
|
+
this.log = logger248.get(`ServerModeBridge / ${dataProvider.id}`);
|
|
174779
175080
|
}
|
|
174780
175081
|
dataProvider;
|
|
174781
175082
|
endpointManager;
|
|
@@ -175803,7 +176104,7 @@ function ServerModeVacuumDevice(homeAssistantEntity, includeOnOff = false, clean
|
|
|
175803
176104
|
}
|
|
175804
176105
|
|
|
175805
176106
|
// src/matter/endpoints/server-mode-vacuum-endpoint.ts
|
|
175806
|
-
var
|
|
176107
|
+
var logger246 = Logger.get("ServerModeVacuumEndpoint");
|
|
175807
176108
|
var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEndpoint {
|
|
175808
176109
|
static async create(registry2, entityId, mapping, endpointId) {
|
|
175809
176110
|
const deviceRegistry = registry2.deviceOf(entityId);
|
|
@@ -175816,7 +176117,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
175816
176117
|
if (mapping?.disableBatteryMapping && mapping.batteryEntity) {
|
|
175817
176118
|
effectiveMapping = { ...mapping, batteryEntity: void 0 };
|
|
175818
176119
|
}
|
|
175819
|
-
|
|
176120
|
+
logger246.info(
|
|
175820
176121
|
`${entityId}: device_id=${entity.device_id}, manualBattery=${mapping?.batteryEntity ?? "none"}`
|
|
175821
176122
|
);
|
|
175822
176123
|
if (entity.device_id) {
|
|
@@ -175831,15 +176132,15 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
175831
176132
|
batteryEntity: batteryEntityId
|
|
175832
176133
|
};
|
|
175833
176134
|
registry2.markBatteryEntityUsed(batteryEntityId);
|
|
175834
|
-
|
|
176135
|
+
logger246.info(`${entityId}: Auto-assigned battery ${batteryEntityId}`);
|
|
175835
176136
|
} else {
|
|
175836
176137
|
const attrs = state.attributes;
|
|
175837
176138
|
if (attrs.battery_level != null || attrs.battery != null) {
|
|
175838
|
-
|
|
176139
|
+
logger246.info(
|
|
175839
176140
|
`${entityId}: No battery entity found, using battery attribute from vacuum state`
|
|
175840
176141
|
);
|
|
175841
176142
|
} else {
|
|
175842
|
-
|
|
176143
|
+
logger246.warn(
|
|
175843
176144
|
`${entityId}: No battery entity found for device ${entity.device_id}`
|
|
175844
176145
|
);
|
|
175845
176146
|
}
|
|
@@ -175854,7 +176155,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
175854
176155
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
175855
176156
|
cleaningModeEntity: vacuumEntities.cleaningModeEntity
|
|
175856
176157
|
};
|
|
175857
|
-
|
|
176158
|
+
logger246.info(
|
|
175858
176159
|
`${entityId}: Auto-assigned cleaningMode ${vacuumEntities.cleaningModeEntity}`
|
|
175859
176160
|
);
|
|
175860
176161
|
}
|
|
@@ -175864,7 +176165,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
175864
176165
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
175865
176166
|
suctionLevelEntity: vacuumEntities.suctionLevelEntity
|
|
175866
176167
|
};
|
|
175867
|
-
|
|
176168
|
+
logger246.info(
|
|
175868
176169
|
`${entityId}: Auto-assigned suctionLevel ${vacuumEntities.suctionLevelEntity}`
|
|
175869
176170
|
);
|
|
175870
176171
|
}
|
|
@@ -175874,7 +176175,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
175874
176175
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
175875
176176
|
mopIntensityEntity: vacuumEntities.mopIntensityEntity
|
|
175876
176177
|
};
|
|
175877
|
-
|
|
176178
|
+
logger246.info(
|
|
175878
176179
|
`${entityId}: Auto-assigned mopIntensity ${vacuumEntities.mopIntensityEntity}`
|
|
175879
176180
|
);
|
|
175880
176181
|
}
|
|
@@ -175884,7 +176185,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
175884
176185
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
175885
176186
|
currentRoomEntity: vacuumEntities.currentRoomEntity
|
|
175886
176187
|
};
|
|
175887
|
-
|
|
176188
|
+
logger246.info(
|
|
175888
176189
|
`${entityId}: Auto-assigned currentRoom ${vacuumEntities.currentRoomEntity}`
|
|
175889
176190
|
);
|
|
175890
176191
|
}
|
|
@@ -175899,7 +176200,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
175899
176200
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
175900
176201
|
cleanAreaRooms
|
|
175901
176202
|
};
|
|
175902
|
-
|
|
176203
|
+
logger246.info(
|
|
175903
176204
|
`${entityId}: Using ${cleanAreaRooms.length} HA areas via CLEAN_AREA`
|
|
175904
176205
|
);
|
|
175905
176206
|
}
|
|
@@ -175920,7 +176221,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
175920
176221
|
rooms: roomsObj
|
|
175921
176222
|
}
|
|
175922
176223
|
};
|
|
175923
|
-
|
|
176224
|
+
logger246.info(
|
|
175924
176225
|
`${entityId}: Auto-detected ${valetudoRooms.length} Valetudo segments`
|
|
175925
176226
|
);
|
|
175926
176227
|
} else {
|
|
@@ -175937,14 +176238,14 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
175937
176238
|
rooms: roomsObj
|
|
175938
176239
|
}
|
|
175939
176240
|
};
|
|
175940
|
-
|
|
176241
|
+
logger246.info(
|
|
175941
176242
|
`${entityId}: Auto-detected ${roborockRooms.length} Roborock rooms`
|
|
175942
176243
|
);
|
|
175943
176244
|
}
|
|
175944
176245
|
}
|
|
175945
176246
|
}
|
|
175946
176247
|
} else {
|
|
175947
|
-
|
|
176248
|
+
logger246.warn(`${entityId}: No device_id, cannot auto-assign battery`);
|
|
175948
176249
|
}
|
|
175949
176250
|
const payload = {
|
|
175950
176251
|
entity_id: entityId,
|
|
@@ -176017,11 +176318,11 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
176017
176318
|
}
|
|
176018
176319
|
if (mappedChanged) {
|
|
176019
176320
|
this.pendingMappedChange = true;
|
|
176020
|
-
|
|
176321
|
+
logger246.debug(
|
|
176021
176322
|
`Mapped entity change detected for ${this.entityId}, forcing update`
|
|
176022
176323
|
);
|
|
176023
176324
|
}
|
|
176024
|
-
|
|
176325
|
+
logger246.debug(
|
|
176025
176326
|
`State update received for ${this.entityId}: state=${state.state}`
|
|
176026
176327
|
);
|
|
176027
176328
|
this.lastState = state;
|
|
@@ -176599,10 +176900,10 @@ var BridgeEnvironmentFactory = class extends BridgeFactory {
|
|
|
176599
176900
|
// src/core/ioc/app-environment.ts
|
|
176600
176901
|
var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
|
|
176601
176902
|
constructor(rootEnv, options) {
|
|
176602
|
-
const
|
|
176903
|
+
const logger248 = rootEnv.get(LoggerService);
|
|
176603
176904
|
super({
|
|
176604
176905
|
id: "App",
|
|
176605
|
-
log:
|
|
176906
|
+
log: logger248.get("AppContainer"),
|
|
176606
176907
|
parent: rootEnv
|
|
176607
176908
|
});
|
|
176608
176909
|
this.options = options;
|
|
@@ -176616,8 +176917,8 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
|
|
|
176616
176917
|
}
|
|
176617
176918
|
construction;
|
|
176618
176919
|
async init() {
|
|
176619
|
-
const
|
|
176620
|
-
this.set(LoggerService,
|
|
176920
|
+
const logger248 = this.get(LoggerService);
|
|
176921
|
+
this.set(LoggerService, logger248);
|
|
176621
176922
|
this.set(AppStorage, new AppStorage(await this.load(StorageService)));
|
|
176622
176923
|
this.set(BridgeStorage, new BridgeStorage(await this.load(AppStorage)));
|
|
176623
176924
|
this.set(
|
|
@@ -176638,7 +176939,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
|
|
|
176638
176939
|
);
|
|
176639
176940
|
this.set(
|
|
176640
176941
|
HomeAssistantClient,
|
|
176641
|
-
new HomeAssistantClient(
|
|
176942
|
+
new HomeAssistantClient(logger248, this.options.homeAssistant)
|
|
176642
176943
|
);
|
|
176643
176944
|
this.set(
|
|
176644
176945
|
HomeAssistantConfig,
|
|
@@ -176646,7 +176947,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
|
|
|
176646
176947
|
);
|
|
176647
176948
|
this.set(
|
|
176648
176949
|
HomeAssistantActions,
|
|
176649
|
-
new HomeAssistantActions(
|
|
176950
|
+
new HomeAssistantActions(logger248, await this.load(HomeAssistantClient))
|
|
176650
176951
|
);
|
|
176651
176952
|
this.set(
|
|
176652
176953
|
HomeAssistantRegistry,
|
|
@@ -176682,7 +176983,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
|
|
|
176682
176983
|
this.set(
|
|
176683
176984
|
WebApi,
|
|
176684
176985
|
new WebApi(
|
|
176685
|
-
|
|
176986
|
+
logger248,
|
|
176686
176987
|
await this.load(BridgeService),
|
|
176687
176988
|
await this.load(HomeAssistantClient),
|
|
176688
176989
|
await this.load(HomeAssistantRegistry),
|
|
@@ -176703,7 +177004,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
|
|
|
176703
177004
|
|
|
176704
177005
|
// src/matter/patches/patch-level-control-tlv.ts
|
|
176705
177006
|
init_esm();
|
|
176706
|
-
var
|
|
177007
|
+
var logger247 = Logger.get("PatchLevelControlTlv");
|
|
176707
177008
|
var optionalFieldModels = /* @__PURE__ */ new WeakSet();
|
|
176708
177009
|
var fieldModelMandatoryGetterPatched = false;
|
|
176709
177010
|
function patchLevelControlTlv() {
|
|
@@ -176759,11 +177060,11 @@ function patchLevelControlTlv() {
|
|
|
176759
177060
|
patched++;
|
|
176760
177061
|
}
|
|
176761
177062
|
if (patched > 0) {
|
|
176762
|
-
|
|
177063
|
+
logger247.info(
|
|
176763
177064
|
`Patched ${patched} LevelControl TLV schema(s): transitionTime is now optional (Google Home compatibility)`
|
|
176764
177065
|
);
|
|
176765
177066
|
} else {
|
|
176766
|
-
|
|
177067
|
+
logger247.warn(
|
|
176767
177068
|
"Failed to patch LevelControl TLV schemas, field definitions not found. Google Home brightness adjustment may not work.",
|
|
176768
177069
|
{
|
|
176769
177070
|
moveToLevel: describeFields(
|