@riddix/hamh 2.1.0-alpha.611 → 2.1.0-alpha.612

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.
@@ -146804,6 +146804,12 @@ var init_bridge_config_schema = __esm({
146804
146804
  title: "Vacuum: Include OnOff Cluster (Alexa)",
146805
146805
  description: "Add an OnOff cluster to robot vacuum endpoints. Alexa REQUIRES this (PowerController) to show robotic vacuums in the app. Without it, Alexa commissions the device but never displays it. In Server Mode this is enabled automatically \u2014 only check this for bridge mode. WARNING: OnOff is NOT part of the Matter RVC device type specification. Enabling this may break Apple Home (shows 'Updating') and Google Home.",
146806
146806
  type: "boolean"
146807
+ },
146808
+ alexaPreserveBrightnessOnTurnOn: {
146809
+ title: "Alexa: Preserve Brightness on Turn-On",
146810
+ description: "Workaround for Alexa resetting light brightness to 100% after subscription renewal. When enabled, the bridge ignores brightness commands that set lights to 100% within 200ms of a turn-on command for the same light. WARNING: breaks Apple Home's 'set room to 100%' Siri commands, which use the same on() + moveToLevel(254) pattern. Only enable on Alexa-only bridges.",
146811
+ type: "boolean",
146812
+ default: false
146807
146813
  }
146808
146814
  }
146809
146815
  };
@@ -168811,14 +168817,16 @@ var LevelControlServerBase = class extends FeaturedBase4 {
168811
168817
  const entityId = homeAssistant.entity.entity_id;
168812
168818
  const levelRange = this.maxLevel - this.minLevel;
168813
168819
  const levelPercent = (level - this.minLevel) / levelRange;
168814
- const lastTurnOn = lastTurnOnTimestamps.get(entityId);
168815
- const timeSinceTurnOn = lastTurnOn ? Date.now() - lastTurnOn : Infinity;
168816
- const isMaxBrightness = level >= this.maxLevel;
168817
- if (isMaxBrightness && timeSinceTurnOn < 200) {
168818
- logger168.debug(
168819
- `[${entityId}] Ignoring moveToLevel(${level}) - Alexa brightness reset detected (${timeSinceTurnOn}ms after turn-on)`
168820
- );
168821
- return;
168820
+ const { featureFlags } = this.env.get(BridgeDataProvider);
168821
+ if (featureFlags?.alexaPreserveBrightnessOnTurnOn === true) {
168822
+ const lastTurnOn = lastTurnOnTimestamps.get(entityId);
168823
+ const timeSinceTurnOn = lastTurnOn ? Date.now() - lastTurnOn : Infinity;
168824
+ if (level >= this.maxLevel && timeSinceTurnOn < 200) {
168825
+ logger168.debug(
168826
+ `[${entityId}] Ignoring moveToLevel(${level}) - Alexa brightness reset detected (${timeSinceTurnOn}ms after turn-on)`
168827
+ );
168828
+ return;
168829
+ }
168822
168830
  }
168823
168831
  const current = config10.getValuePercent(
168824
168832
  homeAssistant.entity.state,