@riddix/hamh 2.1.0-alpha.581 → 2.1.0-alpha.582
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
|
@@ -172132,12 +172132,7 @@ var GenericSwitchServerBase = class extends FeaturedBase7 {
|
|
|
172132
172132
|
await super.initialize();
|
|
172133
172133
|
const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
|
|
172134
172134
|
const entityId = homeAssistant.entityId;
|
|
172135
|
-
|
|
172136
|
-
const maxPress = this.detectMultiPressMax(attrs.event_types ?? []);
|
|
172137
|
-
this.state.multiPressMax = maxPress;
|
|
172138
|
-
logger180.debug(
|
|
172139
|
-
`[${entityId}] GenericSwitch initialized (multiPressMax: ${maxPress})`
|
|
172140
|
-
);
|
|
172135
|
+
logger180.debug(`[${entityId}] GenericSwitch initialized`);
|
|
172141
172136
|
this.reactTo(homeAssistant.onChange, this.handleEventChange);
|
|
172142
172137
|
}
|
|
172143
172138
|
handleEventChange() {
|
|
@@ -172205,14 +172200,6 @@ var GenericSwitchServerBase = class extends FeaturedBase7 {
|
|
|
172205
172200
|
isLongRelease(lower) {
|
|
172206
172201
|
return lower.includes("long") && lower.includes("release");
|
|
172207
172202
|
}
|
|
172208
|
-
detectMultiPressMax(eventTypes) {
|
|
172209
|
-
let max = 1;
|
|
172210
|
-
for (const et of eventTypes) {
|
|
172211
|
-
const count = this.getPressCount(et.toLowerCase());
|
|
172212
|
-
if (count > max) max = count;
|
|
172213
|
-
}
|
|
172214
|
-
return max;
|
|
172215
|
-
}
|
|
172216
172203
|
getPressCount(lower) {
|
|
172217
172204
|
if (lower.includes("triple") || lower.includes("3_press") || lower.includes("three")) {
|
|
172218
172205
|
return 3;
|