@riddix/hamh 2.1.0-alpha.665 → 2.1.0-alpha.667
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
|
@@ -148898,6 +148898,7 @@ function entityMappingApi(mappingStorage) {
|
|
|
148898
148898
|
coverSliderDebounceMs: body.coverSliderDebounceMs,
|
|
148899
148899
|
disableClimateOnOff: body.disableClimateOnOff,
|
|
148900
148900
|
disableClimateFanControl: body.disableClimateFanControl,
|
|
148901
|
+
climateKeepModeOnIdle: body.climateKeepModeOnIdle,
|
|
148901
148902
|
composedEntities: body.composedEntities
|
|
148902
148903
|
};
|
|
148903
148904
|
const config10 = await mappingStorage.setMapping(request);
|
|
@@ -149363,7 +149364,8 @@ function configToProfileEntry(config10) {
|
|
|
149363
149364
|
coverSwapOpenClose: config10.coverSwapOpenClose,
|
|
149364
149365
|
coverSliderDebounceMs: config10.coverSliderDebounceMs,
|
|
149365
149366
|
disableClimateOnOff: config10.disableClimateOnOff,
|
|
149366
|
-
disableClimateFanControl: config10.disableClimateFanControl
|
|
149367
|
+
disableClimateFanControl: config10.disableClimateFanControl,
|
|
149368
|
+
climateKeepModeOnIdle: config10.climateKeepModeOnIdle
|
|
149367
149369
|
};
|
|
149368
149370
|
}
|
|
149369
149371
|
function mappingProfileApi(mappingStorage) {
|
|
@@ -149487,7 +149489,8 @@ function mappingProfileApi(mappingStorage) {
|
|
|
149487
149489
|
coverSwapOpenClose: entry.coverSwapOpenClose,
|
|
149488
149490
|
coverSliderDebounceMs: entry.coverSliderDebounceMs,
|
|
149489
149491
|
disableClimateOnOff: entry.disableClimateOnOff,
|
|
149490
|
-
disableClimateFanControl: entry.disableClimateFanControl
|
|
149492
|
+
disableClimateFanControl: entry.disableClimateFanControl,
|
|
149493
|
+
climateKeepModeOnIdle: entry.climateKeepModeOnIdle
|
|
149491
149494
|
});
|
|
149492
149495
|
applied++;
|
|
149493
149496
|
} catch (e) {
|
|
@@ -153459,9 +153462,10 @@ var EntityMappingStorage = class extends Service {
|
|
|
153459
153462
|
coverSliderDebounceMs: sanitizeDebounceMs(request.coverSliderDebounceMs),
|
|
153460
153463
|
disableClimateOnOff: request.disableClimateOnOff || void 0,
|
|
153461
153464
|
disableClimateFanControl: request.disableClimateFanControl || void 0,
|
|
153465
|
+
climateKeepModeOnIdle: request.climateKeepModeOnIdle || void 0,
|
|
153462
153466
|
composedEntities: request.composedEntities?.filter((e) => e.entityId?.trim()) ?? void 0
|
|
153463
153467
|
};
|
|
153464
|
-
if (!config10.matterDeviceType && !config10.customName && !config10.customProductName && !config10.customVendorName && !config10.customSerialNumber && config10.customVendorId === void 0 && config10.disabled !== true && !config10.filterLifeEntity && !config10.cleaningModeEntity && !config10.temperatureEntity && !config10.humidityEntity && !config10.batteryEntity && !config10.roomEntities && !config10.disableLockPin && !config10.powerEntity && !config10.energyEntity && !config10.pressureEntity && !config10.suctionLevelEntity && !config10.mopIntensityEntity && (!config10.customServiceAreas || config10.customServiceAreas.length === 0) && (!config10.customFanSpeedTags || Object.keys(config10.customFanSpeedTags).length === 0) && !config10.currentRoomEntity && !config10.valetudoIdentifier && !config10.coverSwapOpenClose && !config10.coverSliderDebounceMs && !config10.disableClimateOnOff && !config10.disableClimateFanControl && (!config10.composedEntities || config10.composedEntities.length === 0)) {
|
|
153468
|
+
if (!config10.matterDeviceType && !config10.customName && !config10.customProductName && !config10.customVendorName && !config10.customSerialNumber && config10.customVendorId === void 0 && config10.disabled !== true && !config10.filterLifeEntity && !config10.cleaningModeEntity && !config10.temperatureEntity && !config10.humidityEntity && !config10.batteryEntity && !config10.roomEntities && !config10.disableLockPin && !config10.powerEntity && !config10.energyEntity && !config10.pressureEntity && !config10.suctionLevelEntity && !config10.mopIntensityEntity && (!config10.customServiceAreas || config10.customServiceAreas.length === 0) && (!config10.customFanSpeedTags || Object.keys(config10.customFanSpeedTags).length === 0) && !config10.currentRoomEntity && !config10.valetudoIdentifier && !config10.coverSwapOpenClose && !config10.coverSliderDebounceMs && !config10.disableClimateOnOff && !config10.disableClimateFanControl && !config10.climateKeepModeOnIdle && (!config10.composedEntities || config10.composedEntities.length === 0)) {
|
|
153465
153469
|
bridgeMap.delete(request.entityId);
|
|
153466
153470
|
} else {
|
|
153467
153471
|
bridgeMap.set(request.entityId, config10);
|
|
@@ -171928,6 +171932,7 @@ function isHeatCoolOnly(modes) {
|
|
|
171928
171932
|
return modes.includes(ClimateHvacMode.heat_cool) && !modes.includes(ClimateHvacMode.heat) && !modes.includes(ClimateHvacMode.cool);
|
|
171929
171933
|
}
|
|
171930
171934
|
var lastHvacDirection = /* @__PURE__ */ new Map();
|
|
171935
|
+
var lastNonOffSystemMode = /* @__PURE__ */ new Map();
|
|
171931
171936
|
function getHeatCoolOnlyDirection(entity, agent) {
|
|
171932
171937
|
const action = attributes4(entity).hvac_action;
|
|
171933
171938
|
const homeAssistant = agent.get(HomeAssistantEntityBehavior);
|
|
@@ -171942,6 +171947,60 @@ function getHeatCoolOnlyDirection(entity, agent) {
|
|
|
171942
171947
|
}
|
|
171943
171948
|
return lastHvacDirection.get(entityId) ?? "heating";
|
|
171944
171949
|
}
|
|
171950
|
+
function computeSystemMode(entity, agent) {
|
|
171951
|
+
const hvacMode = entity.state;
|
|
171952
|
+
const systemMode = hvacModeToSystemMode[hvacMode] ?? Thermostat3.SystemMode.Off;
|
|
171953
|
+
if (systemMode === Thermostat3.SystemMode.Auto) {
|
|
171954
|
+
const modes = attributes4(entity).hvac_modes ?? [];
|
|
171955
|
+
if (isHeatCoolOnly(modes)) {
|
|
171956
|
+
const direction = getHeatCoolOnlyDirection(entity, agent);
|
|
171957
|
+
return direction === "cooling" ? Thermostat3.SystemMode.Cool : Thermostat3.SystemMode.Heat;
|
|
171958
|
+
}
|
|
171959
|
+
const hasMatterAuto = modes.includes(ClimateHvacMode.heat_cool) && (modes.includes(ClimateHvacMode.heat) || modes.includes(ClimateHvacMode.cool));
|
|
171960
|
+
if (hasMatterAuto) {
|
|
171961
|
+
return systemMode;
|
|
171962
|
+
}
|
|
171963
|
+
const hasCooling = modes.some((m) => m === ClimateHvacMode.cool);
|
|
171964
|
+
const hasHeating = modes.some(
|
|
171965
|
+
(m) => m === ClimateHvacMode.heat || m === ClimateHvacMode.auto
|
|
171966
|
+
);
|
|
171967
|
+
if (hasHeating && !hasCooling) {
|
|
171968
|
+
return Thermostat3.SystemMode.Heat;
|
|
171969
|
+
}
|
|
171970
|
+
if (hasCooling && !hasHeating) {
|
|
171971
|
+
return Thermostat3.SystemMode.Cool;
|
|
171972
|
+
}
|
|
171973
|
+
const homeAssistant = agent.get(HomeAssistantEntityBehavior);
|
|
171974
|
+
const entityId = homeAssistant.entityId;
|
|
171975
|
+
const action = attributes4(entity).hvac_action;
|
|
171976
|
+
if (action === ClimateHvacAction.cooling) {
|
|
171977
|
+
lastHvacDirection.set(entityId, "cooling");
|
|
171978
|
+
return Thermostat3.SystemMode.Cool;
|
|
171979
|
+
}
|
|
171980
|
+
if (action === ClimateHvacAction.heating) {
|
|
171981
|
+
lastHvacDirection.set(entityId, "heating");
|
|
171982
|
+
return Thermostat3.SystemMode.Heat;
|
|
171983
|
+
}
|
|
171984
|
+
const remembered = lastHvacDirection.get(entityId);
|
|
171985
|
+
if (remembered) {
|
|
171986
|
+
return remembered === "cooling" ? Thermostat3.SystemMode.Cool : Thermostat3.SystemMode.Heat;
|
|
171987
|
+
}
|
|
171988
|
+
const current = attributes4(entity).current_temperature;
|
|
171989
|
+
const target = attributes4(entity).temperature;
|
|
171990
|
+
if (typeof current === "number" && typeof target === "number") {
|
|
171991
|
+
if (current > target) {
|
|
171992
|
+
lastHvacDirection.set(entityId, "cooling");
|
|
171993
|
+
return Thermostat3.SystemMode.Cool;
|
|
171994
|
+
}
|
|
171995
|
+
if (current < target) {
|
|
171996
|
+
lastHvacDirection.set(entityId, "heating");
|
|
171997
|
+
return Thermostat3.SystemMode.Heat;
|
|
171998
|
+
}
|
|
171999
|
+
}
|
|
172000
|
+
return Thermostat3.SystemMode.Cool;
|
|
172001
|
+
}
|
|
172002
|
+
return systemMode;
|
|
172003
|
+
}
|
|
171945
172004
|
var config4 = {
|
|
171946
172005
|
// Temperature range (target_temp_low/high) only works in heat_cool mode.
|
|
171947
172006
|
// In heat or cool mode, HA expects a single "temperature" value.
|
|
@@ -171961,58 +172020,20 @@ var config4 = {
|
|
|
171961
172020
|
getTargetHeatingTemperature: (entity, agent) => getTemp(agent, entity, "target_temp_low") ?? getTemp(agent, entity, "target_temperature") ?? getTemp(agent, entity, "temperature"),
|
|
171962
172021
|
getTargetCoolingTemperature: (entity, agent) => getTemp(agent, entity, "target_temp_high") ?? getTemp(agent, entity, "target_temperature") ?? getTemp(agent, entity, "temperature"),
|
|
171963
172022
|
getSystemMode: (entity, agent) => {
|
|
171964
|
-
const
|
|
171965
|
-
const
|
|
171966
|
-
|
|
171967
|
-
|
|
171968
|
-
|
|
171969
|
-
|
|
171970
|
-
|
|
171971
|
-
|
|
171972
|
-
const
|
|
171973
|
-
if (
|
|
171974
|
-
return
|
|
171975
|
-
}
|
|
171976
|
-
const hasCooling = modes.some((m) => m === ClimateHvacMode.cool);
|
|
171977
|
-
const hasHeating = modes.some(
|
|
171978
|
-
(m) => m === ClimateHvacMode.heat || m === ClimateHvacMode.auto
|
|
171979
|
-
);
|
|
171980
|
-
if (hasHeating && !hasCooling) {
|
|
171981
|
-
return Thermostat3.SystemMode.Heat;
|
|
171982
|
-
}
|
|
171983
|
-
if (hasCooling && !hasHeating) {
|
|
171984
|
-
return Thermostat3.SystemMode.Cool;
|
|
171985
|
-
}
|
|
171986
|
-
const homeAssistant = agent.get(HomeAssistantEntityBehavior);
|
|
171987
|
-
const entityId = homeAssistant.entityId;
|
|
171988
|
-
const action = attributes4(entity).hvac_action;
|
|
171989
|
-
if (action === ClimateHvacAction.cooling) {
|
|
171990
|
-
lastHvacDirection.set(entityId, "cooling");
|
|
171991
|
-
return Thermostat3.SystemMode.Cool;
|
|
171992
|
-
}
|
|
171993
|
-
if (action === ClimateHvacAction.heating) {
|
|
171994
|
-
lastHvacDirection.set(entityId, "heating");
|
|
171995
|
-
return Thermostat3.SystemMode.Heat;
|
|
171996
|
-
}
|
|
171997
|
-
const remembered = lastHvacDirection.get(entityId);
|
|
171998
|
-
if (remembered) {
|
|
171999
|
-
return remembered === "cooling" ? Thermostat3.SystemMode.Cool : Thermostat3.SystemMode.Heat;
|
|
172000
|
-
}
|
|
172001
|
-
const current = attributes4(entity).current_temperature;
|
|
172002
|
-
const target = attributes4(entity).temperature;
|
|
172003
|
-
if (typeof current === "number" && typeof target === "number") {
|
|
172004
|
-
if (current > target) {
|
|
172005
|
-
lastHvacDirection.set(entityId, "cooling");
|
|
172006
|
-
return Thermostat3.SystemMode.Cool;
|
|
172007
|
-
}
|
|
172008
|
-
if (current < target) {
|
|
172009
|
-
lastHvacDirection.set(entityId, "heating");
|
|
172010
|
-
return Thermostat3.SystemMode.Heat;
|
|
172011
|
-
}
|
|
172023
|
+
const homeAssistant = agent.get(HomeAssistantEntityBehavior);
|
|
172024
|
+
const entityId = homeAssistant.entityId;
|
|
172025
|
+
const computed = computeSystemMode(entity, agent);
|
|
172026
|
+
if (computed !== Thermostat3.SystemMode.Off) {
|
|
172027
|
+
lastNonOffSystemMode.set(entityId, computed);
|
|
172028
|
+
return computed;
|
|
172029
|
+
}
|
|
172030
|
+
if (homeAssistant.state.mapping?.climateKeepModeOnIdle === true && attributes4(entity).hvac_action === ClimateHvacAction.idle) {
|
|
172031
|
+
const remembered = lastNonOffSystemMode.get(entityId);
|
|
172032
|
+
if (remembered !== void 0) {
|
|
172033
|
+
return remembered;
|
|
172012
172034
|
}
|
|
172013
|
-
return Thermostat3.SystemMode.Cool;
|
|
172014
172035
|
}
|
|
172015
|
-
return
|
|
172036
|
+
return computed;
|
|
172016
172037
|
},
|
|
172017
172038
|
getRunningMode: (entity) => {
|
|
172018
172039
|
const action = attributes4(entity).hvac_action;
|
|
@@ -172376,13 +172397,10 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
|
|
|
172376
172397
|
{
|
|
172377
172398
|
type: overrideType ?? (this.features.lift && this.features.tilt ? WindowCovering3.WindowCoveringType.TiltBlindLift : this.features.tilt ? WindowCovering3.WindowCoveringType.TiltBlindTiltOnly : WindowCovering3.WindowCoveringType.Rollershade),
|
|
172378
172399
|
endProductType: overrideEndProduct ?? (this.features.lift && this.features.tilt ? WindowCovering3.EndProductType.SheerShade : this.features.tilt ? WindowCovering3.EndProductType.TiltOnlyInteriorBlind : WindowCovering3.EndProductType.RollerShade),
|
|
172379
|
-
operationalStatus
|
|
172380
|
-
|
|
172381
|
-
|
|
172382
|
-
|
|
172383
|
-
},
|
|
172384
|
-
// Target before current so Apple Home derives the right direction
|
|
172385
|
-
// at the start of an externally-driven movement (#328).
|
|
172400
|
+
// Target before operationalStatus so the wire order matches the
|
|
172401
|
+
// certified Eve MotionBlinds (state, target, current). Patch insertion
|
|
172402
|
+
// order propagates into matter.js's changeList via for-in over values
|
|
172403
|
+
// (Datasource.js:414), then through attrsChanged.emit (#328).
|
|
172386
172404
|
...this.features.positionAwareLift ? {
|
|
172387
172405
|
targetPositionLiftPercent100ths: inferTarget(
|
|
172388
172406
|
currentLift100ths,
|
|
@@ -172395,6 +172413,11 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
|
|
|
172395
172413
|
this.state.targetPositionTiltPercent100ths
|
|
172396
172414
|
)
|
|
172397
172415
|
} : {},
|
|
172416
|
+
operationalStatus: {
|
|
172417
|
+
global: movementStatus,
|
|
172418
|
+
...this.features.lift ? { lift: movementStatus } : {},
|
|
172419
|
+
...this.features.tilt ? { tilt: movementStatus } : {}
|
|
172420
|
+
},
|
|
172398
172421
|
...this.features.positionAwareLift && !startedMoving ? {
|
|
172399
172422
|
currentPositionLiftPercent100ths: currentLift100ths
|
|
172400
172423
|
} : {},
|