@riddix/hamh 2.1.0-alpha.607 → 2.1.0-alpha.609
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
|
@@ -151488,6 +151488,9 @@ var WebApi = class extends Service {
|
|
|
151488
151488
|
realm: "Home Assistant Matter Hub"
|
|
151489
151489
|
});
|
|
151490
151490
|
return (req, res, next) => {
|
|
151491
|
+
if (req.path === "/api/health/live" || req.path === "/api/health/ready") {
|
|
151492
|
+
return next();
|
|
151493
|
+
}
|
|
151491
151494
|
if (envMiddleware) {
|
|
151492
151495
|
return envMiddleware(req, res, next);
|
|
151493
151496
|
}
|
|
@@ -174478,14 +174481,20 @@ function getSelectOptions(entity) {
|
|
|
174478
174481
|
const attrs = entity.state.attributes;
|
|
174479
174482
|
return attrs.options ?? [];
|
|
174480
174483
|
}
|
|
174481
|
-
|
|
174482
|
-
|
|
174483
|
-
|
|
174484
|
-
|
|
174485
|
-
|
|
174486
|
-
|
|
174487
|
-
|
|
174488
|
-
})
|
|
174484
|
+
function buildSelectModeServer(action) {
|
|
174485
|
+
return ModeSelectServer2({
|
|
174486
|
+
getOptions: getSelectOptions,
|
|
174487
|
+
getCurrentOption: (entity) => entity.state.state ?? void 0,
|
|
174488
|
+
selectOption: (option) => ({
|
|
174489
|
+
action,
|
|
174490
|
+
data: { option }
|
|
174491
|
+
})
|
|
174492
|
+
});
|
|
174493
|
+
}
|
|
174494
|
+
var SelectModeServer = buildSelectModeServer("select.select_option");
|
|
174495
|
+
var InputSelectModeServer = buildSelectModeServer(
|
|
174496
|
+
"input_select.select_option"
|
|
174497
|
+
);
|
|
174489
174498
|
function buildSupportedModes(options) {
|
|
174490
174499
|
return options.map((label, index) => ({
|
|
174491
174500
|
label: label.length > 64 ? label.substring(0, 64) : label,
|
|
@@ -174499,6 +174508,12 @@ var SelectEndpointType = ModeSelectDevice.with(
|
|
|
174499
174508
|
HomeAssistantEntityBehavior,
|
|
174500
174509
|
SelectModeServer
|
|
174501
174510
|
);
|
|
174511
|
+
var InputSelectEndpointType = ModeSelectDevice.with(
|
|
174512
|
+
BasicInformationServer2,
|
|
174513
|
+
IdentifyServer2,
|
|
174514
|
+
HomeAssistantEntityBehavior,
|
|
174515
|
+
InputSelectModeServer
|
|
174516
|
+
);
|
|
174502
174517
|
function SelectDevice(homeAssistantEntity) {
|
|
174503
174518
|
const attrs = homeAssistantEntity.entity.state.attributes;
|
|
174504
174519
|
const options = attrs.options ?? [];
|
|
@@ -174524,7 +174539,7 @@ function InputSelectDevice(homeAssistantEntity) {
|
|
|
174524
174539
|
}
|
|
174525
174540
|
const currentOption = homeAssistantEntity.entity.state.state;
|
|
174526
174541
|
const currentIndex = currentOption ? options.findIndex((o) => o.toLowerCase() === currentOption.toLowerCase()) : 0;
|
|
174527
|
-
return
|
|
174542
|
+
return InputSelectEndpointType.set({
|
|
174528
174543
|
homeAssistantEntity,
|
|
174529
174544
|
modeSelect: {
|
|
174530
174545
|
description: homeAssistantEntity.customName ?? homeAssistantEntity.entity.state.attributes.friendly_name ?? "Input Select",
|