@riddix/hamh 2.1.0-alpha.471 → 2.1.0-alpha.473
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
|
@@ -1743,8 +1743,8 @@ var init_Cancelable = __esm({
|
|
|
1743
1743
|
};
|
|
1744
1744
|
return result;
|
|
1745
1745
|
}
|
|
1746
|
-
static set logger(
|
|
1747
|
-
this.#logger =
|
|
1746
|
+
static set logger(logger197) {
|
|
1747
|
+
this.#logger = logger197;
|
|
1748
1748
|
}
|
|
1749
1749
|
static get logger() {
|
|
1750
1750
|
return this.#logger;
|
|
@@ -3422,13 +3422,13 @@ var init_Logger = __esm({
|
|
|
3422
3422
|
*
|
|
3423
3423
|
* @deprecated use {@link destinations}
|
|
3424
3424
|
*/
|
|
3425
|
-
static addLogger(identifier,
|
|
3425
|
+
static addLogger(identifier, logger197, options) {
|
|
3426
3426
|
if (identifier in this.destinations) {
|
|
3427
3427
|
throw new ImplementationError(`Logger "${identifier}" already exists`);
|
|
3428
3428
|
}
|
|
3429
3429
|
const dest = LogDestination({ name: identifier });
|
|
3430
3430
|
const legacy = adaptDestinationToLegacy(dest);
|
|
3431
|
-
legacy.log =
|
|
3431
|
+
legacy.log = logger197;
|
|
3432
3432
|
if (options?.defaultLogLevel !== void 0) {
|
|
3433
3433
|
legacy.defaultLogLevel = options.defaultLogLevel;
|
|
3434
3434
|
}
|
|
@@ -5538,8 +5538,8 @@ function Construction(subject, initializer) {
|
|
|
5538
5538
|
}
|
|
5539
5539
|
}
|
|
5540
5540
|
function unhandledError(...args) {
|
|
5541
|
-
const
|
|
5542
|
-
|
|
5541
|
+
const logger197 = Logger.get(subject.constructor.name);
|
|
5542
|
+
logger197.error(...args);
|
|
5543
5543
|
}
|
|
5544
5544
|
function createErrorHandler(name) {
|
|
5545
5545
|
return (e) => {
|
|
@@ -135998,11 +135998,11 @@ var init_Api = __esm({
|
|
|
135998
135998
|
}
|
|
135999
135999
|
Api2.resourceFor = resourceFor;
|
|
136000
136000
|
function log(level, facility, id, ...message) {
|
|
136001
|
-
let
|
|
136002
|
-
if (!
|
|
136003
|
-
loggers.set(facility,
|
|
136001
|
+
let logger197 = loggers.get(facility);
|
|
136002
|
+
if (!logger197) {
|
|
136003
|
+
loggers.set(facility, logger197 = Logger.get(facility));
|
|
136004
136004
|
}
|
|
136005
|
-
|
|
136005
|
+
logger197[level](Diagnostic.via(id || "(anon)"), message);
|
|
136006
136006
|
}
|
|
136007
136007
|
Api2.log = log;
|
|
136008
136008
|
function logRequest(facility, id, method, target) {
|
|
@@ -147233,10 +147233,10 @@ var init_home_assistant_actions = __esm({
|
|
|
147233
147233
|
circuitBreakerResetMs: 3e4
|
|
147234
147234
|
};
|
|
147235
147235
|
HomeAssistantActions = class extends Service {
|
|
147236
|
-
constructor(
|
|
147236
|
+
constructor(logger197, client, config10) {
|
|
147237
147237
|
super("HomeAssistantActions");
|
|
147238
147238
|
this.client = client;
|
|
147239
|
-
this.log =
|
|
147239
|
+
this.log = logger197.get(this);
|
|
147240
147240
|
this.config = { ...defaultConfig, ...config10 };
|
|
147241
147241
|
this.circuitBreaker = new CircuitBreaker(
|
|
147242
147242
|
this.config.circuitBreakerThreshold,
|
|
@@ -147608,10 +147608,10 @@ var DiagnosticService = class {
|
|
|
147608
147608
|
};
|
|
147609
147609
|
|
|
147610
147610
|
// src/api/access-log.ts
|
|
147611
|
-
function accessLogger(
|
|
147611
|
+
function accessLogger(logger197) {
|
|
147612
147612
|
return (req, res, next) => {
|
|
147613
147613
|
res.on("finish", () => {
|
|
147614
|
-
|
|
147614
|
+
logger197.debug(
|
|
147615
147615
|
`${req.method} ${decodeURI(req.originalUrl)} ${res.statusCode} ${res.statusMessage} from ${req.socket.remoteAddress}`
|
|
147616
147616
|
);
|
|
147617
147617
|
});
|
|
@@ -150318,7 +150318,7 @@ var WebSocketApi = class {
|
|
|
150318
150318
|
|
|
150319
150319
|
// src/api/web-api.ts
|
|
150320
150320
|
var WebApi = class extends Service {
|
|
150321
|
-
constructor(
|
|
150321
|
+
constructor(logger197, bridgeService, haClient, haRegistry, bridgeStorage, mappingStorage, lockCredentialStorage, settingsStorage, props) {
|
|
150322
150322
|
super("WebApi");
|
|
150323
150323
|
this.bridgeService = bridgeService;
|
|
150324
150324
|
this.haClient = haClient;
|
|
@@ -150328,8 +150328,8 @@ var WebApi = class extends Service {
|
|
|
150328
150328
|
this.lockCredentialStorage = lockCredentialStorage;
|
|
150329
150329
|
this.settingsStorage = settingsStorage;
|
|
150330
150330
|
this.props = props;
|
|
150331
|
-
this.logger =
|
|
150332
|
-
this.log =
|
|
150331
|
+
this.logger = logger197;
|
|
150332
|
+
this.log = logger197.get(this);
|
|
150333
150333
|
this.accessLogger = accessLogger(this.log.createChild("Access Log"));
|
|
150334
150334
|
this.startTime = Date.now();
|
|
150335
150335
|
this.wsApi = new WebSocketApi(
|
|
@@ -150762,12 +150762,12 @@ var CustomStorage = class extends StorageBackendDisk {
|
|
|
150762
150762
|
|
|
150763
150763
|
// src/core/app/storage.ts
|
|
150764
150764
|
function storage(environment, options) {
|
|
150765
|
-
const
|
|
150765
|
+
const logger197 = environment.get(LoggerService).get("CustomStorage");
|
|
150766
150766
|
const location2 = resolveStorageLocation(options.location);
|
|
150767
150767
|
fs6.mkdirSync(location2, { recursive: true });
|
|
150768
150768
|
const storageService = environment.get(StorageService);
|
|
150769
150769
|
storageService.location = location2;
|
|
150770
|
-
storageService.factory = (ns) => new CustomStorage(
|
|
150770
|
+
storageService.factory = (ns) => new CustomStorage(logger197, path6.resolve(location2, ns));
|
|
150771
150771
|
}
|
|
150772
150772
|
function resolveStorageLocation(storageLocation) {
|
|
150773
150773
|
const homedir = os3.homedir();
|
|
@@ -151121,10 +151121,10 @@ import {
|
|
|
151121
151121
|
getConfig
|
|
151122
151122
|
} from "home-assistant-js-websocket";
|
|
151123
151123
|
var HomeAssistantClient = class extends Service {
|
|
151124
|
-
constructor(
|
|
151124
|
+
constructor(logger197, options) {
|
|
151125
151125
|
super("HomeAssistantClient");
|
|
151126
151126
|
this.options = options;
|
|
151127
|
-
this.log =
|
|
151127
|
+
this.log = logger197.get(this);
|
|
151128
151128
|
}
|
|
151129
151129
|
static Options = /* @__PURE__ */ Symbol.for("HomeAssistantClientProps");
|
|
151130
151130
|
_connection;
|
|
@@ -164374,10 +164374,10 @@ function ensureCommissioningConfig(server) {
|
|
|
164374
164374
|
// src/services/bridges/bridge.ts
|
|
164375
164375
|
var AUTO_FORCE_SYNC_INTERVAL_MS = 9e4;
|
|
164376
164376
|
var Bridge = class {
|
|
164377
|
-
constructor(env,
|
|
164377
|
+
constructor(env, logger197, dataProvider, endpointManager) {
|
|
164378
164378
|
this.dataProvider = dataProvider;
|
|
164379
164379
|
this.endpointManager = endpointManager;
|
|
164380
|
-
this.log =
|
|
164380
|
+
this.log = logger197.get(`Bridge / ${dataProvider.id}`);
|
|
164381
164381
|
this.server = new BridgeServerNode(
|
|
164382
164382
|
env,
|
|
164383
164383
|
this.dataProvider,
|
|
@@ -166798,25 +166798,35 @@ var FanOnOffServer = OnOffServer2({
|
|
|
166798
166798
|
|
|
166799
166799
|
// src/matter/endpoints/composed/composed-air-purifier-endpoint.ts
|
|
166800
166800
|
var logger162 = Logger.get("ComposedAirPurifierEndpoint");
|
|
166801
|
-
|
|
166802
|
-
|
|
166803
|
-
|
|
166804
|
-
|
|
166805
|
-
|
|
166806
|
-
|
|
166807
|
-
|
|
166808
|
-
|
|
166809
|
-
|
|
166810
|
-
|
|
166811
|
-
|
|
166812
|
-
|
|
166813
|
-
|
|
166814
|
-
|
|
166815
|
-
|
|
166816
|
-
|
|
166817
|
-
|
|
166818
|
-
|
|
166819
|
-
|
|
166801
|
+
function createTemperatureConfig(temperatureEntityId) {
|
|
166802
|
+
return {
|
|
166803
|
+
getValue(_entity, agent) {
|
|
166804
|
+
const stateProvider = agent.env.get(EntityStateProvider);
|
|
166805
|
+
const tempState = stateProvider.getState(temperatureEntityId);
|
|
166806
|
+
if (!tempState) return void 0;
|
|
166807
|
+
const temperature3 = Number.parseFloat(tempState.state);
|
|
166808
|
+
if (Number.isNaN(temperature3)) return void 0;
|
|
166809
|
+
const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
|
|
166810
|
+
const attrs = tempState.attributes;
|
|
166811
|
+
return Temperature.withUnit(
|
|
166812
|
+
temperature3,
|
|
166813
|
+
attrs.unit_of_measurement ?? fallbackUnit
|
|
166814
|
+
);
|
|
166815
|
+
}
|
|
166816
|
+
};
|
|
166817
|
+
}
|
|
166818
|
+
function createHumidityConfig(humidityEntityId) {
|
|
166819
|
+
return {
|
|
166820
|
+
getValue(_entity, agent) {
|
|
166821
|
+
const stateProvider = agent.env.get(EntityStateProvider);
|
|
166822
|
+
const humState = stateProvider.getState(humidityEntityId);
|
|
166823
|
+
if (!humState) return null;
|
|
166824
|
+
const humidity = Number.parseFloat(humState.state);
|
|
166825
|
+
if (Number.isNaN(humidity)) return null;
|
|
166826
|
+
return humidity;
|
|
166827
|
+
}
|
|
166828
|
+
};
|
|
166829
|
+
}
|
|
166820
166830
|
var batteryConfig = {
|
|
166821
166831
|
getBatteryPercent: (_entity, agent) => {
|
|
166822
166832
|
const homeAssistant = agent.get(HomeAssistantEntityBehavior);
|
|
@@ -166829,16 +166839,6 @@ var batteryConfig = {
|
|
|
166829
166839
|
return null;
|
|
166830
166840
|
}
|
|
166831
166841
|
};
|
|
166832
|
-
var TemperatureSubType = TemperatureSensorDevice.with(
|
|
166833
|
-
IdentifyServer2,
|
|
166834
|
-
HomeAssistantEntityBehavior,
|
|
166835
|
-
TemperatureMeasurementServer2(temperatureConfig)
|
|
166836
|
-
);
|
|
166837
|
-
var HumiditySubType = HumiditySensorDevice.with(
|
|
166838
|
-
IdentifyServer2,
|
|
166839
|
-
HomeAssistantEntityBehavior,
|
|
166840
|
-
HumidityMeasurementServer(humidityConfig)
|
|
166841
|
-
);
|
|
166842
166842
|
function createEndpointId2(entityId, customName) {
|
|
166843
166843
|
const baseName = customName || entityId;
|
|
166844
166844
|
return baseName.replace(/\./g, "_").replace(/\s+/g, "_");
|
|
@@ -166858,9 +166858,9 @@ function buildEntityPayload(registry2, entityId) {
|
|
|
166858
166858
|
var ComposedAirPurifierEndpoint = class _ComposedAirPurifierEndpoint extends Endpoint {
|
|
166859
166859
|
entityId;
|
|
166860
166860
|
mappedEntityIds;
|
|
166861
|
-
|
|
166861
|
+
trackedEntityIds;
|
|
166862
166862
|
lastStates = /* @__PURE__ */ new Map();
|
|
166863
|
-
|
|
166863
|
+
debouncedFlush;
|
|
166864
166864
|
static async create(config10) {
|
|
166865
166865
|
const { registry: registry2, primaryEntityId } = config10;
|
|
166866
166866
|
const primaryPayload = buildEntityPayload(registry2, primaryEntityId);
|
|
@@ -166899,6 +166899,20 @@ var ComposedAirPurifierEndpoint = class _ComposedAirPurifierEndpoint extends End
|
|
|
166899
166899
|
if (hasFilterLife) {
|
|
166900
166900
|
parentType = parentType.with(AirPurifierHepaFilterMonitoringServer);
|
|
166901
166901
|
}
|
|
166902
|
+
if (config10.temperatureEntityId) {
|
|
166903
|
+
parentType = parentType.with(
|
|
166904
|
+
TemperatureMeasurementServer2(
|
|
166905
|
+
createTemperatureConfig(config10.temperatureEntityId)
|
|
166906
|
+
)
|
|
166907
|
+
);
|
|
166908
|
+
}
|
|
166909
|
+
if (config10.humidityEntityId) {
|
|
166910
|
+
parentType = parentType.with(
|
|
166911
|
+
HumidityMeasurementServer(
|
|
166912
|
+
createHumidityConfig(config10.humidityEntityId)
|
|
166913
|
+
)
|
|
166914
|
+
);
|
|
166915
|
+
}
|
|
166902
166916
|
const mapping = {
|
|
166903
166917
|
entityId: primaryEntityId,
|
|
166904
166918
|
...config10.batteryEntityId ? { batteryEntity: config10.batteryEntityId } : {},
|
|
@@ -166916,37 +166930,6 @@ var ComposedAirPurifierEndpoint = class _ComposedAirPurifierEndpoint extends End
|
|
|
166916
166930
|
);
|
|
166917
166931
|
}
|
|
166918
166932
|
const endpointId = createEndpointId2(primaryEntityId, config10.customName);
|
|
166919
|
-
const parts = [];
|
|
166920
|
-
const subEndpointMap = /* @__PURE__ */ new Map();
|
|
166921
|
-
if (config10.temperatureEntityId) {
|
|
166922
|
-
const tempPayload = buildEntityPayload(
|
|
166923
|
-
registry2,
|
|
166924
|
-
config10.temperatureEntityId
|
|
166925
|
-
);
|
|
166926
|
-
if (tempPayload) {
|
|
166927
|
-
const tempSub = new Endpoint(
|
|
166928
|
-
TemperatureSubType.set({
|
|
166929
|
-
homeAssistantEntity: { entity: tempPayload }
|
|
166930
|
-
}),
|
|
166931
|
-
{ id: `${endpointId}_temp` }
|
|
166932
|
-
);
|
|
166933
|
-
parts.push(tempSub);
|
|
166934
|
-
subEndpointMap.set(config10.temperatureEntityId, tempSub);
|
|
166935
|
-
}
|
|
166936
|
-
}
|
|
166937
|
-
if (config10.humidityEntityId) {
|
|
166938
|
-
const humPayload = buildEntityPayload(registry2, config10.humidityEntityId);
|
|
166939
|
-
if (humPayload) {
|
|
166940
|
-
const humSub = new Endpoint(
|
|
166941
|
-
HumiditySubType.set({
|
|
166942
|
-
homeAssistantEntity: { entity: humPayload }
|
|
166943
|
-
}),
|
|
166944
|
-
{ id: `${endpointId}_humidity` }
|
|
166945
|
-
);
|
|
166946
|
-
parts.push(humSub);
|
|
166947
|
-
subEndpointMap.set(config10.humidityEntityId, humSub);
|
|
166948
|
-
}
|
|
166949
|
-
}
|
|
166950
166933
|
const parentTypeWithState = parentType.set({
|
|
166951
166934
|
homeAssistantEntity: {
|
|
166952
166935
|
entity: primaryPayload,
|
|
@@ -166954,14 +166937,17 @@ var ComposedAirPurifierEndpoint = class _ComposedAirPurifierEndpoint extends End
|
|
|
166954
166937
|
mapping
|
|
166955
166938
|
}
|
|
166956
166939
|
});
|
|
166957
|
-
const
|
|
166940
|
+
const trackedEntityIds = [primaryEntityId];
|
|
166941
|
+
if (config10.temperatureEntityId)
|
|
166942
|
+
trackedEntityIds.push(config10.temperatureEntityId);
|
|
166943
|
+
if (config10.humidityEntityId) trackedEntityIds.push(config10.humidityEntityId);
|
|
166944
|
+
const mappedIds = trackedEntityIds.filter((id) => id !== primaryEntityId);
|
|
166958
166945
|
const endpoint = new _ComposedAirPurifierEndpoint(
|
|
166959
166946
|
parentTypeWithState,
|
|
166960
166947
|
primaryEntityId,
|
|
166961
166948
|
endpointId,
|
|
166962
|
-
|
|
166963
|
-
mappedIds
|
|
166964
|
-
subEndpointMap
|
|
166949
|
+
trackedEntityIds,
|
|
166950
|
+
mappedIds
|
|
166965
166951
|
);
|
|
166966
166952
|
const clusterLabels = [
|
|
166967
166953
|
"AirPurifier",
|
|
@@ -166972,47 +166958,46 @@ var ComposedAirPurifierEndpoint = class _ComposedAirPurifierEndpoint extends End
|
|
|
166972
166958
|
logger162.info(`Created air purifier ${primaryEntityId}: ${clusterLabels}`);
|
|
166973
166959
|
return endpoint;
|
|
166974
166960
|
}
|
|
166975
|
-
constructor(type, entityId, id,
|
|
166976
|
-
super(type, { id
|
|
166961
|
+
constructor(type, entityId, id, trackedEntityIds, mappedEntityIds) {
|
|
166962
|
+
super(type, { id });
|
|
166977
166963
|
this.entityId = entityId;
|
|
166964
|
+
this.trackedEntityIds = trackedEntityIds;
|
|
166978
166965
|
this.mappedEntityIds = mappedEntityIds;
|
|
166979
|
-
this.subEndpoints = subEndpoints;
|
|
166980
166966
|
}
|
|
166981
166967
|
async updateStates(states) {
|
|
166982
|
-
|
|
166983
|
-
for (const
|
|
166984
|
-
|
|
166968
|
+
let anyChanged = false;
|
|
166969
|
+
for (const entityId of this.trackedEntityIds) {
|
|
166970
|
+
const state = states[entityId];
|
|
166971
|
+
if (!state) continue;
|
|
166972
|
+
const stateJson = JSON.stringify({
|
|
166973
|
+
s: state.state,
|
|
166974
|
+
a: state.attributes
|
|
166975
|
+
});
|
|
166976
|
+
if (this.lastStates.get(entityId) !== stateJson) {
|
|
166977
|
+
this.lastStates.set(entityId, stateJson);
|
|
166978
|
+
anyChanged = true;
|
|
166979
|
+
}
|
|
166985
166980
|
}
|
|
166986
|
-
|
|
166987
|
-
|
|
166988
|
-
|
|
166989
|
-
if (!
|
|
166990
|
-
|
|
166991
|
-
|
|
166992
|
-
s: state.state,
|
|
166993
|
-
a: state.attributes
|
|
166994
|
-
});
|
|
166995
|
-
if (this.lastStates.get(key) === stateJson) return;
|
|
166996
|
-
this.lastStates.set(key, stateJson);
|
|
166997
|
-
let debouncedFn = this.debouncedUpdates.get(key);
|
|
166998
|
-
if (!debouncedFn) {
|
|
166999
|
-
debouncedFn = debounce2(
|
|
167000
|
-
(ep, s) => this.flushUpdate(ep, s),
|
|
166981
|
+
if (!anyChanged) return;
|
|
166982
|
+
const primaryState = states[this.entityId];
|
|
166983
|
+
if (!primaryState) return;
|
|
166984
|
+
if (!this.debouncedFlush) {
|
|
166985
|
+
this.debouncedFlush = debounce2(
|
|
166986
|
+
(s) => this.flushUpdate(s),
|
|
167001
166987
|
50
|
|
167002
166988
|
);
|
|
167003
|
-
this.debouncedUpdates.set(key, debouncedFn);
|
|
167004
166989
|
}
|
|
167005
|
-
|
|
166990
|
+
this.debouncedFlush(primaryState);
|
|
167006
166991
|
}
|
|
167007
|
-
async flushUpdate(
|
|
166992
|
+
async flushUpdate(state) {
|
|
167008
166993
|
try {
|
|
167009
|
-
await
|
|
166994
|
+
await this.construction.ready;
|
|
167010
166995
|
} catch {
|
|
167011
166996
|
return;
|
|
167012
166997
|
}
|
|
167013
166998
|
try {
|
|
167014
|
-
const current =
|
|
167015
|
-
await
|
|
166999
|
+
const current = this.stateOf(HomeAssistantEntityBehavior).entity;
|
|
167000
|
+
await this.setStateOf(HomeAssistantEntityBehavior, {
|
|
167016
167001
|
entity: { ...current, state: { ...state } }
|
|
167017
167002
|
});
|
|
167018
167003
|
} catch (error) {
|
|
@@ -167029,9 +167014,7 @@ var ComposedAirPurifierEndpoint = class _ComposedAirPurifierEndpoint extends End
|
|
|
167029
167014
|
}
|
|
167030
167015
|
}
|
|
167031
167016
|
async delete() {
|
|
167032
|
-
|
|
167033
|
-
fn.clear();
|
|
167034
|
-
}
|
|
167017
|
+
this.debouncedFlush?.clear();
|
|
167035
167018
|
await super.delete();
|
|
167036
167019
|
}
|
|
167037
167020
|
};
|
|
@@ -167116,7 +167099,7 @@ function PressureMeasurementServer2(config10) {
|
|
|
167116
167099
|
|
|
167117
167100
|
// src/matter/endpoints/composed/composed-sensor-endpoint.ts
|
|
167118
167101
|
var logger164 = Logger.get("ComposedSensorEndpoint");
|
|
167119
|
-
var
|
|
167102
|
+
var temperatureConfig = {
|
|
167120
167103
|
getValue(entity, agent) {
|
|
167121
167104
|
const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
|
|
167122
167105
|
const state = entity.state;
|
|
@@ -167129,7 +167112,7 @@ var temperatureConfig2 = {
|
|
|
167129
167112
|
);
|
|
167130
167113
|
}
|
|
167131
167114
|
};
|
|
167132
|
-
var
|
|
167115
|
+
var humidityConfig = {
|
|
167133
167116
|
getValue({ state }) {
|
|
167134
167117
|
if (state == null || Number.isNaN(+state)) return null;
|
|
167135
167118
|
return +state;
|
|
@@ -167156,15 +167139,15 @@ var batteryConfig2 = {
|
|
|
167156
167139
|
return null;
|
|
167157
167140
|
}
|
|
167158
167141
|
};
|
|
167159
|
-
var
|
|
167142
|
+
var TemperatureSubType = TemperatureSensorDevice.with(
|
|
167160
167143
|
IdentifyServer2,
|
|
167161
167144
|
HomeAssistantEntityBehavior,
|
|
167162
|
-
TemperatureMeasurementServer2(
|
|
167145
|
+
TemperatureMeasurementServer2(temperatureConfig)
|
|
167163
167146
|
);
|
|
167164
|
-
var
|
|
167147
|
+
var HumiditySubType = HumiditySensorDevice.with(
|
|
167165
167148
|
IdentifyServer2,
|
|
167166
167149
|
HomeAssistantEntityBehavior,
|
|
167167
|
-
HumidityMeasurementServer(
|
|
167150
|
+
HumidityMeasurementServer(humidityConfig)
|
|
167168
167151
|
);
|
|
167169
167152
|
var PressureSubType = PressureSensorDevice.with(
|
|
167170
167153
|
IdentifyServer2,
|
|
@@ -167220,7 +167203,7 @@ var ComposedSensorEndpoint = class _ComposedSensorEndpoint extends Endpoint {
|
|
|
167220
167203
|
const endpointId = createEndpointId3(primaryEntityId, config10.customName);
|
|
167221
167204
|
const parts = [];
|
|
167222
167205
|
const tempSub = new Endpoint(
|
|
167223
|
-
|
|
167206
|
+
TemperatureSubType.set({
|
|
167224
167207
|
homeAssistantEntity: { entity: primaryPayload }
|
|
167225
167208
|
}),
|
|
167226
167209
|
{ id: `${endpointId}_temp` }
|
|
@@ -167231,7 +167214,7 @@ var ComposedSensorEndpoint = class _ComposedSensorEndpoint extends Endpoint {
|
|
|
167231
167214
|
const humPayload = buildEntityPayload2(registry2, config10.humidityEntityId);
|
|
167232
167215
|
if (humPayload) {
|
|
167233
167216
|
humSub = new Endpoint(
|
|
167234
|
-
|
|
167217
|
+
HumiditySubType.set({
|
|
167235
167218
|
homeAssistantEntity: { entity: humPayload }
|
|
167236
167219
|
}),
|
|
167237
167220
|
{ id: `${endpointId}_humidity` }
|
|
@@ -167347,6 +167330,57 @@ var ComposedSensorEndpoint = class _ComposedSensorEndpoint extends Endpoint {
|
|
|
167347
167330
|
}
|
|
167348
167331
|
};
|
|
167349
167332
|
|
|
167333
|
+
// src/matter/endpoints/validate-endpoint-type.ts
|
|
167334
|
+
init_esm();
|
|
167335
|
+
init_esm7();
|
|
167336
|
+
var logger165 = Logger.get("EndpointValidation");
|
|
167337
|
+
function toCamelCase(name) {
|
|
167338
|
+
return name.charAt(0).toLowerCase() + name.slice(1);
|
|
167339
|
+
}
|
|
167340
|
+
function validateEndpointType(endpointType, entityId) {
|
|
167341
|
+
const deviceTypeModel = Matter.deviceTypes.find(
|
|
167342
|
+
(dt) => dt.id === endpointType.deviceType
|
|
167343
|
+
);
|
|
167344
|
+
if (!deviceTypeModel) {
|
|
167345
|
+
return void 0;
|
|
167346
|
+
}
|
|
167347
|
+
const serverClusterReqs = deviceTypeModel.requirements.filter(
|
|
167348
|
+
(r) => r.element === "serverCluster"
|
|
167349
|
+
);
|
|
167350
|
+
const behaviorKeys = new Set(Object.keys(endpointType.behaviors));
|
|
167351
|
+
const missingMandatory = [];
|
|
167352
|
+
const availableOptional = [];
|
|
167353
|
+
const presentClusters = [];
|
|
167354
|
+
for (const req of serverClusterReqs) {
|
|
167355
|
+
const key = toCamelCase(req.name);
|
|
167356
|
+
if (behaviorKeys.has(key)) {
|
|
167357
|
+
presentClusters.push(req.name);
|
|
167358
|
+
} else if (req.isMandatory) {
|
|
167359
|
+
missingMandatory.push(req.name);
|
|
167360
|
+
} else {
|
|
167361
|
+
availableOptional.push(req.name);
|
|
167362
|
+
}
|
|
167363
|
+
}
|
|
167364
|
+
const prefix = entityId ? `[${entityId}] ` : "";
|
|
167365
|
+
if (missingMandatory.length > 0) {
|
|
167366
|
+
logger165.warn(
|
|
167367
|
+
`${prefix}${deviceTypeModel.name} (0x${endpointType.deviceType.toString(16)}): missing mandatory clusters: ${missingMandatory.join(", ")}`
|
|
167368
|
+
);
|
|
167369
|
+
}
|
|
167370
|
+
if (availableOptional.length > 0) {
|
|
167371
|
+
logger165.debug(
|
|
167372
|
+
`${prefix}${deviceTypeModel.name} (0x${endpointType.deviceType.toString(16)}): optional clusters not used: ${availableOptional.join(", ")}`
|
|
167373
|
+
);
|
|
167374
|
+
}
|
|
167375
|
+
return {
|
|
167376
|
+
deviceTypeName: deviceTypeModel.name,
|
|
167377
|
+
deviceTypeId: endpointType.deviceType,
|
|
167378
|
+
missingMandatory,
|
|
167379
|
+
availableOptional,
|
|
167380
|
+
presentClusters
|
|
167381
|
+
};
|
|
167382
|
+
}
|
|
167383
|
+
|
|
167350
167384
|
// src/matter/endpoints/legacy/air-purifier/index.ts
|
|
167351
167385
|
init_dist();
|
|
167352
167386
|
init_home_assistant_entity_behavior();
|
|
@@ -167406,7 +167440,7 @@ init_home_assistant_entity_behavior();
|
|
|
167406
167440
|
// src/matter/behaviors/mode-select-server.ts
|
|
167407
167441
|
init_esm();
|
|
167408
167442
|
init_home_assistant_entity_behavior();
|
|
167409
|
-
var
|
|
167443
|
+
var logger166 = Logger.get("ModeSelectServer");
|
|
167410
167444
|
var ModeSelectServerBase = class extends ModeSelectServer {
|
|
167411
167445
|
async initialize() {
|
|
167412
167446
|
await super.initialize();
|
|
@@ -167435,13 +167469,13 @@ var ModeSelectServerBase = class extends ModeSelectServer {
|
|
|
167435
167469
|
const options = config10.getOptions(homeAssistant.entity);
|
|
167436
167470
|
const { newMode } = request;
|
|
167437
167471
|
if (newMode < 0 || newMode >= options.length) {
|
|
167438
|
-
|
|
167472
|
+
logger166.warn(
|
|
167439
167473
|
`[${homeAssistant.entityId}] Invalid mode ${newMode}, options: [${options.join(", ")}]`
|
|
167440
167474
|
);
|
|
167441
167475
|
return;
|
|
167442
167476
|
}
|
|
167443
167477
|
const option = options[newMode];
|
|
167444
|
-
|
|
167478
|
+
logger166.info(
|
|
167445
167479
|
`[${homeAssistant.entityId}] changeToMode(${newMode}) -> "${option}"`
|
|
167446
167480
|
);
|
|
167447
167481
|
applyPatchState(this.state, { currentMode: newMode });
|
|
@@ -167886,7 +167920,7 @@ var WaterLeakDetectorType = WaterLeakDetectorDevice.with(
|
|
|
167886
167920
|
);
|
|
167887
167921
|
|
|
167888
167922
|
// src/matter/endpoints/legacy/binary-sensor/index.ts
|
|
167889
|
-
var
|
|
167923
|
+
var logger167 = Logger.get("BinarySensorDevice");
|
|
167890
167924
|
var deviceClasses = {
|
|
167891
167925
|
[BinarySensorDeviceClass.CarbonMonoxide]: CoAlarmType,
|
|
167892
167926
|
[BinarySensorDeviceClass.Gas]: CoAlarmType,
|
|
@@ -167936,11 +167970,11 @@ function BinarySensorDevice(homeAssistantEntity) {
|
|
|
167936
167970
|
const originalTypeName = type.name;
|
|
167937
167971
|
if (hasBattery && batteryTypes.has(type)) {
|
|
167938
167972
|
type = batteryTypes.get(type);
|
|
167939
|
-
|
|
167973
|
+
logger167.info(
|
|
167940
167974
|
`[${entityId}] Using battery variant: ${originalTypeName} -> ${type.name}, batteryAttr=${hasBatteryAttr}, batteryEntity=${homeAssistantEntity.mapping?.batteryEntity ?? "none"}`
|
|
167941
167975
|
);
|
|
167942
167976
|
} else if (hasBattery) {
|
|
167943
|
-
|
|
167977
|
+
logger167.warn(
|
|
167944
167978
|
`[${entityId}] Has battery but no variant available for ${originalTypeName}`
|
|
167945
167979
|
);
|
|
167946
167980
|
}
|
|
@@ -168071,7 +168105,7 @@ var ClimateFanControlServer = FanControlServer2(config3).with(
|
|
|
168071
168105
|
);
|
|
168072
168106
|
|
|
168073
168107
|
// src/matter/endpoints/legacy/climate/behaviors/climate-humidity-measurement-server.ts
|
|
168074
|
-
var
|
|
168108
|
+
var humidityConfig2 = {
|
|
168075
168109
|
getValue(entity) {
|
|
168076
168110
|
const attributes7 = entity.attributes;
|
|
168077
168111
|
const humidity = attributes7.current_humidity;
|
|
@@ -168081,7 +168115,7 @@ var humidityConfig3 = {
|
|
|
168081
168115
|
return +humidity;
|
|
168082
168116
|
}
|
|
168083
168117
|
};
|
|
168084
|
-
var ClimateHumidityMeasurementServer = HumidityMeasurementServer(
|
|
168118
|
+
var ClimateHumidityMeasurementServer = HumidityMeasurementServer(humidityConfig2);
|
|
168085
168119
|
|
|
168086
168120
|
// src/matter/endpoints/legacy/climate/behaviors/climate-on-off-server.ts
|
|
168087
168121
|
var ClimateOnOffServer = OnOffServer2({
|
|
@@ -168096,7 +168130,7 @@ init_home_assistant_entity_behavior();
|
|
|
168096
168130
|
// src/matter/behaviors/thermostat-server.ts
|
|
168097
168131
|
init_esm();
|
|
168098
168132
|
init_home_assistant_entity_behavior();
|
|
168099
|
-
var
|
|
168133
|
+
var logger168 = Logger.get("ThermostatServer");
|
|
168100
168134
|
var SystemMode = Thermostat3.SystemMode;
|
|
168101
168135
|
var RunningMode = Thermostat3.ThermostatRunningMode;
|
|
168102
168136
|
var nudgingSetpoints = /* @__PURE__ */ new Set();
|
|
@@ -168154,7 +168188,7 @@ var HeatingAndCoolingFeaturedBase = ThermostatServer.with("Heating", "Cooling").
|
|
|
168154
168188
|
);
|
|
168155
168189
|
function thermostatPreInitialize(self) {
|
|
168156
168190
|
const currentLocal = self.state.localTemperature;
|
|
168157
|
-
|
|
168191
|
+
logger168.debug(
|
|
168158
168192
|
`initialize: features - heating=${self.features.heating}, cooling=${self.features.cooling}`
|
|
168159
168193
|
);
|
|
168160
168194
|
const localValue = typeof currentLocal === "number" && !Number.isNaN(currentLocal) ? currentLocal : currentLocal === null ? null : 2100;
|
|
@@ -168177,7 +168211,7 @@ function thermostatPreInitialize(self) {
|
|
|
168177
168211
|
const coolingValue = typeof currentCooling === "number" && !Number.isNaN(currentCooling) ? currentCooling : 2400;
|
|
168178
168212
|
self.state.occupiedCoolingSetpoint = coolingValue;
|
|
168179
168213
|
}
|
|
168180
|
-
|
|
168214
|
+
logger168.debug(
|
|
168181
168215
|
`initialize: after force-set - local=${self.state.localTemperature}`
|
|
168182
168216
|
);
|
|
168183
168217
|
self.state.thermostatRunningState = runningStateAllOff;
|
|
@@ -168259,7 +168293,7 @@ var ThermostatServerBase = class extends FullFeaturedBase {
|
|
|
168259
168293
|
maxCoolLimit,
|
|
168260
168294
|
"cool"
|
|
168261
168295
|
);
|
|
168262
|
-
|
|
168296
|
+
logger168.debug(
|
|
168263
168297
|
`update: limits heat=[${minHeatLimit}, ${maxHeatLimit}], cool=[${minCoolLimit}, ${maxCoolLimit}], systemMode=${systemMode}, runningMode=${runningMode}`
|
|
168264
168298
|
);
|
|
168265
168299
|
const controlSequence = config10.getControlSequence(entity.state, this.agent);
|
|
@@ -168331,18 +168365,18 @@ var ThermostatServerBase = class extends FullFeaturedBase {
|
|
|
168331
168365
|
*/
|
|
168332
168366
|
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: Called via thermostatPostInitialize + prototype copy
|
|
168333
168367
|
heatingSetpointChanging(value, _oldValue, context) {
|
|
168334
|
-
|
|
168368
|
+
logger168.debug(
|
|
168335
168369
|
`heatingSetpointChanging: value=${value}, oldValue=${_oldValue}, isOffline=${transactionIsOffline(context)}`
|
|
168336
168370
|
);
|
|
168337
168371
|
if (transactionIsOffline(context)) {
|
|
168338
|
-
|
|
168372
|
+
logger168.debug(
|
|
168339
168373
|
"heatingSetpointChanging: skipping - transaction is offline"
|
|
168340
168374
|
);
|
|
168341
168375
|
return;
|
|
168342
168376
|
}
|
|
168343
168377
|
const next = Temperature.celsius(value / 100);
|
|
168344
168378
|
if (!next) {
|
|
168345
|
-
|
|
168379
|
+
logger168.debug("heatingSetpointChanging: skipping - invalid temperature");
|
|
168346
168380
|
return;
|
|
168347
168381
|
}
|
|
168348
168382
|
this.agent.asLocalActor(() => {
|
|
@@ -168353,7 +168387,7 @@ var ThermostatServerBase = class extends FullFeaturedBase {
|
|
|
168353
168387
|
this.agent
|
|
168354
168388
|
);
|
|
168355
168389
|
const currentMode = this.state.systemMode;
|
|
168356
|
-
|
|
168390
|
+
logger168.debug(
|
|
168357
168391
|
`heatingSetpointChanging: supportsRange=${supportsRange}, systemMode=${currentMode}, features.heating=${this.features.heating}, features.cooling=${this.features.cooling}`
|
|
168358
168392
|
);
|
|
168359
168393
|
if (!supportsRange) {
|
|
@@ -168363,12 +168397,12 @@ var ThermostatServerBase = class extends FullFeaturedBase {
|
|
|
168363
168397
|
const isOff = currentMode === Thermostat3.SystemMode.Off;
|
|
168364
168398
|
if (isOff && this.features.heating) {
|
|
168365
168399
|
if (nudgingSetpoints.has(homeAssistant.entityId)) {
|
|
168366
|
-
|
|
168400
|
+
logger168.debug(
|
|
168367
168401
|
`heatingSetpointChanging: skipping auto-resume - nudge write in progress`
|
|
168368
168402
|
);
|
|
168369
168403
|
return;
|
|
168370
168404
|
}
|
|
168371
|
-
|
|
168405
|
+
logger168.info(
|
|
168372
168406
|
`heatingSetpointChanging: auto-resume - switching to Heat (was Off)`
|
|
168373
168407
|
);
|
|
168374
168408
|
const modeAction = config10.setSystemMode(
|
|
@@ -168377,17 +168411,17 @@ var ThermostatServerBase = class extends FullFeaturedBase {
|
|
|
168377
168411
|
);
|
|
168378
168412
|
homeAssistant.callAction(modeAction);
|
|
168379
168413
|
} else if (!isAutoMode && !isHeatingMode) {
|
|
168380
|
-
|
|
168414
|
+
logger168.debug(
|
|
168381
168415
|
`heatingSetpointChanging: skipping - not in heating/auto mode (mode=${currentMode}, haMode=${haHvacMode})`
|
|
168382
168416
|
);
|
|
168383
168417
|
return;
|
|
168384
168418
|
}
|
|
168385
|
-
|
|
168419
|
+
logger168.debug(
|
|
168386
168420
|
`heatingSetpointChanging: proceeding - isAutoMode=${isAutoMode}, isHeatingMode=${isHeatingMode}, isOff=${isOff}, haMode=${haHvacMode}`
|
|
168387
168421
|
);
|
|
168388
168422
|
}
|
|
168389
168423
|
const coolingSetpoint = this.features.cooling ? this.state.occupiedCoolingSetpoint : value;
|
|
168390
|
-
|
|
168424
|
+
logger168.debug(
|
|
168391
168425
|
`heatingSetpointChanging: calling setTemperature with heat=${next.celsius(true)}, cool=${coolingSetpoint}`
|
|
168392
168426
|
);
|
|
168393
168427
|
this.setTemperature(
|
|
@@ -168426,12 +168460,12 @@ var ThermostatServerBase = class extends FullFeaturedBase {
|
|
|
168426
168460
|
const isOff = currentMode === Thermostat3.SystemMode.Off;
|
|
168427
168461
|
if (isOff && !this.features.heating && this.features.cooling) {
|
|
168428
168462
|
if (nudgingSetpoints.has(homeAssistant.entityId)) {
|
|
168429
|
-
|
|
168463
|
+
logger168.debug(
|
|
168430
168464
|
`coolingSetpointChanging: skipping auto-resume - nudge write in progress`
|
|
168431
168465
|
);
|
|
168432
168466
|
return;
|
|
168433
168467
|
}
|
|
168434
|
-
|
|
168468
|
+
logger168.info(
|
|
168435
168469
|
`coolingSetpointChanging: auto-resume - switching to Cool (was Off)`
|
|
168436
168470
|
);
|
|
168437
168471
|
const modeAction = config10.setSystemMode(
|
|
@@ -168440,12 +168474,12 @@ var ThermostatServerBase = class extends FullFeaturedBase {
|
|
|
168440
168474
|
);
|
|
168441
168475
|
homeAssistant.callAction(modeAction);
|
|
168442
168476
|
} else if (!isAutoMode && !isCoolingMode) {
|
|
168443
|
-
|
|
168477
|
+
logger168.debug(
|
|
168444
168478
|
`coolingSetpointChanging: skipping - not in cooling/auto mode (mode=${currentMode}, haMode=${haHvacMode})`
|
|
168445
168479
|
);
|
|
168446
168480
|
return;
|
|
168447
168481
|
}
|
|
168448
|
-
|
|
168482
|
+
logger168.debug(
|
|
168449
168483
|
`coolingSetpointChanging: proceeding - isAutoMode=${isAutoMode}, isCoolingMode=${isCoolingMode}, isOff=${isOff}, haMode=${haHvacMode}`
|
|
168450
168484
|
);
|
|
168451
168485
|
}
|
|
@@ -168522,7 +168556,7 @@ var ThermostatServerBase = class extends FullFeaturedBase {
|
|
|
168522
168556
|
const effectiveMax = max ?? 5e3;
|
|
168523
168557
|
if (value == null || Number.isNaN(value)) {
|
|
168524
168558
|
const defaultValue = type === "heat" ? 2e3 : 2400;
|
|
168525
|
-
|
|
168559
|
+
logger168.debug(
|
|
168526
168560
|
`${type} setpoint is undefined, using default: ${defaultValue}`
|
|
168527
168561
|
);
|
|
168528
168562
|
return Math.max(effectiveMin, Math.min(effectiveMax, defaultValue));
|
|
@@ -168986,7 +169020,7 @@ init_home_assistant_entity_behavior();
|
|
|
168986
169020
|
init_esm();
|
|
168987
169021
|
init_home_assistant_actions();
|
|
168988
169022
|
init_home_assistant_entity_behavior();
|
|
168989
|
-
var
|
|
169023
|
+
var logger169 = Logger.get("WindowCoveringServer");
|
|
168990
169024
|
var MovementStatus = WindowCovering3.MovementStatus;
|
|
168991
169025
|
var FeaturedBase5 = WindowCoveringServer.with(
|
|
168992
169026
|
"Lift",
|
|
@@ -169070,7 +169104,7 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
|
|
|
169070
169104
|
);
|
|
169071
169105
|
const currentTilt100ths = currentTilt != null ? currentTilt * 100 : null;
|
|
169072
169106
|
const isStopped = movementStatus === MovementStatus.Stopped;
|
|
169073
|
-
|
|
169107
|
+
logger169.debug(
|
|
169074
169108
|
`Cover update for ${entity.entity_id}: state=${state.state}, lift=${currentLift}%, tilt=${currentTilt}%, movement=${MovementStatus[movementStatus]}`
|
|
169075
169109
|
);
|
|
169076
169110
|
const appliedPatch = applyPatchState(
|
|
@@ -169109,9 +169143,9 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
|
|
|
169109
169143
|
);
|
|
169110
169144
|
if (Object.keys(appliedPatch).length > 0) {
|
|
169111
169145
|
const hasOperationalChange = "operationalStatus" in appliedPatch;
|
|
169112
|
-
const log = hasOperationalChange ?
|
|
169146
|
+
const log = hasOperationalChange ? logger169.info : logger169.debug;
|
|
169113
169147
|
log.call(
|
|
169114
|
-
|
|
169148
|
+
logger169,
|
|
169115
169149
|
`Cover ${entity.entity_id} state changed: ${JSON.stringify(appliedPatch)}`
|
|
169116
169150
|
);
|
|
169117
169151
|
}
|
|
@@ -169119,7 +169153,7 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
|
|
|
169119
169153
|
async handleMovement(type, _, direction, targetPercent100ths) {
|
|
169120
169154
|
const currentLift = this.state.currentPositionLiftPercent100ths ?? 0;
|
|
169121
169155
|
const currentTilt = this.state.currentPositionTiltPercent100ths ?? 0;
|
|
169122
|
-
|
|
169156
|
+
logger169.info(
|
|
169123
169157
|
`handleMovement: type=${MovementType[type]}, direction=${MovementDirection[direction]}, target=${targetPercent100ths}, currentLift=${currentLift}, currentTilt=${currentTilt}, absolutePosition=${this.features.absolutePosition}`
|
|
169124
169158
|
);
|
|
169125
169159
|
if (type === MovementType.Lift) {
|
|
@@ -169155,13 +169189,13 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
|
|
|
169155
169189
|
handleLiftOpen() {
|
|
169156
169190
|
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
169157
169191
|
const action = this.state.config.openCoverLift(void 0, this.agent);
|
|
169158
|
-
|
|
169192
|
+
logger169.info(`handleLiftOpen: calling action=${action.action}`);
|
|
169159
169193
|
homeAssistant.callAction(action);
|
|
169160
169194
|
}
|
|
169161
169195
|
handleLiftClose() {
|
|
169162
169196
|
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
169163
169197
|
const action = this.state.config.closeCoverLift(void 0, this.agent);
|
|
169164
|
-
|
|
169198
|
+
logger169.info(`handleLiftClose: calling action=${action.action}`);
|
|
169165
169199
|
homeAssistant.callAction(action);
|
|
169166
169200
|
}
|
|
169167
169201
|
handleGoToLiftPosition(targetPercent100ths) {
|
|
@@ -169182,7 +169216,7 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
|
|
|
169182
169216
|
this.lastLiftCommandTime = now;
|
|
169183
169217
|
const isFirstInSequence = timeSinceLastCommand > _WindowCoveringServerBase.COMMAND_SEQUENCE_THRESHOLD_MS;
|
|
169184
169218
|
const debounceMs = isFirstInSequence ? _WindowCoveringServerBase.DEBOUNCE_INITIAL_MS : _WindowCoveringServerBase.DEBOUNCE_SUBSEQUENT_MS;
|
|
169185
|
-
|
|
169219
|
+
logger169.debug(
|
|
169186
169220
|
`Lift command: target=${targetPosition}%, debounce=${debounceMs}ms (${isFirstInSequence ? "initial" : "subsequent"})`
|
|
169187
169221
|
);
|
|
169188
169222
|
if (this.liftDebounceTimer) {
|
|
@@ -169231,7 +169265,7 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
|
|
|
169231
169265
|
this.lastTiltCommandTime = now;
|
|
169232
169266
|
const isFirstInSequence = timeSinceLastCommand > _WindowCoveringServerBase.COMMAND_SEQUENCE_THRESHOLD_MS;
|
|
169233
169267
|
const debounceMs = isFirstInSequence ? _WindowCoveringServerBase.DEBOUNCE_INITIAL_MS : _WindowCoveringServerBase.DEBOUNCE_SUBSEQUENT_MS;
|
|
169234
|
-
|
|
169268
|
+
logger169.debug(
|
|
169235
169269
|
`Tilt command: target=${targetPosition}%, debounce=${debounceMs}ms (${isFirstInSequence ? "initial" : "subsequent"})`
|
|
169236
169270
|
);
|
|
169237
169271
|
if (this.tiltDebounceTimer) {
|
|
@@ -169290,7 +169324,7 @@ function adjustPositionForWriting(position, flags2, matterSemantics) {
|
|
|
169290
169324
|
}
|
|
169291
169325
|
|
|
169292
169326
|
// src/matter/endpoints/legacy/cover/behaviors/cover-window-covering-server.ts
|
|
169293
|
-
var
|
|
169327
|
+
var logger170 = Logger.get("CoverWindowCoveringServer");
|
|
169294
169328
|
var attributes5 = (entity) => entity.attributes;
|
|
169295
169329
|
var MATTER_SEMANTIC_PLATFORMS = [
|
|
169296
169330
|
// Currently empty - no known platforms use Matter semantics by default
|
|
@@ -169308,7 +169342,7 @@ var adjustPositionForReading2 = (position, agent) => {
|
|
|
169308
169342
|
const { featureFlags } = agent.env.get(BridgeDataProvider);
|
|
169309
169343
|
const matterSem = usesMatterSemantics(agent);
|
|
169310
169344
|
const result = adjustPositionForReading(position, featureFlags, matterSem);
|
|
169311
|
-
|
|
169345
|
+
logger170.debug(`adjustPositionForReading: HA=${position}%, result=${result}%`);
|
|
169312
169346
|
return result;
|
|
169313
169347
|
};
|
|
169314
169348
|
var adjustPositionForWriting2 = (position, agent) => {
|
|
@@ -169412,7 +169446,7 @@ var config5 = {
|
|
|
169412
169446
|
var CoverWindowCoveringServer = WindowCoveringServer2(config5);
|
|
169413
169447
|
|
|
169414
169448
|
// src/matter/endpoints/legacy/cover/index.ts
|
|
169415
|
-
var
|
|
169449
|
+
var logger171 = Logger.get("CoverDevice");
|
|
169416
169450
|
var CoverPowerSourceServer = PowerSourceServer2({
|
|
169417
169451
|
getBatteryPercent: (entity, agent) => {
|
|
169418
169452
|
const homeAssistant = agent.get(HomeAssistantEntityBehavior);
|
|
@@ -169439,7 +169473,7 @@ var CoverDeviceType = (supportedFeatures, hasBattery, entityId) => {
|
|
|
169439
169473
|
features2.add("PositionAwareLift");
|
|
169440
169474
|
features2.add("AbsolutePosition");
|
|
169441
169475
|
} else {
|
|
169442
|
-
|
|
169476
|
+
logger171.warn(
|
|
169443
169477
|
`[${entityId}] Cover has no support_open feature (supported_features=${supportedFeatures}), adding Lift anyway`
|
|
169444
169478
|
);
|
|
169445
169479
|
features2.add("Lift");
|
|
@@ -169456,7 +169490,7 @@ var CoverDeviceType = (supportedFeatures, hasBattery, entityId) => {
|
|
|
169456
169490
|
features2.add("AbsolutePosition");
|
|
169457
169491
|
}
|
|
169458
169492
|
}
|
|
169459
|
-
|
|
169493
|
+
logger171.info(
|
|
169460
169494
|
`[${entityId}] Creating WindowCovering with features: [${[...features2].join(", ")}], supported_features=${supportedFeatures}`
|
|
169461
169495
|
);
|
|
169462
169496
|
const baseBehaviors = [
|
|
@@ -169477,11 +169511,11 @@ function CoverDevice(homeAssistantEntity) {
|
|
|
169477
169511
|
const hasBatteryEntity = !!homeAssistantEntity.mapping?.batteryEntity;
|
|
169478
169512
|
const hasBattery = hasBatteryAttr || hasBatteryEntity;
|
|
169479
169513
|
if (hasBattery) {
|
|
169480
|
-
|
|
169514
|
+
logger171.info(
|
|
169481
169515
|
`[${entityId}] Creating cover with PowerSource cluster, batteryAttr=${hasBatteryAttr}, batteryEntity=${homeAssistantEntity.mapping?.batteryEntity ?? "none"}`
|
|
169482
169516
|
);
|
|
169483
169517
|
} else {
|
|
169484
|
-
|
|
169518
|
+
logger171.debug(
|
|
169485
169519
|
`[${entityId}] Creating cover without battery (batteryAttr=${hasBatteryAttr}, batteryEntity=${homeAssistantEntity.mapping?.batteryEntity ?? "none"})`
|
|
169486
169520
|
);
|
|
169487
169521
|
}
|
|
@@ -169497,7 +169531,7 @@ function CoverDevice(homeAssistantEntity) {
|
|
|
169497
169531
|
// src/matter/behaviors/generic-switch-server.ts
|
|
169498
169532
|
init_esm();
|
|
169499
169533
|
init_home_assistant_entity_behavior();
|
|
169500
|
-
var
|
|
169534
|
+
var logger172 = Logger.get("GenericSwitchServer");
|
|
169501
169535
|
var FeaturedBase6 = SwitchServer.with(
|
|
169502
169536
|
"MomentarySwitch",
|
|
169503
169537
|
"MomentarySwitchRelease",
|
|
@@ -169508,7 +169542,7 @@ var GenericSwitchServerBase = class extends FeaturedBase6 {
|
|
|
169508
169542
|
await super.initialize();
|
|
169509
169543
|
const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
|
|
169510
169544
|
const entityId = homeAssistant.entityId;
|
|
169511
|
-
|
|
169545
|
+
logger172.debug(`[${entityId}] GenericSwitch initialized`);
|
|
169512
169546
|
this.reactTo(homeAssistant.onChange, this.handleEventChange);
|
|
169513
169547
|
}
|
|
169514
169548
|
handleEventChange() {
|
|
@@ -169519,7 +169553,7 @@ var GenericSwitchServerBase = class extends FeaturedBase6 {
|
|
|
169519
169553
|
const eventType = attrs.event_type;
|
|
169520
169554
|
if (!eventType) return;
|
|
169521
169555
|
const entityId = homeAssistant.entityId;
|
|
169522
|
-
|
|
169556
|
+
logger172.debug(`[${entityId}] Event fired: ${eventType}`);
|
|
169523
169557
|
this.triggerPress(eventType);
|
|
169524
169558
|
}
|
|
169525
169559
|
triggerPress(eventType) {
|
|
@@ -169833,7 +169867,7 @@ init_nodejs();
|
|
|
169833
169867
|
|
|
169834
169868
|
// src/matter/behaviors/color-control-server.ts
|
|
169835
169869
|
init_home_assistant_entity_behavior();
|
|
169836
|
-
var
|
|
169870
|
+
var logger173 = Logger.get("ColorControlServer");
|
|
169837
169871
|
var optimisticColorState = /* @__PURE__ */ new Map();
|
|
169838
169872
|
var OPTIMISTIC_TIMEOUT_MS3 = 3e3;
|
|
169839
169873
|
var OPTIMISTIC_TOLERANCE2 = 5;
|
|
@@ -169866,7 +169900,7 @@ var ColorControlServerBase = class extends FeaturedBase7 {
|
|
|
169866
169900
|
if (this.state.startUpColorTemperatureMireds == null) {
|
|
169867
169901
|
this.state.startUpColorTemperatureMireds = defaultMireds;
|
|
169868
169902
|
}
|
|
169869
|
-
|
|
169903
|
+
logger173.debug(
|
|
169870
169904
|
`initialize: set ColorTemperature defaults - min=${this.state.colorTempPhysicalMinMireds}, max=${this.state.colorTempPhysicalMaxMireds}, current=${this.state.colorTemperatureMireds}`
|
|
169871
169905
|
);
|
|
169872
169906
|
}
|
|
@@ -170306,7 +170340,7 @@ init_dist();
|
|
|
170306
170340
|
// src/matter/behaviors/electrical-energy-measurement-server.ts
|
|
170307
170341
|
init_esm();
|
|
170308
170342
|
init_home_assistant_entity_behavior();
|
|
170309
|
-
var
|
|
170343
|
+
var logger174 = Logger.get("ElectricalEnergyMeasurementServer");
|
|
170310
170344
|
var FeaturedBase8 = ElectricalEnergyMeasurementServer.with("CumulativeEnergy", "ImportedEnergy");
|
|
170311
170345
|
var ElectricalEnergyMeasurementServerBase = class extends FeaturedBase8 {
|
|
170312
170346
|
async initialize() {
|
|
@@ -170315,7 +170349,7 @@ var ElectricalEnergyMeasurementServerBase = class extends FeaturedBase8 {
|
|
|
170315
170349
|
const entityId = homeAssistant.entityId;
|
|
170316
170350
|
const energyEntity = homeAssistant.state.mapping?.energyEntity;
|
|
170317
170351
|
if (energyEntity) {
|
|
170318
|
-
|
|
170352
|
+
logger174.debug(
|
|
170319
170353
|
`[${entityId}] ElectricalEnergyMeasurement using mapped energy entity: ${energyEntity}`
|
|
170320
170354
|
);
|
|
170321
170355
|
}
|
|
@@ -170367,7 +170401,7 @@ var HaElectricalEnergyMeasurementServer = ElectricalEnergyMeasurementServerBase.
|
|
|
170367
170401
|
// src/matter/behaviors/electrical-power-measurement-server.ts
|
|
170368
170402
|
init_esm();
|
|
170369
170403
|
init_home_assistant_entity_behavior();
|
|
170370
|
-
var
|
|
170404
|
+
var logger175 = Logger.get("ElectricalPowerMeasurementServer");
|
|
170371
170405
|
var ElectricalPowerMeasurementServerBase = class extends ElectricalPowerMeasurementServer {
|
|
170372
170406
|
async initialize() {
|
|
170373
170407
|
await super.initialize();
|
|
@@ -170375,7 +170409,7 @@ var ElectricalPowerMeasurementServerBase = class extends ElectricalPowerMeasurem
|
|
|
170375
170409
|
const entityId = homeAssistant.entityId;
|
|
170376
170410
|
const powerEntity = homeAssistant.state.mapping?.powerEntity;
|
|
170377
170411
|
if (powerEntity) {
|
|
170378
|
-
|
|
170412
|
+
logger175.debug(
|
|
170379
170413
|
`[${entityId}] ElectricalPowerMeasurement using mapped power entity: ${powerEntity}`
|
|
170380
170414
|
);
|
|
170381
170415
|
}
|
|
@@ -170471,7 +170505,7 @@ init_home_assistant_entity_behavior();
|
|
|
170471
170505
|
// src/matter/behaviors/lock-server.ts
|
|
170472
170506
|
init_esm();
|
|
170473
170507
|
init_home_assistant_entity_behavior();
|
|
170474
|
-
var
|
|
170508
|
+
var logger176 = Logger.get("LockServer");
|
|
170475
170509
|
function hasStoredCredentialHelper(env, entityId) {
|
|
170476
170510
|
try {
|
|
170477
170511
|
const storage2 = env.get(LockCredentialStorage);
|
|
@@ -170629,7 +170663,7 @@ var LockServerWithPinBase = class extends PinCredentialBase {
|
|
|
170629
170663
|
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
170630
170664
|
const action = this.state.config.lock(void 0, this.agent);
|
|
170631
170665
|
const hasPinProvided = !!request.pinCode;
|
|
170632
|
-
|
|
170666
|
+
logger176.debug(
|
|
170633
170667
|
`lockDoor called for ${homeAssistant.entityId}, PIN provided: ${hasPinProvided}`
|
|
170634
170668
|
);
|
|
170635
170669
|
if (request.pinCode) {
|
|
@@ -170642,12 +170676,12 @@ var LockServerWithPinBase = class extends PinCredentialBase {
|
|
|
170642
170676
|
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
170643
170677
|
const action = this.state.config.unlock(void 0, this.agent);
|
|
170644
170678
|
const hasPinProvided = !!request.pinCode;
|
|
170645
|
-
|
|
170679
|
+
logger176.debug(
|
|
170646
170680
|
`unlockDoor called for ${homeAssistant.entityId}, PIN provided: ${hasPinProvided}, requirePin: ${this.state.requirePinForRemoteOperation}`
|
|
170647
170681
|
);
|
|
170648
170682
|
if (this.state.requirePinForRemoteOperation) {
|
|
170649
170683
|
if (!request.pinCode) {
|
|
170650
|
-
|
|
170684
|
+
logger176.info(
|
|
170651
170685
|
`unlockDoor REJECTED for ${homeAssistant.entityId} - no PIN provided`
|
|
170652
170686
|
);
|
|
170653
170687
|
throw new StatusResponseError(
|
|
@@ -170657,12 +170691,12 @@ var LockServerWithPinBase = class extends PinCredentialBase {
|
|
|
170657
170691
|
}
|
|
170658
170692
|
const providedPin = new TextDecoder().decode(request.pinCode);
|
|
170659
170693
|
if (!this.verifyStoredPin(homeAssistant.entityId, providedPin)) {
|
|
170660
|
-
|
|
170694
|
+
logger176.info(
|
|
170661
170695
|
`unlockDoor REJECTED for ${homeAssistant.entityId} - invalid PIN`
|
|
170662
170696
|
);
|
|
170663
170697
|
throw new StatusResponseError("Invalid PIN code", StatusCode.Failure);
|
|
170664
170698
|
}
|
|
170665
|
-
|
|
170699
|
+
logger176.debug(`unlockDoor PIN verified for ${homeAssistant.entityId}`);
|
|
170666
170700
|
action.data = { ...action.data, code: providedPin };
|
|
170667
170701
|
}
|
|
170668
170702
|
homeAssistant.callAction(action);
|
|
@@ -170823,7 +170857,7 @@ var LockServerWithPinAndUnboltBase = class extends PinCredentialUnboltBase {
|
|
|
170823
170857
|
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
170824
170858
|
const action = this.state.config.lock(void 0, this.agent);
|
|
170825
170859
|
const hasPinProvided = !!request.pinCode;
|
|
170826
|
-
|
|
170860
|
+
logger176.debug(
|
|
170827
170861
|
`lockDoor called for ${homeAssistant.entityId}, PIN provided: ${hasPinProvided}`
|
|
170828
170862
|
);
|
|
170829
170863
|
if (request.pinCode) {
|
|
@@ -170837,12 +170871,12 @@ var LockServerWithPinAndUnboltBase = class extends PinCredentialUnboltBase {
|
|
|
170837
170871
|
const unlatchConfig = this.state.config.unlatch;
|
|
170838
170872
|
const action = unlatchConfig ? unlatchConfig(void 0, this.agent) : this.state.config.unlock(void 0, this.agent);
|
|
170839
170873
|
const hasPinProvided = !!request.pinCode;
|
|
170840
|
-
|
|
170874
|
+
logger176.debug(
|
|
170841
170875
|
`unlockDoor called for ${homeAssistant.entityId}, PIN provided: ${hasPinProvided}, requirePin: ${this.state.requirePinForRemoteOperation}, usingUnlatch: ${!!unlatchConfig}`
|
|
170842
170876
|
);
|
|
170843
170877
|
if (this.state.requirePinForRemoteOperation) {
|
|
170844
170878
|
if (!request.pinCode) {
|
|
170845
|
-
|
|
170879
|
+
logger176.info(
|
|
170846
170880
|
`unlockDoor REJECTED for ${homeAssistant.entityId} - no PIN provided`
|
|
170847
170881
|
);
|
|
170848
170882
|
throw new StatusResponseError(
|
|
@@ -170852,12 +170886,12 @@ var LockServerWithPinAndUnboltBase = class extends PinCredentialUnboltBase {
|
|
|
170852
170886
|
}
|
|
170853
170887
|
const providedPin = new TextDecoder().decode(request.pinCode);
|
|
170854
170888
|
if (!verifyStoredPinHelper(this.env, homeAssistant.entityId, providedPin)) {
|
|
170855
|
-
|
|
170889
|
+
logger176.info(
|
|
170856
170890
|
`unlockDoor REJECTED for ${homeAssistant.entityId} - invalid PIN`
|
|
170857
170891
|
);
|
|
170858
170892
|
throw new StatusResponseError("Invalid PIN code", StatusCode.Failure);
|
|
170859
170893
|
}
|
|
170860
|
-
|
|
170894
|
+
logger176.debug(`unlockDoor PIN verified for ${homeAssistant.entityId}`);
|
|
170861
170895
|
action.data = { ...action.data, code: providedPin };
|
|
170862
170896
|
}
|
|
170863
170897
|
homeAssistant.callAction(action);
|
|
@@ -170872,12 +170906,12 @@ var LockServerWithPinAndUnboltBase = class extends PinCredentialUnboltBase {
|
|
|
170872
170906
|
}
|
|
170873
170907
|
const action = unlatchConfig(void 0, this.agent);
|
|
170874
170908
|
const hasPinProvided = !!request.pinCode;
|
|
170875
|
-
|
|
170909
|
+
logger176.debug(
|
|
170876
170910
|
`unboltDoor called for ${homeAssistant.entityId}, PIN provided: ${hasPinProvided}, requirePin: ${this.state.requirePinForRemoteOperation}`
|
|
170877
170911
|
);
|
|
170878
170912
|
if (this.state.requirePinForRemoteOperation) {
|
|
170879
170913
|
if (!request.pinCode) {
|
|
170880
|
-
|
|
170914
|
+
logger176.info(
|
|
170881
170915
|
`unboltDoor REJECTED for ${homeAssistant.entityId} - no PIN provided`
|
|
170882
170916
|
);
|
|
170883
170917
|
throw new StatusResponseError(
|
|
@@ -170887,12 +170921,12 @@ var LockServerWithPinAndUnboltBase = class extends PinCredentialUnboltBase {
|
|
|
170887
170921
|
}
|
|
170888
170922
|
const providedPin = new TextDecoder().decode(request.pinCode);
|
|
170889
170923
|
if (!verifyStoredPinHelper(this.env, homeAssistant.entityId, providedPin)) {
|
|
170890
|
-
|
|
170924
|
+
logger176.info(
|
|
170891
170925
|
`unboltDoor REJECTED for ${homeAssistant.entityId} - invalid PIN`
|
|
170892
170926
|
);
|
|
170893
170927
|
throw new StatusResponseError("Invalid PIN code", StatusCode.Failure);
|
|
170894
170928
|
}
|
|
170895
|
-
|
|
170929
|
+
logger176.debug(`unboltDoor PIN verified for ${homeAssistant.entityId}`);
|
|
170896
170930
|
action.data = { ...action.data, code: providedPin };
|
|
170897
170931
|
}
|
|
170898
170932
|
homeAssistant.callAction(action);
|
|
@@ -171062,7 +171096,7 @@ init_home_assistant_entity_behavior();
|
|
|
171062
171096
|
init_dist();
|
|
171063
171097
|
init_esm();
|
|
171064
171098
|
init_home_assistant_entity_behavior();
|
|
171065
|
-
var
|
|
171099
|
+
var logger177 = Logger.get("MediaPlayerKeypadInputServer");
|
|
171066
171100
|
var MediaPlayerKeypadInputServer = class extends KeypadInputServer {
|
|
171067
171101
|
sendKey(request) {
|
|
171068
171102
|
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
@@ -171073,12 +171107,12 @@ var MediaPlayerKeypadInputServer = class extends KeypadInputServer {
|
|
|
171073
171107
|
const features2 = attributes7.supported_features ?? 0;
|
|
171074
171108
|
const action = this.mapKeyToAction(request.keyCode, features2);
|
|
171075
171109
|
if (!action) {
|
|
171076
|
-
|
|
171110
|
+
logger177.debug(
|
|
171077
171111
|
`Unsupported key code ${request.keyCode} for ${homeAssistant.entityId}`
|
|
171078
171112
|
);
|
|
171079
171113
|
return { status: KeypadInput3.Status.UnsupportedKey };
|
|
171080
171114
|
}
|
|
171081
|
-
|
|
171115
|
+
logger177.debug(
|
|
171082
171116
|
`sendKey(${request.keyCode}) \u2192 ${action} for ${homeAssistant.entityId}`
|
|
171083
171117
|
);
|
|
171084
171118
|
homeAssistant.callAction({ action });
|
|
@@ -171357,7 +171391,7 @@ init_home_assistant_entity_behavior();
|
|
|
171357
171391
|
// src/matter/behaviors/speaker-level-control-server.ts
|
|
171358
171392
|
init_esm();
|
|
171359
171393
|
init_home_assistant_entity_behavior();
|
|
171360
|
-
var
|
|
171394
|
+
var logger178 = Logger.get("SpeakerLevelControlServer");
|
|
171361
171395
|
var optimisticLevelState2 = /* @__PURE__ */ new Map();
|
|
171362
171396
|
var OPTIMISTIC_TIMEOUT_MS4 = 3e3;
|
|
171363
171397
|
var OPTIMISTIC_TOLERANCE3 = 5;
|
|
@@ -171393,7 +171427,7 @@ var SpeakerLevelControlServerBase = class extends FeaturedBase9 {
|
|
|
171393
171427
|
currentLevel = Math.min(Math.max(minLevel, currentLevel), maxLevel);
|
|
171394
171428
|
}
|
|
171395
171429
|
const entityId = this.agent.get(HomeAssistantEntityBehavior).entity.entity_id;
|
|
171396
|
-
|
|
171430
|
+
logger178.debug(
|
|
171397
171431
|
`[${entityId}] Volume update: HA=${currentLevelPercent != null ? Math.round(currentLevelPercent * 100) : "null"}% -> currentLevel=${currentLevel}`
|
|
171398
171432
|
);
|
|
171399
171433
|
const optimistic = optimisticLevelState2.get(entity.entity_id);
|
|
@@ -171441,7 +171475,7 @@ var SpeakerLevelControlServerBase = class extends FeaturedBase9 {
|
|
|
171441
171475
|
const config10 = this.state.config;
|
|
171442
171476
|
const entityId = homeAssistant.entity.entity_id;
|
|
171443
171477
|
const levelPercent = level / 254;
|
|
171444
|
-
|
|
171478
|
+
logger178.debug(
|
|
171445
171479
|
`[${entityId}] Volume command: level=${level} -> HA volume_level=${levelPercent}`
|
|
171446
171480
|
);
|
|
171447
171481
|
const current = config10.getValuePercent(
|
|
@@ -172767,7 +172801,7 @@ var TvocConcentrationMeasurementServer = class extends TvocConcentrationMeasurem
|
|
|
172767
172801
|
};
|
|
172768
172802
|
|
|
172769
172803
|
// src/matter/endpoints/legacy/sensor/devices/tvoc-sensor.ts
|
|
172770
|
-
var
|
|
172804
|
+
var logger179 = Logger.get("TvocSensor");
|
|
172771
172805
|
function airQualityFromUgm3(value) {
|
|
172772
172806
|
if (value <= 300) return AirQuality3.AirQualityEnum.Good;
|
|
172773
172807
|
if (value <= 1e3) return AirQuality3.AirQualityEnum.Fair;
|
|
@@ -172805,17 +172839,17 @@ var TvocAirQualityServer = class extends TvocAirQualityServerBase {
|
|
|
172805
172839
|
const attributes7 = entity.state.attributes;
|
|
172806
172840
|
const deviceClass = attributes7.device_class;
|
|
172807
172841
|
let airQuality = AirQuality3.AirQualityEnum.Unknown;
|
|
172808
|
-
|
|
172842
|
+
logger179.debug(
|
|
172809
172843
|
`[${entity.entity_id}] TVOC update: state="${state}", device_class="${deviceClass}"`
|
|
172810
172844
|
);
|
|
172811
172845
|
if (state != null && !Number.isNaN(+state)) {
|
|
172812
172846
|
const value = +state;
|
|
172813
172847
|
airQuality = deviceClass === SensorDeviceClass.volatile_organic_compounds ? airQualityFromUgm3(value) : airQualityFromPpb(value);
|
|
172814
|
-
|
|
172848
|
+
logger179.debug(
|
|
172815
172849
|
`[${entity.entity_id}] TVOC value=${value} (${deviceClass}) -> airQuality=${AirQuality3.AirQualityEnum[airQuality]}`
|
|
172816
172850
|
);
|
|
172817
172851
|
} else {
|
|
172818
|
-
|
|
172852
|
+
logger179.warn(
|
|
172819
172853
|
`[${entity.entity_id}] TVOC state not a valid number: "${state}"`
|
|
172820
172854
|
);
|
|
172821
172855
|
}
|
|
@@ -173028,7 +173062,7 @@ init_home_assistant_entity_behavior();
|
|
|
173028
173062
|
// src/matter/behaviors/pm25-concentration-measurement-server.ts
|
|
173029
173063
|
init_esm();
|
|
173030
173064
|
init_home_assistant_entity_behavior();
|
|
173031
|
-
var
|
|
173065
|
+
var logger180 = Logger.get("Pm25ConcentrationMeasurementServer");
|
|
173032
173066
|
var Pm25ConcentrationMeasurementServerBase = Pm25ConcentrationMeasurementServer.with(
|
|
173033
173067
|
ConcentrationMeasurement3.Feature.NumericMeasurement
|
|
173034
173068
|
);
|
|
@@ -173052,11 +173086,11 @@ var Pm25ConcentrationMeasurementServer2 = class extends Pm25ConcentrationMeasure
|
|
|
173052
173086
|
if (this.state.measurementMedium === void 0) {
|
|
173053
173087
|
this.state.measurementMedium = ConcentrationMeasurement3.MeasurementMedium.Air;
|
|
173054
173088
|
}
|
|
173055
|
-
|
|
173089
|
+
logger180.debug(
|
|
173056
173090
|
"Pm25ConcentrationMeasurementServer: before super.initialize()"
|
|
173057
173091
|
);
|
|
173058
173092
|
await super.initialize();
|
|
173059
|
-
|
|
173093
|
+
logger180.debug(
|
|
173060
173094
|
"Pm25ConcentrationMeasurementServer: after super.initialize()"
|
|
173061
173095
|
);
|
|
173062
173096
|
const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
|
|
@@ -173079,7 +173113,7 @@ var Pm25ConcentrationMeasurementServer2 = class extends Pm25ConcentrationMeasure
|
|
|
173079
173113
|
};
|
|
173080
173114
|
|
|
173081
173115
|
// src/matter/endpoints/legacy/sensor/devices/pm25-sensor.ts
|
|
173082
|
-
var
|
|
173116
|
+
var logger181 = Logger.get("Pm25AirQualityServer");
|
|
173083
173117
|
var Pm25AirQualityServerBase = AirQualityServer.with(
|
|
173084
173118
|
AirQuality3.Feature.Fair,
|
|
173085
173119
|
AirQuality3.Feature.Moderate,
|
|
@@ -173091,9 +173125,9 @@ var Pm25AirQualityServer = class extends Pm25AirQualityServerBase {
|
|
|
173091
173125
|
if (this.state.airQuality === void 0) {
|
|
173092
173126
|
this.state.airQuality = AirQuality3.AirQualityEnum.Unknown;
|
|
173093
173127
|
}
|
|
173094
|
-
|
|
173128
|
+
logger181.debug("Pm25AirQualityServer: before super.initialize()");
|
|
173095
173129
|
await super.initialize();
|
|
173096
|
-
|
|
173130
|
+
logger181.debug("Pm25AirQualityServer: after super.initialize()");
|
|
173097
173131
|
const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
|
|
173098
173132
|
this.update(homeAssistant.entity);
|
|
173099
173133
|
this.reactTo(homeAssistant.onChange, this.update);
|
|
@@ -173130,7 +173164,7 @@ var Pm25SensorType = AirQualitySensorDevice.with(
|
|
|
173130
173164
|
|
|
173131
173165
|
// src/matter/endpoints/legacy/sensor/devices/temperature-humidity-sensor.ts
|
|
173132
173166
|
init_home_assistant_entity_behavior();
|
|
173133
|
-
var
|
|
173167
|
+
var temperatureConfig2 = {
|
|
173134
173168
|
getValue(entity, agent) {
|
|
173135
173169
|
const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
|
|
173136
173170
|
const state = entity.state;
|
|
@@ -173145,7 +173179,7 @@ var temperatureConfig3 = {
|
|
|
173145
173179
|
);
|
|
173146
173180
|
}
|
|
173147
173181
|
};
|
|
173148
|
-
var
|
|
173182
|
+
var humidityConfig3 = {
|
|
173149
173183
|
getValue(_entity, agent) {
|
|
173150
173184
|
const homeAssistant = agent.get(HomeAssistantEntityBehavior);
|
|
173151
173185
|
const humidityEntity = homeAssistant.state.mapping?.humidityEntity;
|
|
@@ -173195,38 +173229,38 @@ var TemperatureHumiditySensorType = TemperatureSensorDevice.with(
|
|
|
173195
173229
|
BasicInformationServer2,
|
|
173196
173230
|
IdentifyServer2,
|
|
173197
173231
|
HomeAssistantEntityBehavior,
|
|
173198
|
-
TemperatureMeasurementServer2(
|
|
173199
|
-
HumidityMeasurementServer(
|
|
173232
|
+
TemperatureMeasurementServer2(temperatureConfig2),
|
|
173233
|
+
HumidityMeasurementServer(humidityConfig3)
|
|
173200
173234
|
);
|
|
173201
173235
|
var TemperatureHumiditySensorWithBatteryType = TemperatureSensorDevice.with(
|
|
173202
173236
|
BasicInformationServer2,
|
|
173203
173237
|
IdentifyServer2,
|
|
173204
173238
|
HomeAssistantEntityBehavior,
|
|
173205
|
-
TemperatureMeasurementServer2(
|
|
173206
|
-
HumidityMeasurementServer(
|
|
173239
|
+
TemperatureMeasurementServer2(temperatureConfig2),
|
|
173240
|
+
HumidityMeasurementServer(humidityConfig3),
|
|
173207
173241
|
PowerSourceServer2(batteryConfig4)
|
|
173208
173242
|
);
|
|
173209
173243
|
var TemperatureHumidityPressureSensorType = TemperatureSensorDevice.with(
|
|
173210
173244
|
BasicInformationServer2,
|
|
173211
173245
|
IdentifyServer2,
|
|
173212
173246
|
HomeAssistantEntityBehavior,
|
|
173213
|
-
TemperatureMeasurementServer2(
|
|
173214
|
-
HumidityMeasurementServer(
|
|
173247
|
+
TemperatureMeasurementServer2(temperatureConfig2),
|
|
173248
|
+
HumidityMeasurementServer(humidityConfig3),
|
|
173215
173249
|
PressureMeasurementServer2(pressureConfig2)
|
|
173216
173250
|
);
|
|
173217
173251
|
var TemperatureHumidityPressureSensorWithBatteryType = TemperatureSensorDevice.with(
|
|
173218
173252
|
BasicInformationServer2,
|
|
173219
173253
|
IdentifyServer2,
|
|
173220
173254
|
HomeAssistantEntityBehavior,
|
|
173221
|
-
TemperatureMeasurementServer2(
|
|
173222
|
-
HumidityMeasurementServer(
|
|
173255
|
+
TemperatureMeasurementServer2(temperatureConfig2),
|
|
173256
|
+
HumidityMeasurementServer(humidityConfig3),
|
|
173223
173257
|
PressureMeasurementServer2(pressureConfig2),
|
|
173224
173258
|
PowerSourceServer2(batteryConfig4)
|
|
173225
173259
|
);
|
|
173226
173260
|
|
|
173227
173261
|
// src/matter/endpoints/legacy/sensor/devices/temperature-pressure-sensor.ts
|
|
173228
173262
|
init_home_assistant_entity_behavior();
|
|
173229
|
-
var
|
|
173263
|
+
var temperatureConfig3 = {
|
|
173230
173264
|
getValue(entity, agent) {
|
|
173231
173265
|
const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
|
|
173232
173266
|
const state = entity.state;
|
|
@@ -173277,14 +173311,14 @@ var TemperaturePressureSensorType = TemperatureSensorDevice.with(
|
|
|
173277
173311
|
BasicInformationServer2,
|
|
173278
173312
|
IdentifyServer2,
|
|
173279
173313
|
HomeAssistantEntityBehavior,
|
|
173280
|
-
TemperatureMeasurementServer2(
|
|
173314
|
+
TemperatureMeasurementServer2(temperatureConfig3),
|
|
173281
173315
|
PressureMeasurementServer2(pressureConfig3)
|
|
173282
173316
|
);
|
|
173283
173317
|
var TemperaturePressureSensorWithBatteryType = TemperatureSensorDevice.with(
|
|
173284
173318
|
BasicInformationServer2,
|
|
173285
173319
|
IdentifyServer2,
|
|
173286
173320
|
HomeAssistantEntityBehavior,
|
|
173287
|
-
TemperatureMeasurementServer2(
|
|
173321
|
+
TemperatureMeasurementServer2(temperatureConfig3),
|
|
173288
173322
|
PressureMeasurementServer2(pressureConfig3),
|
|
173289
173323
|
PowerSourceServer2(batteryConfig5)
|
|
173290
173324
|
);
|
|
@@ -173448,7 +173482,7 @@ init_home_assistant_entity_behavior();
|
|
|
173448
173482
|
init_dist();
|
|
173449
173483
|
init_esm();
|
|
173450
173484
|
init_home_assistant_entity_behavior();
|
|
173451
|
-
var
|
|
173485
|
+
var logger182 = Logger.get("VacuumIdentifyServer");
|
|
173452
173486
|
var VacuumIdentifyServer = class extends IdentifyServer2 {
|
|
173453
173487
|
triggerEffect(effect) {
|
|
173454
173488
|
this.#locate("triggerEffect");
|
|
@@ -173465,11 +173499,11 @@ var VacuumIdentifyServer = class extends IdentifyServer2 {
|
|
|
173465
173499
|
const features2 = homeAssistant.entity.state.attributes.supported_features ?? 0;
|
|
173466
173500
|
const hasLocate = testBit(features2, VacuumDeviceFeature.LOCATE);
|
|
173467
173501
|
if (!hasLocate) {
|
|
173468
|
-
|
|
173502
|
+
logger182.warn(
|
|
173469
173503
|
`${source} for ${homeAssistant.entityId} \u2014 LOCATE not in supported_features (${features2}), calling vacuum.locate anyway`
|
|
173470
173504
|
);
|
|
173471
173505
|
} else {
|
|
173472
|
-
|
|
173506
|
+
logger182.info(`${source} \u2192 vacuum.locate for ${homeAssistant.entityId}`);
|
|
173473
173507
|
}
|
|
173474
173508
|
homeAssistant.callAction({ action: "vacuum.locate" });
|
|
173475
173509
|
}
|
|
@@ -173760,11 +173794,11 @@ init_esm();
|
|
|
173760
173794
|
|
|
173761
173795
|
// src/matter/behaviors/service-area-server.ts
|
|
173762
173796
|
init_esm();
|
|
173763
|
-
var
|
|
173797
|
+
var logger183 = Logger.get("ServiceAreaServer");
|
|
173764
173798
|
var ServiceAreaServerBase = class extends ServiceAreaBehavior {
|
|
173765
173799
|
selectAreas(request) {
|
|
173766
173800
|
const { newAreas } = request;
|
|
173767
|
-
|
|
173801
|
+
logger183.info(
|
|
173768
173802
|
`ServiceArea selectAreas called with: ${JSON.stringify(newAreas)}`
|
|
173769
173803
|
);
|
|
173770
173804
|
const uniqueAreas = [...new Set(newAreas)];
|
|
@@ -173773,14 +173807,14 @@ var ServiceAreaServerBase = class extends ServiceAreaBehavior {
|
|
|
173773
173807
|
(id) => !supportedAreaIds.includes(id)
|
|
173774
173808
|
);
|
|
173775
173809
|
if (invalidAreas.length > 0) {
|
|
173776
|
-
|
|
173810
|
+
logger183.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
|
|
173777
173811
|
return {
|
|
173778
173812
|
status: ServiceArea3.SelectAreasStatus.UnsupportedArea,
|
|
173779
173813
|
statusText: `Invalid area IDs: ${invalidAreas.join(", ")}`
|
|
173780
173814
|
};
|
|
173781
173815
|
}
|
|
173782
173816
|
this.state.selectedAreas = uniqueAreas;
|
|
173783
|
-
|
|
173817
|
+
logger183.info(
|
|
173784
173818
|
`ServiceArea: Stored ${uniqueAreas.length} areas for cleaning: ${uniqueAreas.join(", ")}`
|
|
173785
173819
|
);
|
|
173786
173820
|
return {
|
|
@@ -173801,7 +173835,7 @@ var ServiceAreaServerBase = class extends ServiceAreaBehavior {
|
|
|
173801
173835
|
ServiceAreaServerBase2.State = State;
|
|
173802
173836
|
})(ServiceAreaServerBase || (ServiceAreaServerBase = {}));
|
|
173803
173837
|
function ServiceAreaServer2(initialState) {
|
|
173804
|
-
|
|
173838
|
+
logger183.info(
|
|
173805
173839
|
`Creating ServiceAreaServer with ${initialState.supportedAreas.length} areas`
|
|
173806
173840
|
);
|
|
173807
173841
|
return ServiceAreaServerBase.set({
|
|
@@ -173814,7 +173848,7 @@ var ServiceAreaWithMaps = ServiceAreaBehavior.with(ServiceArea3.Feature.Maps);
|
|
|
173814
173848
|
var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMaps {
|
|
173815
173849
|
selectAreas(request) {
|
|
173816
173850
|
const { newAreas } = request;
|
|
173817
|
-
|
|
173851
|
+
logger183.info(
|
|
173818
173852
|
`ServiceArea selectAreas called with: ${JSON.stringify(newAreas)}`
|
|
173819
173853
|
);
|
|
173820
173854
|
const uniqueAreas = [...new Set(newAreas)];
|
|
@@ -173823,14 +173857,14 @@ var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMaps {
|
|
|
173823
173857
|
(id) => !supportedAreaIds.includes(id)
|
|
173824
173858
|
);
|
|
173825
173859
|
if (invalidAreas.length > 0) {
|
|
173826
|
-
|
|
173860
|
+
logger183.warn(`Invalid area IDs requested: ${invalidAreas.join(", ")}`);
|
|
173827
173861
|
return {
|
|
173828
173862
|
status: ServiceArea3.SelectAreasStatus.UnsupportedArea,
|
|
173829
173863
|
statusText: `Invalid area IDs: ${invalidAreas.join(", ")}`
|
|
173830
173864
|
};
|
|
173831
173865
|
}
|
|
173832
173866
|
this.state.selectedAreas = uniqueAreas;
|
|
173833
|
-
|
|
173867
|
+
logger183.info(
|
|
173834
173868
|
`ServiceArea: Stored ${uniqueAreas.length} areas for cleaning: ${uniqueAreas.join(", ")}`
|
|
173835
173869
|
);
|
|
173836
173870
|
return {
|
|
@@ -173851,14 +173885,14 @@ var ServiceAreaServerWithMapsBase = class extends ServiceAreaWithMaps {
|
|
|
173851
173885
|
ServiceAreaServerWithMapsBase2.State = State;
|
|
173852
173886
|
})(ServiceAreaServerWithMapsBase || (ServiceAreaServerWithMapsBase = {}));
|
|
173853
173887
|
function ServiceAreaServerWithMaps(initialState) {
|
|
173854
|
-
|
|
173888
|
+
logger183.info(
|
|
173855
173889
|
`Creating ServiceAreaServer with Maps: ${initialState.supportedAreas.length} areas, ${initialState.supportedMaps.length} maps`
|
|
173856
173890
|
);
|
|
173857
173891
|
for (const map of initialState.supportedMaps) {
|
|
173858
173892
|
const areaCount = initialState.supportedAreas.filter(
|
|
173859
173893
|
(a) => a.mapId === map.mapId
|
|
173860
173894
|
).length;
|
|
173861
|
-
|
|
173895
|
+
logger183.info(` Map ${map.mapId}: "${map.name}" (${areaCount} areas)`);
|
|
173862
173896
|
}
|
|
173863
173897
|
return ServiceAreaServerWithMapsBase.set({
|
|
173864
173898
|
supportedAreas: initialState.supportedAreas,
|
|
@@ -173869,7 +173903,7 @@ function ServiceAreaServerWithMaps(initialState) {
|
|
|
173869
173903
|
}
|
|
173870
173904
|
|
|
173871
173905
|
// src/matter/endpoints/legacy/vacuum/behaviors/vacuum-service-area-server.ts
|
|
173872
|
-
var
|
|
173906
|
+
var logger184 = Logger.get("VacuumServiceAreaServer");
|
|
173873
173907
|
function toAreaId(roomId) {
|
|
173874
173908
|
if (typeof roomId === "number") {
|
|
173875
173909
|
return roomId;
|
|
@@ -173948,13 +173982,13 @@ function createVacuumServiceAreaServer(attributes7, roomEntities, includeUnnamed
|
|
|
173948
173982
|
let rooms;
|
|
173949
173983
|
if (roomEntities && roomEntities.length > 0) {
|
|
173950
173984
|
rooms = buttonEntitiesToRooms(roomEntities, attributes7);
|
|
173951
|
-
|
|
173985
|
+
logger184.info(
|
|
173952
173986
|
`Using ${rooms.length} button entities as rooms: ${rooms.map((r) => r.name).join(", ")}`
|
|
173953
173987
|
);
|
|
173954
173988
|
} else {
|
|
173955
173989
|
rooms = parseVacuumRooms(attributes7, includeUnnamedRooms);
|
|
173956
173990
|
if (rooms.length > 0) {
|
|
173957
|
-
|
|
173991
|
+
logger184.info(
|
|
173958
173992
|
`Using ${rooms.length} rooms from attributes: ${rooms.map((r) => r.name).join(", ")}`
|
|
173959
173993
|
);
|
|
173960
173994
|
}
|
|
@@ -174008,7 +174042,7 @@ function createCustomServiceAreaServer(customAreas) {
|
|
|
174008
174042
|
landmarkInfo: null
|
|
174009
174043
|
}
|
|
174010
174044
|
}));
|
|
174011
|
-
|
|
174045
|
+
logger184.info(
|
|
174012
174046
|
`Using ${customAreas.length} custom service areas: ${customAreas.map((a) => a.name).join(", ")}`
|
|
174013
174047
|
);
|
|
174014
174048
|
return ServiceAreaServer2({
|
|
@@ -174019,7 +174053,7 @@ function createCustomServiceAreaServer(customAreas) {
|
|
|
174019
174053
|
}
|
|
174020
174054
|
|
|
174021
174055
|
// src/matter/endpoints/legacy/vacuum/behaviors/vacuum-rvc-run-mode-server.ts
|
|
174022
|
-
var
|
|
174056
|
+
var logger185 = Logger.get("VacuumRvcRunModeServer");
|
|
174023
174057
|
function buildSupportedModes2(attributes7, includeUnnamedRooms = false, customAreas) {
|
|
174024
174058
|
const modes = [
|
|
174025
174059
|
{
|
|
@@ -174065,12 +174099,12 @@ function handleCustomServiceAreas(selectedAreas, customAreas, homeAssistant, ser
|
|
|
174065
174099
|
const matched = selectedAreas.map((areaId) => customAreas[areaId - 1]).filter(Boolean);
|
|
174066
174100
|
serviceArea.state.selectedAreas = [];
|
|
174067
174101
|
if (matched.length === 0) {
|
|
174068
|
-
|
|
174102
|
+
logger185.warn(
|
|
174069
174103
|
`Custom service areas: no match for selected IDs ${selectedAreas.join(", ")}`
|
|
174070
174104
|
);
|
|
174071
174105
|
return { action: "vacuum.start" };
|
|
174072
174106
|
}
|
|
174073
|
-
|
|
174107
|
+
logger185.info(
|
|
174074
174108
|
`Custom service areas: calling ${matched.length} service(s): ${matched.map((a) => `${a.service} (${a.name})`).join(", ")}`
|
|
174075
174109
|
);
|
|
174076
174110
|
for (let i = 1; i < matched.length; i++) {
|
|
@@ -174099,7 +174133,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174099
174133
|
VacuumState.mop_cleaning
|
|
174100
174134
|
];
|
|
174101
174135
|
const isCleaning = cleaningStates.includes(state);
|
|
174102
|
-
|
|
174136
|
+
logger185.debug(
|
|
174103
174137
|
`Vacuum state: "${state}", isCleaning: ${isCleaning}, currentMode: ${isCleaning ? "Cleaning" : "Idle"}`
|
|
174104
174138
|
);
|
|
174105
174139
|
return isCleaning ? 1 /* Cleaning */ : 0 /* Idle */;
|
|
@@ -174138,7 +174172,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174138
174172
|
}
|
|
174139
174173
|
}
|
|
174140
174174
|
if (buttonEntityIds.length > 0) {
|
|
174141
|
-
|
|
174175
|
+
logger185.info(
|
|
174142
174176
|
`Roborock: Pressing button entities for selected rooms: ${buttonEntityIds.join(", ")}`
|
|
174143
174177
|
);
|
|
174144
174178
|
serviceArea.state.selectedAreas = [];
|
|
@@ -174167,14 +174201,14 @@ var vacuumRvcRunModeConfig = {
|
|
|
174167
174201
|
}
|
|
174168
174202
|
}
|
|
174169
174203
|
if (roomIds.length > 0) {
|
|
174170
|
-
|
|
174204
|
+
logger185.info(
|
|
174171
174205
|
`Starting cleaning with selected areas: ${roomIds.join(", ")}`
|
|
174172
174206
|
);
|
|
174173
174207
|
serviceArea.state.selectedAreas = [];
|
|
174174
174208
|
const vacuumEntityId = homeAssistant.entityId;
|
|
174175
174209
|
if (vacuumEntityId.startsWith("vacuum.valetudo_")) {
|
|
174176
174210
|
const identifier = vacuumEntityId.replace(/^vacuum\.valetudo_/, "");
|
|
174177
|
-
|
|
174211
|
+
logger185.info(
|
|
174178
174212
|
`Valetudo vacuum: Using mqtt.publish segment_cleanup for rooms: ${roomIds.join(", ")}`
|
|
174179
174213
|
);
|
|
174180
174214
|
return {
|
|
@@ -174194,7 +174228,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174194
174228
|
if (targetMapName) {
|
|
174195
174229
|
const vacName = vacuumEntityId.replace("vacuum.", "");
|
|
174196
174230
|
const selectedMapEntity = `select.${vacName}_selected_map`;
|
|
174197
|
-
|
|
174231
|
+
logger185.info(
|
|
174198
174232
|
`Dreame multi-floor: switching to map "${targetMapName}" via ${selectedMapEntity}`
|
|
174199
174233
|
);
|
|
174200
174234
|
homeAssistant.callAction({
|
|
@@ -174221,7 +174255,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174221
174255
|
}
|
|
174222
174256
|
if (isEcovacsVacuum(attributes7)) {
|
|
174223
174257
|
const roomIdStr = roomIds.join(",");
|
|
174224
|
-
|
|
174258
|
+
logger185.info(
|
|
174225
174259
|
`Ecovacs vacuum: Using spot_area for rooms: ${roomIdStr}`
|
|
174226
174260
|
);
|
|
174227
174261
|
return {
|
|
@@ -174236,14 +174270,14 @@ var vacuumRvcRunModeConfig = {
|
|
|
174236
174270
|
}
|
|
174237
174271
|
};
|
|
174238
174272
|
}
|
|
174239
|
-
|
|
174273
|
+
logger185.warn(
|
|
174240
174274
|
`Room cleaning via send_command not supported for this vacuum type. Rooms: ${roomIds.join(", ")}. Falling back to vacuum.start`
|
|
174241
174275
|
);
|
|
174242
174276
|
}
|
|
174243
174277
|
}
|
|
174244
174278
|
} catch {
|
|
174245
174279
|
}
|
|
174246
|
-
|
|
174280
|
+
logger185.info("Starting regular cleaning (no areas selected)");
|
|
174247
174281
|
return { action: "vacuum.start" };
|
|
174248
174282
|
},
|
|
174249
174283
|
returnToBase: () => ({ action: "vacuum.return_to_base" }),
|
|
@@ -174258,7 +174292,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174258
174292
|
const homeAssistant = agent.get(HomeAssistantEntityBehavior);
|
|
174259
174293
|
const entity = homeAssistant.entity;
|
|
174260
174294
|
const attributes7 = entity.state.attributes;
|
|
174261
|
-
|
|
174295
|
+
logger185.info(`cleanRoom called: roomMode=${roomMode}`);
|
|
174262
174296
|
const customAreas = homeAssistant.state.mapping?.customServiceAreas;
|
|
174263
174297
|
if (customAreas && customAreas.length > 0) {
|
|
174264
174298
|
const sorted = [...customAreas].sort(
|
|
@@ -174267,7 +174301,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174267
174301
|
const areaIndex = roomMode - ROOM_MODE_BASE2 - 1;
|
|
174268
174302
|
if (areaIndex >= 0 && areaIndex < sorted.length) {
|
|
174269
174303
|
const area = sorted[areaIndex];
|
|
174270
|
-
|
|
174304
|
+
logger185.info(
|
|
174271
174305
|
`cleanRoom: custom service area "${area.name}" \u2192 ${area.service}`
|
|
174272
174306
|
);
|
|
174273
174307
|
return {
|
|
@@ -174279,7 +174313,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174279
174313
|
}
|
|
174280
174314
|
const rooms = parseVacuumRooms(attributes7);
|
|
174281
174315
|
const numericIdFromMode = getRoomIdFromMode(roomMode);
|
|
174282
|
-
|
|
174316
|
+
logger185.info(
|
|
174283
174317
|
`cleanRoom: numericIdFromMode=${numericIdFromMode}, available rooms: ${JSON.stringify(rooms.map((r) => ({ id: r.id, name: r.name, modeValue: getRoomModeValue(r) })))}`
|
|
174284
174318
|
);
|
|
174285
174319
|
const room = rooms.find((r) => getRoomModeValue(r) === roomMode);
|
|
@@ -174288,7 +174322,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174288
174322
|
const vacuumEntityId = entity.entity_id;
|
|
174289
174323
|
if (vacuumEntityId.startsWith("vacuum.valetudo_")) {
|
|
174290
174324
|
const identifier = vacuumEntityId.replace(/^vacuum\.valetudo_/, "");
|
|
174291
|
-
|
|
174325
|
+
logger185.info(
|
|
174292
174326
|
`Valetudo vacuum: Using mqtt.publish segment_cleanup for room ${room.name} (id: ${commandId3})`
|
|
174293
174327
|
);
|
|
174294
174328
|
return {
|
|
@@ -174308,7 +174342,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174308
174342
|
if (room.mapName) {
|
|
174309
174343
|
const vacuumName = vacuumEntityId.replace("vacuum.", "");
|
|
174310
174344
|
const selectedMapEntity = `select.${vacuumName}_selected_map`;
|
|
174311
|
-
|
|
174345
|
+
logger185.info(
|
|
174312
174346
|
`Dreame multi-floor: switching to map "${room.mapName}" via ${selectedMapEntity}`
|
|
174313
174347
|
);
|
|
174314
174348
|
homeAssistant.callAction({
|
|
@@ -174317,7 +174351,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174317
174351
|
data: { option: room.mapName }
|
|
174318
174352
|
});
|
|
174319
174353
|
}
|
|
174320
|
-
|
|
174354
|
+
logger185.debug(
|
|
174321
174355
|
`Dreame vacuum detected, using dreame_vacuum.vacuum_clean_segment for room ${room.name} (commandId: ${commandId3}, id: ${room.id})`
|
|
174322
174356
|
);
|
|
174323
174357
|
return {
|
|
@@ -174328,7 +174362,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174328
174362
|
};
|
|
174329
174363
|
}
|
|
174330
174364
|
if (isRoborockVacuum(attributes7) || isXiaomiMiotVacuum(attributes7)) {
|
|
174331
|
-
|
|
174365
|
+
logger185.debug(
|
|
174332
174366
|
`Using vacuum.send_command with app_segment_clean for room ${room.name} (commandId: ${commandId3}, id: ${room.id})`
|
|
174333
174367
|
);
|
|
174334
174368
|
return {
|
|
@@ -174341,7 +174375,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174341
174375
|
}
|
|
174342
174376
|
if (isEcovacsVacuum(attributes7)) {
|
|
174343
174377
|
const roomIdStr = String(commandId3);
|
|
174344
|
-
|
|
174378
|
+
logger185.info(
|
|
174345
174379
|
`Ecovacs vacuum: Using spot_area for room ${room.name} (id: ${roomIdStr})`
|
|
174346
174380
|
);
|
|
174347
174381
|
return {
|
|
@@ -174356,7 +174390,7 @@ var vacuumRvcRunModeConfig = {
|
|
|
174356
174390
|
}
|
|
174357
174391
|
};
|
|
174358
174392
|
}
|
|
174359
|
-
|
|
174393
|
+
logger185.warn(
|
|
174360
174394
|
`Room cleaning via send_command not supported for this vacuum type. Room: ${room.name} (id=${commandId3}). Falling back to vacuum.start`
|
|
174361
174395
|
);
|
|
174362
174396
|
}
|
|
@@ -174372,20 +174406,20 @@ function createVacuumRvcRunModeServer(attributes7, includeUnnamedRooms = false,
|
|
|
174372
174406
|
includeUnnamedRooms,
|
|
174373
174407
|
customAreas
|
|
174374
174408
|
);
|
|
174375
|
-
|
|
174409
|
+
logger185.info(
|
|
174376
174410
|
`Creating VacuumRvcRunModeServer with ${rooms.length} rooms, ${supportedModes.length} total modes`
|
|
174377
174411
|
);
|
|
174378
174412
|
if (rooms.length > 0) {
|
|
174379
|
-
|
|
174413
|
+
logger185.info(`Rooms found: ${rooms.map((r) => r.name).join(", ")}`);
|
|
174380
174414
|
}
|
|
174381
174415
|
if (filteredCount > 0) {
|
|
174382
174416
|
const filtered = allRooms.filter((r) => !rooms.some((x) => x.id === r.id));
|
|
174383
|
-
|
|
174417
|
+
logger185.info(
|
|
174384
174418
|
`Filtered out ${filteredCount} unnamed room(s): ${filtered.map((r) => r.name).join(", ")}`
|
|
174385
174419
|
);
|
|
174386
174420
|
}
|
|
174387
174421
|
if (allRooms.length === 0) {
|
|
174388
|
-
|
|
174422
|
+
logger185.debug(
|
|
174389
174423
|
`No rooms found. Attributes: rooms=${JSON.stringify(attributes7.rooms)}, segments=${JSON.stringify(attributes7.segments)}, room_list=${attributes7.room_list}`
|
|
174390
174424
|
);
|
|
174391
174425
|
}
|
|
@@ -174443,7 +174477,7 @@ init_rvc_clean_mode();
|
|
|
174443
174477
|
|
|
174444
174478
|
// src/matter/behaviors/rvc-clean-mode-server.ts
|
|
174445
174479
|
init_home_assistant_entity_behavior();
|
|
174446
|
-
var
|
|
174480
|
+
var logger186 = Logger.get("RvcCleanModeServerBase");
|
|
174447
174481
|
var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeServer {
|
|
174448
174482
|
// Pending mode from a recent changeToMode command.
|
|
174449
174483
|
// Prevents stale HA state (from a different entity like select.xxx)
|
|
@@ -174486,14 +174520,14 @@ var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeS
|
|
|
174486
174520
|
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
174487
174521
|
const { newMode } = request;
|
|
174488
174522
|
if (newMode !== this.state.currentMode && !this.state.supportedModes.some((m) => m.mode === newMode)) {
|
|
174489
|
-
|
|
174523
|
+
logger186.warn(`changeToMode(${newMode}) rejected: unsupported mode`);
|
|
174490
174524
|
return {
|
|
174491
174525
|
status: ModeBase3.ModeChangeStatus.UnsupportedMode,
|
|
174492
174526
|
statusText: `Unsupported mode: ${newMode}`
|
|
174493
174527
|
};
|
|
174494
174528
|
}
|
|
174495
174529
|
const modeLabel = this.state.supportedModes.find((m) => m.mode === newMode);
|
|
174496
|
-
|
|
174530
|
+
logger186.info(
|
|
174497
174531
|
`changeToMode(${newMode}) "${modeLabel?.label ?? "unknown"}" for ${homeAssistant.entityId}`
|
|
174498
174532
|
);
|
|
174499
174533
|
this.pendingMode = newMode;
|
|
@@ -174501,7 +174535,7 @@ var RvcCleanModeServerBase = class _RvcCleanModeServerBase extends RvcCleanModeS
|
|
|
174501
174535
|
this.state.currentMode = newMode;
|
|
174502
174536
|
const action = this.state.config.setCleanMode(newMode, this.agent);
|
|
174503
174537
|
if (action) {
|
|
174504
|
-
|
|
174538
|
+
logger186.info(
|
|
174505
174539
|
`changeToMode: dispatching action ${action.action} \u2192 ${action.target ?? homeAssistant.entityId}`
|
|
174506
174540
|
);
|
|
174507
174541
|
homeAssistant.callAction(action);
|
|
@@ -174534,7 +174568,7 @@ function RvcCleanModeServer2(config10, initialState) {
|
|
|
174534
174568
|
}
|
|
174535
174569
|
|
|
174536
174570
|
// src/matter/endpoints/legacy/vacuum/behaviors/vacuum-rvc-clean-mode-server.ts
|
|
174537
|
-
var
|
|
174571
|
+
var logger187 = Logger.get("VacuumRvcCleanModeServer");
|
|
174538
174572
|
var MODE_VACUUM = 0;
|
|
174539
174573
|
var MODE_VACUUM_AND_MOP = 1;
|
|
174540
174574
|
var MODE_MOP = 2;
|
|
@@ -174833,7 +174867,7 @@ function findMatchingCleanOption(ct, availableOptions) {
|
|
|
174833
174867
|
if (match) return match;
|
|
174834
174868
|
}
|
|
174835
174869
|
}
|
|
174836
|
-
|
|
174870
|
+
logger187.warn(
|
|
174837
174871
|
`No match for ${CLEAN_TYPE_LABELS[ct]} in [${availableOptions.join(", ")}]`
|
|
174838
174872
|
);
|
|
174839
174873
|
return aliases[0];
|
|
@@ -174842,7 +174876,7 @@ function buildCleaningModeAction(targetCleanType, agent) {
|
|
|
174842
174876
|
const selectEntityId = getCleaningModeSelectEntity(agent);
|
|
174843
174877
|
const { options } = readSelectEntity(selectEntityId, agent);
|
|
174844
174878
|
const optionToUse = findMatchingCleanOption(targetCleanType, options);
|
|
174845
|
-
|
|
174879
|
+
logger187.info(
|
|
174846
174880
|
`Switching cleaning mode to: ${optionToUse} via ${selectEntityId}`
|
|
174847
174881
|
);
|
|
174848
174882
|
return {
|
|
@@ -174931,7 +174965,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
174931
174965
|
}
|
|
174932
174966
|
}
|
|
174933
174967
|
if (speedMode !== void 0) {
|
|
174934
|
-
|
|
174968
|
+
logger187.debug(
|
|
174935
174969
|
`Current mode: Vacuum + fan_speed="${speedState}" -> mode ${speedMode}`
|
|
174936
174970
|
);
|
|
174937
174971
|
return speedMode;
|
|
@@ -174952,7 +174986,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
174952
174986
|
}
|
|
174953
174987
|
}
|
|
174954
174988
|
if (mopMode !== void 0) {
|
|
174955
|
-
|
|
174989
|
+
logger187.debug(
|
|
174956
174990
|
`Current mode: Mop + intensity="${state}" -> mode ${mopMode}`
|
|
174957
174991
|
);
|
|
174958
174992
|
return mopMode;
|
|
@@ -174970,14 +175004,14 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
174970
175004
|
const homeAssistant = agent.get(HomeAssistantEntityBehavior);
|
|
174971
175005
|
const vacuumEntityId = homeAssistant.entityId;
|
|
174972
175006
|
const mapping = homeAssistant.state.mapping;
|
|
174973
|
-
|
|
175007
|
+
logger187.info(
|
|
174974
175008
|
`setCleanMode(${mode}) for ${vacuumEntityId} \u2014 suctionEntity=${mapping?.suctionLevelEntity ?? "none"}, mopEntity=${mapping?.mopIntensityEntity ?? "none"}, fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])}, customTags=${JSON.stringify(customFanSpeedTags ?? {})}`
|
|
174975
175009
|
);
|
|
174976
175010
|
if (mopIntensityList && mopIntensityList.length > 0 && isMopIntensityMode(mode)) {
|
|
174977
175011
|
const mopIndex = mode - MOP_INTENSITY_MODE_BASE;
|
|
174978
175012
|
const mopName = mopIntensityList[mopIndex];
|
|
174979
175013
|
if (!mopName) {
|
|
174980
|
-
|
|
175014
|
+
logger187.warn(`Invalid mop intensity mode index: ${mopIndex}`);
|
|
174981
175015
|
return void 0;
|
|
174982
175016
|
}
|
|
174983
175017
|
if (hasCleanTypes) {
|
|
@@ -174990,18 +175024,18 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
174990
175024
|
mapping.mopIntensityEntity,
|
|
174991
175025
|
agent
|
|
174992
175026
|
);
|
|
174993
|
-
|
|
175027
|
+
logger187.info(
|
|
174994
175028
|
`Mop intensity entity ${mapping.mopIntensityEntity}: current="${state}", options=${JSON.stringify(options ?? [])}`
|
|
174995
175029
|
);
|
|
174996
175030
|
let option = matchMopIntensityOption(mopName, options);
|
|
174997
175031
|
if (!option && options && mopIndex < options.length) {
|
|
174998
175032
|
option = options[mopIndex];
|
|
174999
|
-
|
|
175033
|
+
logger187.info(
|
|
175000
175034
|
`Positional match for mop "${mopName}" -> "${option}" (index ${mopIndex})`
|
|
175001
175035
|
);
|
|
175002
175036
|
}
|
|
175003
175037
|
if (option) {
|
|
175004
|
-
|
|
175038
|
+
logger187.info(
|
|
175005
175039
|
`Setting mop intensity to: ${option} via ${mapping.mopIntensityEntity}`
|
|
175006
175040
|
);
|
|
175007
175041
|
return {
|
|
@@ -175010,11 +175044,11 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
175010
175044
|
target: mapping.mopIntensityEntity
|
|
175011
175045
|
};
|
|
175012
175046
|
}
|
|
175013
|
-
|
|
175047
|
+
logger187.warn(
|
|
175014
175048
|
`No match for mop intensity "${mopName}" in options: [${(options ?? []).join(", ")}]`
|
|
175015
175049
|
);
|
|
175016
175050
|
} else {
|
|
175017
|
-
|
|
175051
|
+
logger187.warn(
|
|
175018
175052
|
`Mop intensity mode ${mode} requested but no mopIntensityEntity configured`
|
|
175019
175053
|
);
|
|
175020
175054
|
}
|
|
@@ -175024,7 +175058,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
175024
175058
|
const fanSpeedIndex = mode - FAN_SPEED_MODE_BASE;
|
|
175025
175059
|
const fanSpeedName = fanSpeedList[fanSpeedIndex];
|
|
175026
175060
|
if (!fanSpeedName) {
|
|
175027
|
-
|
|
175061
|
+
logger187.warn(`Invalid fan speed mode index: ${fanSpeedIndex}`);
|
|
175028
175062
|
return void 0;
|
|
175029
175063
|
}
|
|
175030
175064
|
if (mapping?.suctionLevelEntity) {
|
|
@@ -175037,7 +175071,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
175037
175071
|
mapping.suctionLevelEntity,
|
|
175038
175072
|
agent
|
|
175039
175073
|
);
|
|
175040
|
-
|
|
175074
|
+
logger187.info(
|
|
175041
175075
|
`Suction entity ${mapping.suctionLevelEntity}: current="${state}", options=${JSON.stringify(options ?? [])}`
|
|
175042
175076
|
);
|
|
175043
175077
|
let option = matchFanSpeedOption(
|
|
@@ -175047,12 +175081,12 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
175047
175081
|
);
|
|
175048
175082
|
if (!option && options && fanSpeedIndex < options.length) {
|
|
175049
175083
|
option = options[fanSpeedIndex];
|
|
175050
|
-
|
|
175084
|
+
logger187.info(
|
|
175051
175085
|
`Positional match for fan "${fanSpeedName}" -> "${option}" (index ${fanSpeedIndex})`
|
|
175052
175086
|
);
|
|
175053
175087
|
}
|
|
175054
175088
|
if (option) {
|
|
175055
|
-
|
|
175089
|
+
logger187.info(
|
|
175056
175090
|
`Setting suction to: ${option} via ${mapping.suctionLevelEntity}`
|
|
175057
175091
|
);
|
|
175058
175092
|
return {
|
|
@@ -175061,7 +175095,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
175061
175095
|
target: mapping.suctionLevelEntity
|
|
175062
175096
|
};
|
|
175063
175097
|
}
|
|
175064
|
-
|
|
175098
|
+
logger187.warn(
|
|
175065
175099
|
`No match for fan speed "${fanSpeedName}" in suction options: [${(options ?? []).join(", ")}]`
|
|
175066
175100
|
);
|
|
175067
175101
|
return void 0;
|
|
@@ -175071,7 +175105,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
175071
175105
|
buildCleaningModeAction(0 /* Sweeping */, agent)
|
|
175072
175106
|
);
|
|
175073
175107
|
}
|
|
175074
|
-
|
|
175108
|
+
logger187.info(
|
|
175075
175109
|
`Setting fan speed to: ${fanSpeedName} via vacuum.set_fan_speed`
|
|
175076
175110
|
);
|
|
175077
175111
|
return {
|
|
@@ -175081,7 +175115,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
175081
175115
|
};
|
|
175082
175116
|
}
|
|
175083
175117
|
if (!hasCleanTypes) {
|
|
175084
|
-
|
|
175118
|
+
logger187.debug(
|
|
175085
175119
|
`Ignoring cleaning type change (mode=${mode}): no cleaning mode entity`
|
|
175086
175120
|
);
|
|
175087
175121
|
return void 0;
|
|
@@ -175093,7 +175127,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
|
|
|
175093
175127
|
agent
|
|
175094
175128
|
);
|
|
175095
175129
|
const optionToUse = findMatchingCleanOption(cleanType, availableOptions);
|
|
175096
|
-
|
|
175130
|
+
logger187.info(
|
|
175097
175131
|
`Setting cleaning mode to: ${optionToUse} (mode=${mode}) via ${selectEntityId}`
|
|
175098
175132
|
);
|
|
175099
175133
|
return {
|
|
@@ -175111,10 +175145,10 @@ function createVacuumRvcCleanModeServer(_attributes, fanSpeedList, mopIntensityL
|
|
|
175111
175145
|
cleaningModeOptions,
|
|
175112
175146
|
customFanSpeedTags
|
|
175113
175147
|
);
|
|
175114
|
-
|
|
175148
|
+
logger187.info(
|
|
175115
175149
|
`Creating VacuumRvcCleanModeServer with ${supportedModes.length} modes (fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])}, cleaningModeOptions=${JSON.stringify(cleaningModeOptions ?? [])}, customTags=${JSON.stringify(customFanSpeedTags ?? {})})`
|
|
175116
175150
|
);
|
|
175117
|
-
|
|
175151
|
+
logger187.info(
|
|
175118
175152
|
`Modes: ${supportedModes.map((m) => `${m.mode}:${m.label}[${m.modeTags.map((t) => t.value).join(",")}]`).join(", ")}`
|
|
175119
175153
|
);
|
|
175120
175154
|
const initialState = {
|
|
@@ -175192,7 +175226,7 @@ init_rvc_operational_state();
|
|
|
175192
175226
|
init_home_assistant_entity_behavior();
|
|
175193
175227
|
var OperationalState4 = RvcOperationalState3.OperationalState;
|
|
175194
175228
|
var ErrorState = RvcOperationalState3.ErrorState;
|
|
175195
|
-
var
|
|
175229
|
+
var logger188 = Logger.get("RvcOperationalStateServer");
|
|
175196
175230
|
var activeStates = /* @__PURE__ */ new Set([
|
|
175197
175231
|
OperationalState4.Running,
|
|
175198
175232
|
OperationalState4.SeekingCharger
|
|
@@ -175234,7 +175268,7 @@ var RvcOperationalStateServerBase = class extends RvcOperationalStateServer {
|
|
|
175234
175268
|
}
|
|
175235
175269
|
});
|
|
175236
175270
|
if (activeStates.has(previousState) && !activeStates.has(newState)) {
|
|
175237
|
-
|
|
175271
|
+
logger188.info(
|
|
175238
175272
|
`Operation completed: ${OperationalState4[previousState]} -> ${OperationalState4[newState]}`
|
|
175239
175273
|
);
|
|
175240
175274
|
try {
|
|
@@ -175247,7 +175281,7 @@ var RvcOperationalStateServerBase = class extends RvcOperationalStateServer {
|
|
|
175247
175281
|
this.context
|
|
175248
175282
|
);
|
|
175249
175283
|
} catch (e) {
|
|
175250
|
-
|
|
175284
|
+
logger188.debug("Failed to emit operationCompletion event:", e);
|
|
175251
175285
|
}
|
|
175252
175286
|
}
|
|
175253
175287
|
}
|
|
@@ -175282,7 +175316,7 @@ var RvcOperationalStateServerBase = class extends RvcOperationalStateServer {
|
|
|
175282
175316
|
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
175283
175317
|
homeAssistant.callAction(goHomeAction(void 0, this.agent));
|
|
175284
175318
|
} else {
|
|
175285
|
-
|
|
175319
|
+
logger188.warn("GoHome command received but no goHome action configured");
|
|
175286
175320
|
}
|
|
175287
175321
|
return {
|
|
175288
175322
|
commandResponseState: {
|
|
@@ -175302,7 +175336,7 @@ function RvcOperationalStateServer2(config10) {
|
|
|
175302
175336
|
}
|
|
175303
175337
|
|
|
175304
175338
|
// src/matter/endpoints/legacy/vacuum/behaviors/vacuum-rvc-operational-state-server.ts
|
|
175305
|
-
var
|
|
175339
|
+
var logger189 = Logger.get("VacuumRvcOperationalStateServer");
|
|
175306
175340
|
function isCharging(entity) {
|
|
175307
175341
|
const attrs = entity.attributes;
|
|
175308
175342
|
if (attrs.battery_icon?.includes("charging")) return true;
|
|
@@ -175344,16 +175378,16 @@ var VacuumRvcOperationalStateServer = RvcOperationalStateServer2({
|
|
|
175344
175378
|
operationalState = RvcOperationalState3.OperationalState.Error;
|
|
175345
175379
|
} else {
|
|
175346
175380
|
if (state.toLowerCase().includes("clean")) {
|
|
175347
|
-
|
|
175381
|
+
logger189.info(
|
|
175348
175382
|
`Unknown vacuum state "${state}" contains 'clean', treating as Running`
|
|
175349
175383
|
);
|
|
175350
175384
|
operationalState = RvcOperationalState3.OperationalState.Running;
|
|
175351
175385
|
} else {
|
|
175352
|
-
|
|
175386
|
+
logger189.info(`Unknown vacuum state "${state}", treating as Paused`);
|
|
175353
175387
|
operationalState = RvcOperationalState3.OperationalState.Paused;
|
|
175354
175388
|
}
|
|
175355
175389
|
}
|
|
175356
|
-
|
|
175390
|
+
logger189.debug(
|
|
175357
175391
|
`Vacuum operationalState: "${state}" -> ${RvcOperationalState3.OperationalState[operationalState]}`
|
|
175358
175392
|
);
|
|
175359
175393
|
return operationalState;
|
|
@@ -175374,7 +175408,7 @@ var VacuumRvcOperationalStateServer = RvcOperationalStateServer2({
|
|
|
175374
175408
|
});
|
|
175375
175409
|
|
|
175376
175410
|
// src/matter/endpoints/legacy/vacuum/index.ts
|
|
175377
|
-
var
|
|
175411
|
+
var logger190 = Logger.get("VacuumDevice");
|
|
175378
175412
|
var VacuumEndpointType = RoboticVacuumCleanerDevice.with(
|
|
175379
175413
|
BasicInformationServer2,
|
|
175380
175414
|
VacuumIdentifyServer,
|
|
@@ -175388,7 +175422,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, minimalClusters
|
|
|
175388
175422
|
const entityId = homeAssistantEntity.entity.entity_id;
|
|
175389
175423
|
const attributes7 = homeAssistantEntity.entity.state.attributes;
|
|
175390
175424
|
const customAreas = homeAssistantEntity.mapping?.customServiceAreas;
|
|
175391
|
-
|
|
175425
|
+
logger190.info(
|
|
175392
175426
|
`Creating vacuum endpoint for ${entityId}, mapping: ${JSON.stringify(homeAssistantEntity.mapping ?? "none")}`
|
|
175393
175427
|
);
|
|
175394
175428
|
let device = VacuumEndpointType.with(
|
|
@@ -175399,7 +175433,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, minimalClusters
|
|
|
175399
175433
|
)
|
|
175400
175434
|
).set({ homeAssistantEntity });
|
|
175401
175435
|
if (includeOnOff) {
|
|
175402
|
-
|
|
175436
|
+
logger190.info(`${entityId}: Adding OnOff cluster (vacuumOnOff flag enabled)`);
|
|
175403
175437
|
device = device.with(VacuumOnOffServer);
|
|
175404
175438
|
}
|
|
175405
175439
|
if (!minimalClusters) {
|
|
@@ -175407,24 +175441,24 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, minimalClusters
|
|
|
175407
175441
|
}
|
|
175408
175442
|
const roomEntities = homeAssistantEntity.mapping?.roomEntities;
|
|
175409
175443
|
const rooms = parseVacuumRooms(attributes7);
|
|
175410
|
-
|
|
175444
|
+
logger190.info(
|
|
175411
175445
|
`${entityId}: customAreas=${customAreas?.length ?? 0}, roomEntities=${JSON.stringify(roomEntities ?? [])}, parsedRooms=${rooms.length}`
|
|
175412
175446
|
);
|
|
175413
175447
|
if (customAreas && customAreas.length > 0) {
|
|
175414
|
-
|
|
175448
|
+
logger190.info(
|
|
175415
175449
|
`${entityId}: Adding ServiceArea (${customAreas.length} custom areas)`
|
|
175416
175450
|
);
|
|
175417
175451
|
device = device.with(createCustomServiceAreaServer(customAreas));
|
|
175418
175452
|
} else if (rooms.length > 0 || roomEntities && roomEntities.length > 0) {
|
|
175419
|
-
|
|
175453
|
+
logger190.info(`${entityId}: Adding ServiceArea (${rooms.length} rooms)`);
|
|
175420
175454
|
device = device.with(
|
|
175421
175455
|
createVacuumServiceAreaServer(attributes7, roomEntities)
|
|
175422
175456
|
);
|
|
175423
175457
|
} else if (!minimalClusters) {
|
|
175424
|
-
|
|
175458
|
+
logger190.info(`${entityId}: Adding ServiceArea (default single-area)`);
|
|
175425
175459
|
device = device.with(createDefaultServiceAreaServer());
|
|
175426
175460
|
} else {
|
|
175427
|
-
|
|
175461
|
+
logger190.info(`${entityId}: Skipping ServiceArea (minimal clusters mode)`);
|
|
175428
175462
|
}
|
|
175429
175463
|
const fanSpeedList = resolveFanSpeedList(
|
|
175430
175464
|
attributes7,
|
|
@@ -175434,7 +175468,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, minimalClusters
|
|
|
175434
175468
|
homeAssistantEntity.mapping?.mopIntensityEntity
|
|
175435
175469
|
);
|
|
175436
175470
|
if (cleaningModeOptions || fanSpeedList || mopIntensityList) {
|
|
175437
|
-
|
|
175471
|
+
logger190.info(
|
|
175438
175472
|
`${entityId}: Adding RvcCleanMode (multi-mode, cleaningModeOptions=${JSON.stringify(cleaningModeOptions ?? [])}, fanSpeedList=${JSON.stringify(fanSpeedList ?? [])}, mopIntensityList=${JSON.stringify(mopIntensityList ?? [])})`
|
|
175439
175473
|
);
|
|
175440
175474
|
device = device.with(
|
|
@@ -175447,7 +175481,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, minimalClusters
|
|
|
175447
175481
|
)
|
|
175448
175482
|
);
|
|
175449
175483
|
} else {
|
|
175450
|
-
|
|
175484
|
+
logger190.info(`${entityId}: Adding RvcCleanMode (default single-mode)`);
|
|
175451
175485
|
device = device.with(createDefaultRvcCleanModeServer());
|
|
175452
175486
|
}
|
|
175453
175487
|
return device;
|
|
@@ -175602,7 +175636,7 @@ var WaterHeaterThermostatServer = ThermostatServer2(
|
|
|
175602
175636
|
);
|
|
175603
175637
|
|
|
175604
175638
|
// src/matter/endpoints/legacy/water-heater/index.ts
|
|
175605
|
-
var
|
|
175639
|
+
var logger191 = Logger.get("WaterHeaterDevice");
|
|
175606
175640
|
var WaterHeaterDeviceType = ThermostatDevice.with(
|
|
175607
175641
|
BasicInformationServer2,
|
|
175608
175642
|
IdentifyServer2,
|
|
@@ -175618,7 +175652,7 @@ function toMatterTemp2(value) {
|
|
|
175618
175652
|
}
|
|
175619
175653
|
function WaterHeaterDevice(homeAssistantEntity) {
|
|
175620
175654
|
const attributes7 = homeAssistantEntity.entity.state.attributes;
|
|
175621
|
-
|
|
175655
|
+
logger191.debug(
|
|
175622
175656
|
`Creating device for ${homeAssistantEntity.entity.entity_id}, min_temp=${attributes7.min_temp}, max_temp=${attributes7.max_temp}`
|
|
175623
175657
|
);
|
|
175624
175658
|
const minLimit = toMatterTemp2(attributes7.min_temp) ?? 0;
|
|
@@ -175668,6 +175702,7 @@ function createLegacyEndpointType(entity, mapping, areaName, options) {
|
|
|
175668
175702
|
if (!type) {
|
|
175669
175703
|
return void 0;
|
|
175670
175704
|
}
|
|
175705
|
+
validateEndpointType(type, entity.entity_id);
|
|
175671
175706
|
if (areaName) {
|
|
175672
175707
|
type = addFixedLabel(type, areaName);
|
|
175673
175708
|
}
|
|
@@ -175808,7 +175843,7 @@ var matterDeviceTypeFactories = {
|
|
|
175808
175843
|
};
|
|
175809
175844
|
|
|
175810
175845
|
// src/matter/endpoints/legacy/legacy-endpoint.ts
|
|
175811
|
-
var
|
|
175846
|
+
var logger192 = Logger.get("LegacyEndpoint");
|
|
175812
175847
|
var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
175813
175848
|
static async create(registry2, entityId, mapping) {
|
|
175814
175849
|
const deviceRegistry = registry2.deviceOf(entityId);
|
|
@@ -175818,25 +175853,25 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
175818
175853
|
return;
|
|
175819
175854
|
}
|
|
175820
175855
|
if (registry2.isAutoBatteryMappingEnabled() && registry2.isBatteryEntityUsed(entityId)) {
|
|
175821
|
-
|
|
175856
|
+
logger192.debug(
|
|
175822
175857
|
`Skipping ${entityId} - already auto-assigned as battery to another device`
|
|
175823
175858
|
);
|
|
175824
175859
|
return;
|
|
175825
175860
|
}
|
|
175826
175861
|
if (registry2.isAutoHumidityMappingEnabled() && registry2.isHumidityEntityUsed(entityId)) {
|
|
175827
|
-
|
|
175862
|
+
logger192.debug(
|
|
175828
175863
|
`Skipping ${entityId} - already auto-assigned as humidity to a temperature sensor`
|
|
175829
175864
|
);
|
|
175830
175865
|
return;
|
|
175831
175866
|
}
|
|
175832
175867
|
if (registry2.isAutoPressureMappingEnabled() && registry2.isPressureEntityUsed(entityId)) {
|
|
175833
|
-
|
|
175868
|
+
logger192.debug(
|
|
175834
175869
|
`Skipping ${entityId} - already auto-assigned as pressure to a temperature sensor`
|
|
175835
175870
|
);
|
|
175836
175871
|
return;
|
|
175837
175872
|
}
|
|
175838
175873
|
if (registry2.isAutoComposedDevicesEnabled() && registry2.isComposedSubEntityUsed(entityId)) {
|
|
175839
|
-
|
|
175874
|
+
logger192.debug(
|
|
175840
175875
|
`Skipping ${entityId} - already consumed by a composed device`
|
|
175841
175876
|
);
|
|
175842
175877
|
return;
|
|
@@ -175856,7 +175891,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
175856
175891
|
humidityEntity: humidityEntityId
|
|
175857
175892
|
};
|
|
175858
175893
|
registry2.markHumidityEntityUsed(humidityEntityId);
|
|
175859
|
-
|
|
175894
|
+
logger192.debug(
|
|
175860
175895
|
`Auto-assigned humidity ${humidityEntityId} to ${entityId}`
|
|
175861
175896
|
);
|
|
175862
175897
|
}
|
|
@@ -175875,7 +175910,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
175875
175910
|
pressureEntity: pressureEntityId
|
|
175876
175911
|
};
|
|
175877
175912
|
registry2.markPressureEntityUsed(pressureEntityId);
|
|
175878
|
-
|
|
175913
|
+
logger192.debug(
|
|
175879
175914
|
`Auto-assigned pressure ${pressureEntityId} to ${entityId}`
|
|
175880
175915
|
);
|
|
175881
175916
|
}
|
|
@@ -175892,7 +175927,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
175892
175927
|
batteryEntity: batteryEntityId
|
|
175893
175928
|
};
|
|
175894
175929
|
registry2.markBatteryEntityUsed(batteryEntityId);
|
|
175895
|
-
|
|
175930
|
+
logger192.debug(
|
|
175896
175931
|
`Auto-assigned battery ${batteryEntityId} to ${entityId}`
|
|
175897
175932
|
);
|
|
175898
175933
|
}
|
|
@@ -175910,7 +175945,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
175910
175945
|
powerEntity: powerEntityId
|
|
175911
175946
|
};
|
|
175912
175947
|
registry2.markPowerEntityUsed(powerEntityId);
|
|
175913
|
-
|
|
175948
|
+
logger192.debug(`Auto-assigned power ${powerEntityId} to ${entityId}`);
|
|
175914
175949
|
}
|
|
175915
175950
|
}
|
|
175916
175951
|
}
|
|
@@ -175927,7 +175962,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
175927
175962
|
energyEntity: energyEntityId
|
|
175928
175963
|
};
|
|
175929
175964
|
registry2.markEnergyEntityUsed(energyEntityId);
|
|
175930
|
-
|
|
175965
|
+
logger192.debug(
|
|
175931
175966
|
`Auto-assigned energy ${energyEntityId} to ${entityId}`
|
|
175932
175967
|
);
|
|
175933
175968
|
}
|
|
@@ -175943,7 +175978,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
175943
175978
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
175944
175979
|
cleaningModeEntity: vacuumEntities.cleaningModeEntity
|
|
175945
175980
|
};
|
|
175946
|
-
|
|
175981
|
+
logger192.debug(
|
|
175947
175982
|
`Auto-assigned cleaningMode ${vacuumEntities.cleaningModeEntity} to ${entityId}`
|
|
175948
175983
|
);
|
|
175949
175984
|
}
|
|
@@ -175953,7 +175988,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
175953
175988
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
175954
175989
|
suctionLevelEntity: vacuumEntities.suctionLevelEntity
|
|
175955
175990
|
};
|
|
175956
|
-
|
|
175991
|
+
logger192.debug(
|
|
175957
175992
|
`Auto-assigned suctionLevel ${vacuumEntities.suctionLevelEntity} to ${entityId}`
|
|
175958
175993
|
);
|
|
175959
175994
|
}
|
|
@@ -175963,7 +175998,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
175963
175998
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
175964
175999
|
mopIntensityEntity: vacuumEntities.mopIntensityEntity
|
|
175965
176000
|
};
|
|
175966
|
-
|
|
176001
|
+
logger192.debug(
|
|
175967
176002
|
`Auto-assigned mopIntensity ${vacuumEntities.mopIntensityEntity} to ${entityId}`
|
|
175968
176003
|
);
|
|
175969
176004
|
}
|
|
@@ -175984,7 +176019,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
175984
176019
|
rooms: roomsObj
|
|
175985
176020
|
}
|
|
175986
176021
|
};
|
|
175987
|
-
|
|
176022
|
+
logger192.debug(
|
|
175988
176023
|
`Auto-detected ${valetudoRooms.length} Valetudo segments for ${entityId}`
|
|
175989
176024
|
);
|
|
175990
176025
|
} else {
|
|
@@ -176001,7 +176036,7 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
176001
176036
|
rooms: roomsObj
|
|
176002
176037
|
}
|
|
176003
176038
|
};
|
|
176004
|
-
|
|
176039
|
+
logger192.debug(
|
|
176005
176040
|
`Auto-detected ${roborockRooms.length} Roborock rooms for ${entityId}`
|
|
176006
176041
|
);
|
|
176007
176042
|
}
|
|
@@ -176103,11 +176138,11 @@ var LegacyEndpoint = class _LegacyEndpoint extends EntityEndpoint {
|
|
|
176103
176138
|
return;
|
|
176104
176139
|
}
|
|
176105
176140
|
if (mappedChanged) {
|
|
176106
|
-
|
|
176141
|
+
logger192.debug(
|
|
176107
176142
|
`Mapped entity change detected for ${this.entityId}, forcing update`
|
|
176108
176143
|
);
|
|
176109
176144
|
}
|
|
176110
|
-
|
|
176145
|
+
logger192.debug(
|
|
176111
176146
|
`State update received for ${this.entityId}: state=${state.state}`
|
|
176112
176147
|
);
|
|
176113
176148
|
this.lastState = state;
|
|
@@ -176146,7 +176181,7 @@ import {
|
|
|
176146
176181
|
getCollection
|
|
176147
176182
|
} from "home-assistant-js-websocket";
|
|
176148
176183
|
import { atLeastHaVersion } from "home-assistant-js-websocket/dist/util.js";
|
|
176149
|
-
var
|
|
176184
|
+
var logger193 = Logger.get("SubscribeEntities");
|
|
176150
176185
|
function processEvent(store, updates) {
|
|
176151
176186
|
const state = { ...store.state };
|
|
176152
176187
|
if (updates.a) {
|
|
@@ -176172,7 +176207,7 @@ function processEvent(store, updates) {
|
|
|
176172
176207
|
for (const entityId in updates.c) {
|
|
176173
176208
|
let entityState = state[entityId];
|
|
176174
176209
|
if (!entityState) {
|
|
176175
|
-
|
|
176210
|
+
logger193.warn("Received state update for unknown entity", entityId);
|
|
176176
176211
|
continue;
|
|
176177
176212
|
}
|
|
176178
176213
|
entityState = { ...entityState };
|
|
@@ -176242,7 +176277,7 @@ var subscribeEntities = (conn, onChange, entityIds) => entitiesColl(conn, entity
|
|
|
176242
176277
|
|
|
176243
176278
|
// src/services/bridges/entity-isolation-service.ts
|
|
176244
176279
|
init_esm();
|
|
176245
|
-
var
|
|
176280
|
+
var logger194 = Logger.get("EntityIsolation");
|
|
176246
176281
|
var EntityIsolationServiceImpl = class {
|
|
176247
176282
|
isolatedEntities = /* @__PURE__ */ new Map();
|
|
176248
176283
|
isolationCallbacks = /* @__PURE__ */ new Map();
|
|
@@ -176307,13 +176342,13 @@ var EntityIsolationServiceImpl = class {
|
|
|
176307
176342
|
}
|
|
176308
176343
|
const parsed = this.parseEndpointPath(msg);
|
|
176309
176344
|
if (!parsed) {
|
|
176310
|
-
|
|
176345
|
+
logger194.warn("Could not parse entity from error:", msg);
|
|
176311
176346
|
return false;
|
|
176312
176347
|
}
|
|
176313
176348
|
const { bridgeId, entityName } = parsed;
|
|
176314
176349
|
const callback = this.isolationCallbacks.get(bridgeId);
|
|
176315
176350
|
if (!callback) {
|
|
176316
|
-
|
|
176351
|
+
logger194.warn(
|
|
176317
176352
|
`No isolation callback registered for bridge ${bridgeId}, entity: ${entityName}`
|
|
176318
176353
|
);
|
|
176319
176354
|
return false;
|
|
@@ -176324,14 +176359,14 @@ var EntityIsolationServiceImpl = class {
|
|
|
176324
176359
|
}
|
|
176325
176360
|
const reason = `${classification}. Entity isolated to protect bridge stability.`;
|
|
176326
176361
|
this.isolatedEntities.set(key, { entityId: entityName, reason });
|
|
176327
|
-
|
|
176362
|
+
logger194.warn(
|
|
176328
176363
|
`Isolating entity "${entityName}" from bridge ${bridgeId} due to: ${reason}`
|
|
176329
176364
|
);
|
|
176330
176365
|
try {
|
|
176331
176366
|
await callback(entityName);
|
|
176332
176367
|
return true;
|
|
176333
176368
|
} catch (e) {
|
|
176334
|
-
|
|
176369
|
+
logger194.error(`Failed to isolate entity ${entityName}:`, e);
|
|
176335
176370
|
return false;
|
|
176336
176371
|
}
|
|
176337
176372
|
}
|
|
@@ -177210,11 +177245,11 @@ var BridgeRegistry = class _BridgeRegistry {
|
|
|
177210
177245
|
init_dist();
|
|
177211
177246
|
var AUTO_FORCE_SYNC_INTERVAL_MS2 = 9e4;
|
|
177212
177247
|
var ServerModeBridge = class {
|
|
177213
|
-
constructor(
|
|
177248
|
+
constructor(logger197, dataProvider, endpointManager, server) {
|
|
177214
177249
|
this.dataProvider = dataProvider;
|
|
177215
177250
|
this.endpointManager = endpointManager;
|
|
177216
177251
|
this.server = server;
|
|
177217
|
-
this.log =
|
|
177252
|
+
this.log = logger197.get(`ServerModeBridge / ${dataProvider.id}`);
|
|
177218
177253
|
}
|
|
177219
177254
|
log;
|
|
177220
177255
|
status = {
|
|
@@ -177616,7 +177651,7 @@ function ServerModeVacuumDevice(homeAssistantEntity, includeOnOff = false, minim
|
|
|
177616
177651
|
}
|
|
177617
177652
|
|
|
177618
177653
|
// src/matter/endpoints/server-mode-vacuum-endpoint.ts
|
|
177619
|
-
var
|
|
177654
|
+
var logger195 = Logger.get("ServerModeVacuumEndpoint");
|
|
177620
177655
|
var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEndpoint {
|
|
177621
177656
|
static async create(registry2, entityId, mapping) {
|
|
177622
177657
|
const deviceRegistry = registry2.deviceOf(entityId);
|
|
@@ -177626,7 +177661,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
177626
177661
|
return void 0;
|
|
177627
177662
|
}
|
|
177628
177663
|
let effectiveMapping = mapping;
|
|
177629
|
-
|
|
177664
|
+
logger195.info(
|
|
177630
177665
|
`${entityId}: device_id=${entity.device_id}, manualBattery=${mapping?.batteryEntity ?? "none"}`
|
|
177631
177666
|
);
|
|
177632
177667
|
if (entity.device_id) {
|
|
@@ -177641,9 +177676,9 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
177641
177676
|
batteryEntity: batteryEntityId
|
|
177642
177677
|
};
|
|
177643
177678
|
registry2.markBatteryEntityUsed(batteryEntityId);
|
|
177644
|
-
|
|
177679
|
+
logger195.info(`${entityId}: Auto-assigned battery ${batteryEntityId}`);
|
|
177645
177680
|
} else {
|
|
177646
|
-
|
|
177681
|
+
logger195.warn(
|
|
177647
177682
|
`${entityId}: No battery entity found for device ${entity.device_id}`
|
|
177648
177683
|
);
|
|
177649
177684
|
}
|
|
@@ -177657,7 +177692,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
177657
177692
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
177658
177693
|
cleaningModeEntity: vacuumEntities.cleaningModeEntity
|
|
177659
177694
|
};
|
|
177660
|
-
|
|
177695
|
+
logger195.info(
|
|
177661
177696
|
`${entityId}: Auto-assigned cleaningMode ${vacuumEntities.cleaningModeEntity}`
|
|
177662
177697
|
);
|
|
177663
177698
|
}
|
|
@@ -177667,7 +177702,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
177667
177702
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
177668
177703
|
suctionLevelEntity: vacuumEntities.suctionLevelEntity
|
|
177669
177704
|
};
|
|
177670
|
-
|
|
177705
|
+
logger195.info(
|
|
177671
177706
|
`${entityId}: Auto-assigned suctionLevel ${vacuumEntities.suctionLevelEntity}`
|
|
177672
177707
|
);
|
|
177673
177708
|
}
|
|
@@ -177677,7 +177712,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
177677
177712
|
entityId: effectiveMapping?.entityId ?? entityId,
|
|
177678
177713
|
mopIntensityEntity: vacuumEntities.mopIntensityEntity
|
|
177679
177714
|
};
|
|
177680
|
-
|
|
177715
|
+
logger195.info(
|
|
177681
177716
|
`${entityId}: Auto-assigned mopIntensity ${vacuumEntities.mopIntensityEntity}`
|
|
177682
177717
|
);
|
|
177683
177718
|
}
|
|
@@ -177698,7 +177733,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
177698
177733
|
rooms: roomsObj
|
|
177699
177734
|
}
|
|
177700
177735
|
};
|
|
177701
|
-
|
|
177736
|
+
logger195.info(
|
|
177702
177737
|
`${entityId}: Auto-detected ${valetudoRooms.length} Valetudo segments`
|
|
177703
177738
|
);
|
|
177704
177739
|
} else {
|
|
@@ -177715,14 +177750,14 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
177715
177750
|
rooms: roomsObj
|
|
177716
177751
|
}
|
|
177717
177752
|
};
|
|
177718
|
-
|
|
177753
|
+
logger195.info(
|
|
177719
177754
|
`${entityId}: Auto-detected ${roborockRooms.length} Roborock rooms`
|
|
177720
177755
|
);
|
|
177721
177756
|
}
|
|
177722
177757
|
}
|
|
177723
177758
|
}
|
|
177724
177759
|
} else {
|
|
177725
|
-
|
|
177760
|
+
logger195.warn(`${entityId}: No device_id \u2014 cannot auto-assign battery`);
|
|
177726
177761
|
}
|
|
177727
177762
|
const payload = {
|
|
177728
177763
|
entity_id: entityId,
|
|
@@ -177785,11 +177820,11 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
|
|
|
177785
177820
|
return;
|
|
177786
177821
|
}
|
|
177787
177822
|
if (mappedChanged) {
|
|
177788
|
-
|
|
177823
|
+
logger195.debug(
|
|
177789
177824
|
`Mapped entity change detected for ${this.entityId}, forcing update`
|
|
177790
177825
|
);
|
|
177791
177826
|
}
|
|
177792
|
-
|
|
177827
|
+
logger195.debug(
|
|
177793
177828
|
`State update received for ${this.entityId}: state=${state.state}`
|
|
177794
177829
|
);
|
|
177795
177830
|
this.lastState = state;
|
|
@@ -178179,10 +178214,10 @@ var BridgeEnvironmentFactory = class extends BridgeFactory {
|
|
|
178179
178214
|
// src/core/ioc/app-environment.ts
|
|
178180
178215
|
var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
|
|
178181
178216
|
constructor(rootEnv, options) {
|
|
178182
|
-
const
|
|
178217
|
+
const logger197 = rootEnv.get(LoggerService);
|
|
178183
178218
|
super({
|
|
178184
178219
|
id: "App",
|
|
178185
|
-
log:
|
|
178220
|
+
log: logger197.get("AppContainer"),
|
|
178186
178221
|
parent: rootEnv
|
|
178187
178222
|
});
|
|
178188
178223
|
this.options = options;
|
|
@@ -178195,8 +178230,8 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
|
|
|
178195
178230
|
}
|
|
178196
178231
|
construction;
|
|
178197
178232
|
async init() {
|
|
178198
|
-
const
|
|
178199
|
-
this.set(LoggerService,
|
|
178233
|
+
const logger197 = this.get(LoggerService);
|
|
178234
|
+
this.set(LoggerService, logger197);
|
|
178200
178235
|
this.set(AppStorage, new AppStorage(await this.load(StorageService)));
|
|
178201
178236
|
this.set(BridgeStorage, new BridgeStorage(await this.load(AppStorage)));
|
|
178202
178237
|
this.set(
|
|
@@ -178213,7 +178248,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
|
|
|
178213
178248
|
);
|
|
178214
178249
|
this.set(
|
|
178215
178250
|
HomeAssistantClient,
|
|
178216
|
-
new HomeAssistantClient(
|
|
178251
|
+
new HomeAssistantClient(logger197, this.options.homeAssistant)
|
|
178217
178252
|
);
|
|
178218
178253
|
this.set(
|
|
178219
178254
|
HomeAssistantConfig,
|
|
@@ -178221,7 +178256,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
|
|
|
178221
178256
|
);
|
|
178222
178257
|
this.set(
|
|
178223
178258
|
HomeAssistantActions,
|
|
178224
|
-
new HomeAssistantActions(
|
|
178259
|
+
new HomeAssistantActions(logger197, await this.load(HomeAssistantClient))
|
|
178225
178260
|
);
|
|
178226
178261
|
this.set(
|
|
178227
178262
|
HomeAssistantRegistry,
|
|
@@ -178242,7 +178277,7 @@ var AppEnvironment = class _AppEnvironment extends EnvironmentBase {
|
|
|
178242
178277
|
this.set(
|
|
178243
178278
|
WebApi,
|
|
178244
178279
|
new WebApi(
|
|
178245
|
-
|
|
178280
|
+
logger197,
|
|
178246
178281
|
await this.load(BridgeService),
|
|
178247
178282
|
await this.load(HomeAssistantClient),
|
|
178248
178283
|
await this.load(HomeAssistantRegistry),
|
|
@@ -178267,7 +178302,7 @@ init_nodejs();
|
|
|
178267
178302
|
init_level_control();
|
|
178268
178303
|
|
|
178269
178304
|
// src/matter/patches/patch-level-control-tlv.ts
|
|
178270
|
-
var
|
|
178305
|
+
var logger196 = Logger.get("PatchLevelControlTlv");
|
|
178271
178306
|
function patchLevelControlTlv() {
|
|
178272
178307
|
let patched = 0;
|
|
178273
178308
|
const moveToLevelFields = LevelControl3.TlvMoveToLevelRequest.fieldDefinitions;
|
|
@@ -178281,11 +178316,11 @@ function patchLevelControlTlv() {
|
|
|
178281
178316
|
patched++;
|
|
178282
178317
|
}
|
|
178283
178318
|
if (patched > 0) {
|
|
178284
|
-
|
|
178319
|
+
logger196.info(
|
|
178285
178320
|
`Patched ${patched} LevelControl TLV schema(s): transitionTime is now optional (Google Home compatibility)`
|
|
178286
178321
|
);
|
|
178287
178322
|
} else {
|
|
178288
|
-
|
|
178323
|
+
logger196.warn(
|
|
178289
178324
|
"Failed to patch LevelControl TLV schemas \u2014 field definitions not found. Google Home brightness adjustment may not work."
|
|
178290
178325
|
);
|
|
178291
178326
|
}
|