@riddix/hamh 2.1.0-alpha.746 → 2.1.0-alpha.748

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.
@@ -1077,11 +1077,11 @@ var init_DerCodec = __esm({
1077
1077
  return this.#encodeAsn1(4, value);
1078
1078
  }
1079
1079
  static #encodeSequence(object) {
1080
- const attributes8 = new Array();
1080
+ const attributes9 = new Array();
1081
1081
  for (const key in object) {
1082
- attributes8.push(this.encode(object[key]));
1082
+ attributes9.push(this.encode(object[key]));
1083
1083
  }
1084
- return this.#encodeAsn1(DerTag.Sequence, Bytes.concat(...attributes8));
1084
+ return this.#encodeAsn1(DerTag.Sequence, Bytes.concat(...attributes9));
1085
1085
  }
1086
1086
  static #encodeString(value) {
1087
1087
  return this.#encodeAsn1(12, Bytes.fromString(value));
@@ -54243,7 +54243,7 @@ var init_ClusterType = __esm({
54243
54243
  name: "Unknown",
54244
54244
  schema: new ClusterModel({ name: "Unknown" })
54245
54245
  };
54246
- function attributes8(model) {
54246
+ function attributes9(model) {
54247
54247
  const result = {};
54248
54248
  for (const attribute of model.attributes) {
54249
54249
  if (GLOBAL_IDS2.has(attribute.id) || attribute.isDisallowed || attribute.effectiveMetatype === void 0) {
@@ -54258,7 +54258,7 @@ var init_ClusterType = __esm({
54258
54258
  }
54259
54259
  return result;
54260
54260
  }
54261
- ClusterType2.attributes = attributes8;
54261
+ ClusterType2.attributes = attributes9;
54262
54262
  function commands4(model) {
54263
54263
  const result = {};
54264
54264
  for (const command of model.commands) {
@@ -66642,15 +66642,15 @@ function Read(optionsOrSelector, ...selectors) {
66642
66642
  if (cluster2 !== void 0) {
66643
66643
  prototype2.clusterId = cluster2.id;
66644
66644
  }
66645
- let { attributes: attributes8 } = selector;
66646
- if (attributes8 === void 0) {
66645
+ let { attributes: attributes9 } = selector;
66646
+ if (attributes9 === void 0) {
66647
66647
  attributeRequests.push(prototype2);
66648
66648
  return;
66649
66649
  }
66650
- if (!Array.isArray(attributes8)) {
66651
- attributes8 = [attributes8];
66650
+ if (!Array.isArray(attributes9)) {
66651
+ attributes9 = [attributes9];
66652
66652
  }
66653
- for (const specifier of attributes8) {
66653
+ for (const specifier of attributes9) {
66654
66654
  attributeRequests.push({ ...prototype2, attributeId: Specifier.attributeFor(cluster2, specifier).id });
66655
66655
  }
66656
66656
  }
@@ -69626,9 +69626,9 @@ function Write(optionsOrData, ...data) {
69626
69626
  interactionModelRevision,
69627
69627
  [Diagnostic.value]: () => {
69628
69628
  const items = data.flatMap((entry) => {
69629
- const { version: version2, value, endpoint, cluster: cluster2, attributes: attributes8 } = entry;
69629
+ const { version: version2, value, endpoint, cluster: cluster2, attributes: attributes9 } = entry;
69630
69630
  const valueString = Diagnostic.json(value);
69631
- const list3 = Array.isArray(attributes8) ? attributes8 : [attributes8];
69631
+ const list3 = Array.isArray(attributes9) ? attributes9 : [attributes9];
69632
69632
  const versionString = version2 !== void 0 ? `(version=${version2})` : "";
69633
69633
  return list3.map(
69634
69634
  (attribute) => Diagnostic.squash(
@@ -69655,12 +69655,12 @@ function Write(optionsOrData, ...data) {
69655
69655
  if (cluster2 === void 0) {
69656
69656
  throw new MalformedRequestError(`Write action must specify a cluster`);
69657
69657
  }
69658
- let { attributes: attributes8 } = data2;
69659
- if (attributes8 === void 0) {
69658
+ let { attributes: attributes9 } = data2;
69659
+ if (attributes9 === void 0) {
69660
69660
  throw new MalformedRequestError(`Write action must specify an attribute`);
69661
69661
  }
69662
- if (!Array.isArray(attributes8)) {
69663
- attributes8 = [attributes8];
69662
+ if (!Array.isArray(attributes9)) {
69663
+ attributes9 = [attributes9];
69664
69664
  }
69665
69665
  const { endpoint, value, version: dataVersion } = data2;
69666
69666
  const prototype2 = {
@@ -69671,7 +69671,7 @@ function Write(optionsOrData, ...data) {
69671
69671
  },
69672
69672
  dataVersion
69673
69673
  };
69674
- for (const specifier of attributes8) {
69674
+ for (const specifier of attributes9) {
69675
69675
  const clusterId3 = cluster2.id;
69676
69676
  const attribute = Specifier.attributeFor(cluster2, specifier);
69677
69677
  const { id: attributeId } = attribute;
@@ -95124,7 +95124,7 @@ function clusterTypeProtocolOf(backing) {
95124
95124
  wildcardPathFlags |= WildcardPathFlags2.skipCustomElements;
95125
95125
  }
95126
95126
  const attrList = Array();
95127
- const attributes8 = {
95127
+ const attributes9 = {
95128
95128
  [Symbol.iterator]: attrList[Symbol.iterator].bind(attrList)
95129
95129
  };
95130
95130
  const eventList = Array();
@@ -95195,7 +95195,7 @@ function clusterTypeProtocolOf(backing) {
95195
95195
  attr.quieter = true;
95196
95196
  }
95197
95197
  attrList.push(attr);
95198
- attributes8[id] = attr;
95198
+ attributes9[id] = attr;
95199
95199
  if (!member.effectiveConformance.isMandatory) {
95200
95200
  nonMandatorySupportedAttributes.add(id);
95201
95201
  }
@@ -95246,7 +95246,7 @@ function clusterTypeProtocolOf(backing) {
95246
95246
  const descriptor = {
95247
95247
  id: schema6.id,
95248
95248
  name: schema6.name,
95249
- attributes: attributes8,
95249
+ attributes: attributes9,
95250
95250
  events,
95251
95251
  commands: commands4,
95252
95252
  wildcardPathFlags
@@ -97822,11 +97822,11 @@ var init_ServerSubscription = __esm({
97822
97822
  if (this.#sendUpdateErrorCounter <= 2) {
97823
97823
  if (attributeFilter !== void 0) {
97824
97824
  for (const [endpointId, clusters] of Object.entries(attributeFilter)) {
97825
- for (const [clusterId3, attributes8] of Object.entries(clusters)) {
97825
+ for (const [clusterId3, attributes9] of Object.entries(clusters)) {
97826
97826
  this.#addOutstandingAttributes(
97827
97827
  EndpointNumber(parseInt(endpointId)),
97828
97828
  ClusterId(parseInt(clusterId3)),
97829
- Array.from(attributes8)
97829
+ Array.from(attributes9)
97830
97830
  );
97831
97831
  }
97832
97832
  }
@@ -114577,11 +114577,11 @@ var init_ClientBehaviorBacking = __esm({
114577
114577
  }
114578
114578
  const { attributeList, acceptedCommandList } = this.endpoint.stateOf(this.type);
114579
114579
  const schema6 = this.type.schema;
114580
- const attributes8 = /* @__PURE__ */ new Set();
114580
+ const attributes9 = /* @__PURE__ */ new Set();
114581
114581
  const attributeIds = new Set(attributeList);
114582
114582
  for (const attr of schema6.attributes) {
114583
114583
  if (attributeIds.has(attr.id)) {
114584
- attributes8.add(attr.propertyName);
114584
+ attributes9.add(attr.propertyName);
114585
114585
  }
114586
114586
  }
114587
114587
  const commands4 = /* @__PURE__ */ new Set();
@@ -114593,7 +114593,7 @@ var init_ClientBehaviorBacking = __esm({
114593
114593
  }
114594
114594
  return this.#elements = {
114595
114595
  features: schema6.supportedFeatures,
114596
- attributes: attributes8,
114596
+ attributes: attributes9,
114597
114597
  commands: commands4,
114598
114598
  events: /* @__PURE__ */ new Set()
114599
114599
  // Not published
@@ -124084,108 +124084,126 @@ var init_controller_compat = __esm({
124084
124084
  // 0x6006 Google Home
124085
124085
  4631: "alexa",
124086
124086
  // 0x1217 Amazon Alexa
124087
- 4448: "alexa"
124087
+ 4448: "alexa",
124088
124088
  // 0x1160 Amazon (some Alexa ecosystems)
124089
+ 4447: "aqara"
124090
+ // 0x115F Aqara Home
124089
124091
  };
124090
124092
  deviceTypeIdSupport = {
124091
124093
  43: {
124092
124094
  apple: "no",
124093
124095
  google: "yes",
124094
124096
  alexa: "yes",
124097
+ aqara: "yes",
124095
124098
  note: "Apple Home has no standalone fan."
124096
124099
  },
124097
124100
  45: {
124098
124101
  apple: "no",
124099
124102
  google: "yes",
124100
124103
  alexa: "yes",
124104
+ aqara: "yes",
124101
124105
  note: "Apple Home does not list air purifiers."
124102
124106
  },
124103
124107
  34: {
124104
124108
  apple: "no",
124105
124109
  google: "yes",
124106
124110
  alexa: "no",
124107
- note: "Only Google Home shows Matter speakers."
124111
+ aqara: "yes",
124112
+ note: "Google Home and Aqara show Matter speakers."
124108
124113
  },
124109
124114
  40: {
124110
124115
  apple: "no",
124111
124116
  google: "no",
124112
124117
  alexa: "no",
124113
- note: "TV/media types are not shown by these controllers."
124118
+ aqara: "yes",
124119
+ note: "TV/media types only show in Aqara Home here."
124114
124120
  },
124115
124121
  773: {
124116
124122
  apple: "no",
124117
124123
  google: "yes",
124118
124124
  alexa: "no",
124119
- note: "Only Google Home shows pressure sensors."
124125
+ aqara: "yes",
124126
+ note: "Google Home and Aqara show pressure sensors."
124120
124127
  },
124121
124128
  774: {
124122
124129
  apple: "no",
124123
124130
  google: "yes",
124124
124131
  alexa: "no",
124132
+ aqara: "unknown",
124125
124133
  note: "Only Google Home shows flow sensors."
124126
124134
  },
124127
124135
  44: {
124128
124136
  apple: "no",
124129
124137
  google: "yes",
124130
124138
  alexa: "yes",
124139
+ aqara: "yes",
124131
124140
  note: "Apple Home does not show air quality."
124132
124141
  },
124133
124142
  23: {
124134
124143
  apple: "no",
124135
124144
  google: "no",
124136
124145
  alexa: "unknown",
124146
+ aqara: "unknown",
124137
124147
  note: "Power/energy is rarely shown unless it is on a smart plug."
124138
124148
  },
124139
124149
  24: {
124140
124150
  apple: "no",
124141
124151
  google: "no",
124142
124152
  alexa: "no",
124143
- note: "Battery is usually shown inside a device, not on its own."
124153
+ aqara: "yes",
124154
+ note: "Aqara lists battery storage; others show battery inside a device."
124144
124155
  },
124145
124156
  39: {
124146
124157
  apple: "no",
124147
124158
  google: "no",
124148
124159
  alexa: "no",
124160
+ aqara: "unknown",
124149
124161
  note: "Mode Select is not supported here (Google #356)."
124150
124162
  },
124151
- 66: { apple: "no", google: "no", alexa: "no" },
124163
+ 66: { apple: "no", google: "no", alexa: "no", aqara: "yes" },
124152
124164
  771: {
124153
124165
  apple: "no",
124154
124166
  google: "yes",
124155
124167
  alexa: "no",
124156
- note: "Only Google Home shows pumps."
124168
+ aqara: "yes",
124169
+ note: "Google Home and Aqara show pumps."
124157
124170
  },
124158
124171
  68: {
124159
124172
  apple: "no",
124160
124173
  google: "no",
124161
124174
  alexa: "no",
124175
+ aqara: "yes",
124162
124176
  note: "Newer Matter detector, thin support; Alexa may reject it (#365)."
124163
124177
  },
124164
124178
  65: {
124165
124179
  apple: "no",
124166
124180
  google: "no",
124167
124181
  alexa: "no",
124182
+ aqara: "yes",
124168
124183
  note: "Newer Matter detector, thin support; Alexa may reject it (#365)."
124169
124184
  },
124170
124185
  67: {
124171
124186
  apple: "yes",
124172
124187
  google: "no",
124173
124188
  alexa: "yes",
124189
+ aqara: "yes",
124174
124190
  note: "Newer Matter detector, can be risky on Alexa bridges (#365)."
124175
124191
  },
124176
- 118: { apple: "yes", google: "no", alexa: "yes" },
124192
+ 118: { apple: "yes", google: "no", alexa: "yes", aqara: "yes" },
124177
124193
  117: {
124178
124194
  apple: "no",
124179
124195
  google: "no",
124180
124196
  alexa: "unknown",
124197
+ aqara: "unknown",
124181
124198
  note: "Appliance types have little controller support."
124182
124199
  },
124183
- 15: { apple: "partial", google: "no", alexa: "yes" }
124200
+ 15: { apple: "partial", google: "no", alexa: "yes", aqara: "unknown" }
124184
124201
  };
124185
124202
  controllerLabels = {
124186
124203
  apple: "Apple Home",
124187
124204
  google: "Google Home",
124188
- alexa: "Alexa"
124205
+ alexa: "Alexa",
124206
+ aqara: "Aqara Home"
124189
124207
  };
124190
124208
  }
124191
124209
  });
@@ -126990,6 +127008,7 @@ function entityMappingApi(mappingStorage) {
126990
127008
  disableCustomAreaRoomModes: body.disableCustomAreaRoomModes,
126991
127009
  valetudoIdentifier: body.valetudoIdentifier,
126992
127010
  coverSwapOpenClose: body.coverSwapOpenClose,
127011
+ coverExposeAsDimmableLight: body.coverExposeAsDimmableLight,
126993
127012
  coverSliderDebounceMs: body.coverSliderDebounceMs,
126994
127013
  disableClimateOnOff: body.disableClimateOnOff,
126995
127014
  disableClimateFanControl: body.disableClimateFanControl,
@@ -131622,6 +131641,7 @@ var EntityMappingStorage = class extends Service {
131622
131641
  disableCustomAreaRoomModes: request.disableCustomAreaRoomModes || void 0,
131623
131642
  valetudoIdentifier: request.valetudoIdentifier?.trim() || void 0,
131624
131643
  coverSwapOpenClose: request.coverSwapOpenClose || void 0,
131644
+ coverExposeAsDimmableLight: request.coverExposeAsDimmableLight || void 0,
131625
131645
  coverSliderDebounceMs: sanitizeDebounceMs(request.coverSliderDebounceMs),
131626
131646
  disableClimateOnOff: request.disableClimateOnOff || void 0,
131627
131647
  disableClimateFanControl: request.disableClimateFanControl || void 0,
@@ -131630,7 +131650,7 @@ var EntityMappingStorage = class extends Service {
131630
131650
  climateAutoMode: request.climateAutoMode || void 0,
131631
131651
  composedEntities: request.composedEntities?.filter((e) => e.entityId?.trim()) ?? void 0
131632
131652
  };
131633
- if (!config11.matterDeviceType && !config11.customName && !config11.customProductName && !config11.customVendorName && !config11.customSerialNumber && config11.customVendorId === void 0 && config11.disabled !== true && !config11.filterLifeEntity && !config11.cleaningModeEntity && !config11.temperatureEntity && !config11.humidityEntity && !config11.batteryEntity && !config11.roomEntities && !config11.disableLockPin && !config11.powerEntity && !config11.energyEntity && !config11.pressureEntity && !config11.suctionLevelEntity && !config11.mopIntensityEntity && (!config11.customServiceAreas || config11.customServiceAreas.length === 0) && (!config11.customFanSpeedTags || Object.keys(config11.customFanSpeedTags).length === 0) && !config11.currentRoomEntity && !config11.cleanedAreaEntity && !config11.disableCustomAreaRoomModes && !config11.valetudoIdentifier && !config11.coverSwapOpenClose && !config11.coverSliderDebounceMs && !config11.disableClimateOnOff && !config11.disableClimateFanControl && !config11.climateKeepModeOnIdle && !config11.climateExposeFan && !config11.climateAutoMode && (!config11.composedEntities || config11.composedEntities.length === 0)) {
131653
+ if (!config11.matterDeviceType && !config11.customName && !config11.customProductName && !config11.customVendorName && !config11.customSerialNumber && config11.customVendorId === void 0 && config11.disabled !== true && !config11.filterLifeEntity && !config11.cleaningModeEntity && !config11.temperatureEntity && !config11.humidityEntity && !config11.batteryEntity && !config11.roomEntities && !config11.disableLockPin && !config11.powerEntity && !config11.energyEntity && !config11.pressureEntity && !config11.suctionLevelEntity && !config11.mopIntensityEntity && (!config11.customServiceAreas || config11.customServiceAreas.length === 0) && (!config11.customFanSpeedTags || Object.keys(config11.customFanSpeedTags).length === 0) && !config11.currentRoomEntity && !config11.cleanedAreaEntity && !config11.disableCustomAreaRoomModes && !config11.valetudoIdentifier && !config11.coverSwapOpenClose && !config11.coverExposeAsDimmableLight && !config11.coverSliderDebounceMs && !config11.disableClimateOnOff && !config11.disableClimateFanControl && !config11.climateKeepModeOnIdle && !config11.climateExposeFan && !config11.climateAutoMode && (!config11.composedEntities || config11.composedEntities.length === 0)) {
131634
131654
  bridgeMap.delete(request.entityId);
131635
131655
  } else {
131636
131656
  bridgeMap.set(request.entityId, config11);
@@ -132528,9 +132548,9 @@ var ScenesManagementServer = class extends ScenesManagementBase {
132528
132548
  #collectSceneAttributeValues() {
132529
132549
  const sceneValues = {};
132530
132550
  this.endpoint.act((agent) => {
132531
- for (const { name: clusterName, attributes: attributes8 } of this.internal.endpointSceneableBehaviors) {
132551
+ for (const { name: clusterName, attributes: attributes9 } of this.internal.endpointSceneableBehaviors) {
132532
132552
  const clusterState = agent[clusterName].state;
132533
- for (const attribute of attributes8) {
132553
+ for (const attribute of attributes9) {
132534
132554
  const attributeName = attribute.name;
132535
132555
  const currentValue = clusterState[attributeName];
132536
132556
  if (currentValue !== void 0) {
@@ -143290,16 +143310,16 @@ var AtomicWriteHandler = class _AtomicWriteHandler {
143290
143310
  if (attributeRequests.length === 0) {
143291
143311
  throw new StatusResponse.InvalidCommandError("No attribute requests provided");
143292
143312
  }
143293
- const attributes8 = /* @__PURE__ */ new Map();
143313
+ const attributes9 = /* @__PURE__ */ new Map();
143294
143314
  for (const attr of attributeRequests) {
143295
143315
  const [attributeName, _] = Object.entries(cluster2.cluster.attributes ?? {}).find(([_2, { id }]) => id === attr) ?? [];
143296
143316
  if (attributeName === void 0 || endpoint.stateOf(cluster2.id)[attr] === void 0) {
143297
143317
  throw new StatusResponse.InvalidCommandError(`Attribute ${attr} not supported by cluster`);
143298
143318
  }
143299
- if (attributes8.has(attr)) {
143319
+ if (attributes9.has(attr)) {
143300
143320
  throw new StatusResponse.InvalidCommandError("Duplicate attribute in attribute requests");
143301
143321
  }
143302
- attributes8.set(attr, attributeName);
143322
+ attributes9.set(attr, attributeName);
143303
143323
  }
143304
143324
  const existingState = this.#pendingWrites.find(
143305
143325
  (s) => PeerAddress.is(s.peerAddress, peerAddress) && s.endpoint.number == endpoint.number && s.clusterId === cluster2.cluster.id
@@ -143323,7 +143343,7 @@ var AtomicWriteHandler = class _AtomicWriteHandler {
143323
143343
  cluster2.cluster.id,
143324
143344
  attributeRequests,
143325
143345
  timeout,
143326
- attributes8,
143346
+ attributes9,
143327
143347
  initialValues
143328
143348
  );
143329
143349
  this.#pendingWrites.add(state);
@@ -147818,7 +147838,7 @@ var PluginManager = class {
147818
147838
  await this.onDeviceUnregistered?.(plugin.name, deviceId);
147819
147839
  pluginLogger.debug(`Unregistered device: ${deviceId}`);
147820
147840
  },
147821
- updateDeviceState: (deviceId, clusterId3, attributes8) => {
147841
+ updateDeviceState: (deviceId, clusterId3, attributes9) => {
147822
147842
  if (!devices.has(deviceId)) {
147823
147843
  pluginLogger.warn(
147824
147844
  `Cannot update state: device "${deviceId}" not found`
@@ -147829,7 +147849,7 @@ var PluginManager = class {
147829
147849
  plugin.name,
147830
147850
  deviceId,
147831
147851
  clusterId3,
147832
- attributes8
147852
+ attributes9
147833
147853
  );
147834
147854
  },
147835
147855
  registerDomainMapping: (mapping) => {
@@ -150739,12 +150759,12 @@ var temperatureConfig = {
150739
150759
  getValue(entity, agent) {
150740
150760
  const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
150741
150761
  const state = entity.state;
150742
- const attributes8 = entity.attributes;
150762
+ const attributes9 = entity.attributes;
150743
150763
  const temperature3 = state == null || Number.isNaN(+state) ? null : +state;
150744
150764
  if (temperature3 == null) return void 0;
150745
150765
  return Temperature.withUnit(
150746
150766
  temperature3,
150747
- attributes8.unit_of_measurement ?? fallbackUnit
150767
+ attributes9.unit_of_measurement ?? fallbackUnit
150748
150768
  );
150749
150769
  }
150750
150770
  };
@@ -151211,8 +151231,8 @@ function ClimateFanControlServer(rockSupport) {
151211
151231
  // src/matter/endpoints/legacy/climate/behaviors/climate-humidity-measurement-server.ts
151212
151232
  var humidityConfig2 = {
151213
151233
  getValue(entity) {
151214
- const attributes8 = entity.attributes;
151215
- const humidity = attributes8.current_humidity;
151234
+ const attributes9 = entity.attributes;
151235
+ const humidity = attributes9.current_humidity;
151216
151236
  if (humidity == null || Number.isNaN(+humidity)) {
151217
151237
  return null;
151218
151238
  }
@@ -152191,26 +152211,26 @@ function toMatterTemp(value) {
152191
152211
  return Math.round(num * 100);
152192
152212
  }
152193
152213
  function ClimateDevice(homeAssistantEntity, includeBasicInformation = true) {
152194
- const attributes8 = homeAssistantEntity.entity.state.attributes;
152195
- const supportedFeatures = attributes8.supported_features ?? 0;
152196
- const hasBatteryAttr = attributes8.battery_level != null || attributes8.battery != null;
152214
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
152215
+ const supportedFeatures = attributes9.supported_features ?? 0;
152216
+ const hasBatteryAttr = attributes9.battery_level != null || attributes9.battery != null;
152197
152217
  const hasBatteryEntity = !!homeAssistantEntity.mapping?.batteryEntity;
152198
152218
  const hasBattery = hasBatteryAttr || hasBatteryEntity;
152199
152219
  const supportsCooling = coolingModes.some(
152200
- (mode) => attributes8.hvac_modes.includes(mode)
152220
+ (mode) => attributes9.hvac_modes.includes(mode)
152201
152221
  );
152202
152222
  const hasExplicitHeating = heatingModes.some(
152203
- (mode) => attributes8.hvac_modes.includes(mode)
152223
+ (mode) => attributes9.hvac_modes.includes(mode)
152204
152224
  );
152205
- const isAutoOnly = !hasExplicitHeating && !supportsCooling && autoOnlyMode.some((mode) => attributes8.hvac_modes.includes(mode));
152206
- const isVentilationOnly = !hasExplicitHeating && !supportsCooling && !isAutoOnly && ventilationOnlyModes.some((mode) => attributes8.hvac_modes.includes(mode));
152225
+ const isAutoOnly = !hasExplicitHeating && !supportsCooling && autoOnlyMode.some((mode) => attributes9.hvac_modes.includes(mode));
152226
+ const isVentilationOnly = !hasExplicitHeating && !supportsCooling && !isAutoOnly && ventilationOnlyModes.some((mode) => attributes9.hvac_modes.includes(mode));
152207
152227
  const supportsHeating = hasExplicitHeating || isAutoOnly || isVentilationOnly;
152208
152228
  if (!supportsCooling && !supportsHeating) {
152209
152229
  throw new InvalidDeviceError(
152210
- `Climates have to support at least one of: heat, cool, heat_cool, auto, fan_only, or dry. Found: [${attributes8.hvac_modes.join(", ")}]`
152230
+ `Climates have to support at least one of: heat, cool, heat_cool, auto, fan_only, or dry. Found: [${attributes9.hvac_modes.join(", ")}]`
152211
152231
  );
152212
152232
  }
152213
- const supportsHumidity = attributes8.current_humidity != null || testBit(supportedFeatures, ClimateDeviceFeature.TARGET_HUMIDITY);
152233
+ const supportsHumidity = attributes9.current_humidity != null || testBit(supportedFeatures, ClimateDeviceFeature.TARGET_HUMIDITY);
152214
152234
  const supportsOnOff = testBit(supportedFeatures, ClimateDeviceFeature.TURN_ON) && testBit(supportedFeatures, ClimateDeviceFeature.TURN_OFF) && homeAssistantEntity.mapping?.disableClimateOnOff !== true;
152215
152235
  const supportsFanMode = testBit(supportedFeatures, ClimateDeviceFeature.FAN_MODE) && homeAssistantEntity.mapping?.disableClimateFanControl !== true;
152216
152236
  const supportsVerticalSwing = testBit(
@@ -152221,22 +152241,22 @@ function ClimateDevice(homeAssistantEntity, includeBasicInformation = true) {
152221
152241
  supportedFeatures,
152222
152242
  ClimateDeviceFeature.SWING_HORIZONTAL_MODE
152223
152243
  );
152224
- const swingModesRockSupport = swingModesToRockSupport(attributes8.swing_modes);
152244
+ const swingModesRockSupport = swingModesToRockSupport(attributes9.swing_modes);
152225
152245
  const rockSupport = supportsVerticalSwing || supportsHorizontalSwing || swingModesRockSupport.rockLeftRight || swingModesRockSupport.rockUpDown ? {
152226
152246
  rockLeftRight: swingModesRockSupport.rockLeftRight || supportsHorizontalSwing || void 0,
152227
152247
  rockUpDown: swingModesRockSupport.rockUpDown || supportsVerticalSwing || void 0
152228
152248
  } : void 0;
152229
- const rawMinLimit = toMatterTemp(attributes8.min_temp) ?? 0;
152230
- const rawMaxLimit = toMatterTemp(attributes8.max_temp) ?? 5e3;
152249
+ const rawMinLimit = toMatterTemp(attributes9.min_temp) ?? 0;
152250
+ const rawMaxLimit = toMatterTemp(attributes9.max_temp) ?? 5e3;
152231
152251
  const minLimit = Math.min(rawMinLimit, rawMaxLimit);
152232
152252
  const maxLimit = Math.max(rawMinLimit, rawMaxLimit);
152233
152253
  const initialState = {
152234
152254
  // Pass actual current_temperature for initial state.
152235
152255
  // If unavailable (null/undefined), update() will fall back to the
152236
152256
  // target setpoint so controllers don't display 0°C.
152237
- localTemperature: toMatterTemp(attributes8.current_temperature),
152238
- occupiedHeatingSetpoint: toMatterTemp(attributes8.target_temp_low) ?? toMatterTemp(attributes8.temperature) ?? 2e3,
152239
- occupiedCoolingSetpoint: toMatterTemp(attributes8.target_temp_high) ?? toMatterTemp(attributes8.temperature) ?? 2400,
152257
+ localTemperature: toMatterTemp(attributes9.current_temperature),
152258
+ occupiedHeatingSetpoint: toMatterTemp(attributes9.target_temp_low) ?? toMatterTemp(attributes9.temperature) ?? 2e3,
152259
+ occupiedCoolingSetpoint: toMatterTemp(attributes9.target_temp_high) ?? toMatterTemp(attributes9.temperature) ?? 2400,
152240
152260
  // Use HA's actual min/max limits, fall back to wide range (0-50°C) if not
152241
152261
  // provided. Ordered above so min <= max always holds.
152242
152262
  minHeatSetpointLimit: minLimit,
@@ -152244,7 +152264,7 @@ function ClimateDevice(homeAssistantEntity, includeBasicInformation = true) {
152244
152264
  minCoolSetpointLimit: minLimit,
152245
152265
  maxCoolSetpointLimit: maxLimit
152246
152266
  };
152247
- const autoMode = supportsHeating && supportsCooling && attributes8.hvac_modes.includes(ClimateHvacMode.heat_cool) && (attributes8.hvac_modes.includes(ClimateHvacMode.heat) || attributes8.hvac_modes.includes(ClimateHvacMode.cool));
152267
+ const autoMode = supportsHeating && supportsCooling && attributes9.hvac_modes.includes(ClimateHvacMode.heat_cool) && (attributes9.hvac_modes.includes(ClimateHvacMode.heat) || attributes9.hvac_modes.includes(ClimateHvacMode.cool));
152248
152268
  return ClimateDeviceType(
152249
152269
  supportsOnOff,
152250
152270
  supportsHumidity,
@@ -152510,12 +152530,12 @@ var temperatureConfig2 = {
152510
152530
  getValue(entity, agent) {
152511
152531
  const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
152512
152532
  const state = entity.state;
152513
- const attributes8 = entity.attributes;
152533
+ const attributes9 = entity.attributes;
152514
152534
  const temperature3 = state == null || Number.isNaN(+state) ? null : +state;
152515
152535
  if (temperature3 == null) return void 0;
152516
152536
  return Temperature.withUnit(
152517
152537
  temperature3,
152518
- attributes8.unit_of_measurement ?? fallbackUnit
152538
+ attributes9.unit_of_measurement ?? fallbackUnit
152519
152539
  );
152520
152540
  }
152521
152541
  };
@@ -152528,10 +152548,10 @@ var humidityConfig3 = {
152528
152548
  var pressureConfig = {
152529
152549
  getValue(entity) {
152530
152550
  const state = entity.state;
152531
- const attributes8 = entity.attributes;
152551
+ const attributes9 = entity.attributes;
152532
152552
  const pressure = state == null || Number.isNaN(+state) ? null : +state;
152533
152553
  if (pressure == null) return void 0;
152534
- return convertPressureToHpa(pressure, attributes8.unit_of_measurement);
152554
+ return convertPressureToHpa(pressure, attributes9.unit_of_measurement);
152535
152555
  }
152536
152556
  };
152537
152557
  var batteryConfig2 = {
@@ -152762,8 +152782,8 @@ init_esm();
152762
152782
  // src/matter/endpoints/legacy/air-purifier/index.ts
152763
152783
  init_dist();
152764
152784
  init_home_assistant_entity_behavior();
152765
- function hasFilterLifeSupport(attributes8, mapping) {
152766
- if (attributes8.filter_life != null || attributes8.filter_life_remaining != null || attributes8.filter_life_level != null) {
152785
+ function hasFilterLifeSupport(attributes9, mapping) {
152786
+ if (attributes9.filter_life != null || attributes9.filter_life_remaining != null || attributes9.filter_life_level != null) {
152767
152787
  return true;
152768
152788
  }
152769
152789
  if (mapping?.filterLifeEntity) {
@@ -152772,8 +152792,8 @@ function hasFilterLifeSupport(attributes8, mapping) {
152772
152792
  return false;
152773
152793
  }
152774
152794
  function AirPurifierEndpoint(homeAssistantEntity) {
152775
- const attributes8 = homeAssistantEntity.entity.state.attributes;
152776
- const supportedFeatures = attributes8.supported_features ?? 0;
152795
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
152796
+ const supportedFeatures = attributes9.supported_features ?? 0;
152777
152797
  const mapping = homeAssistantEntity.mapping;
152778
152798
  const features3 = /* @__PURE__ */ new Set();
152779
152799
  if (testBit(supportedFeatures, FanDeviceFeature.SET_SPEED)) {
@@ -152789,7 +152809,7 @@ function AirPurifierEndpoint(homeAssistantEntity) {
152789
152809
  if (testBit(supportedFeatures, FanDeviceFeature.OSCILLATE)) {
152790
152810
  features3.add("Rocking");
152791
152811
  }
152792
- const presetModes = attributes8.preset_modes ?? [];
152812
+ const presetModes = attributes9.preset_modes ?? [];
152793
152813
  const hasWindModes = presetModes.some(
152794
152814
  (m) => m.toLowerCase() === "natural" || m.toLowerCase() === "nature" || m.toLowerCase() === "sleep"
152795
152815
  );
@@ -152803,7 +152823,7 @@ function AirPurifierEndpoint(homeAssistantEntity) {
152803
152823
  FanOnOffServer,
152804
152824
  FanFanControlServer.with(...features3)
152805
152825
  );
152806
- if (hasFilterLifeSupport(attributes8, mapping)) {
152826
+ if (hasFilterLifeSupport(attributes9, mapping)) {
152807
152827
  const deviceWithFilter = baseDevice.with(
152808
152828
  AirPurifierHepaFilterMonitoringServer
152809
152829
  );
@@ -153406,9 +153426,9 @@ var batteryTypes = /* @__PURE__ */ new Map([
153406
153426
  function BinarySensorDevice(homeAssistantEntity) {
153407
153427
  const entityId = homeAssistantEntity.entity.entity_id;
153408
153428
  const defaultDeviceType = OnOffSensorType;
153409
- const attributes8 = homeAssistantEntity.entity.state.attributes;
153410
- const deviceClass = attributes8.device_class;
153411
- const hasBatteryAttr = attributes8.battery_level != null || attributes8.battery != null;
153429
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
153430
+ const deviceClass = attributes9.device_class;
153431
+ const hasBatteryAttr = attributes9.battery_level != null || attributes9.battery != null;
153412
153432
  const hasBatteryEntity = !!homeAssistantEntity.mapping?.batteryEntity;
153413
153433
  const hasBattery = hasBatteryAttr || hasBatteryEntity;
153414
153434
  let type = deviceClass && deviceClasses[deviceClass] ? deviceClasses[deviceClass] : defaultDeviceType;
@@ -153490,6 +153510,57 @@ init_dist();
153490
153510
  init_esm();
153491
153511
  init_home_assistant_entity_behavior();
153492
153512
 
153513
+ // src/matter/endpoints/legacy/cover/behaviors/cover-as-light.ts
153514
+ init_dist();
153515
+ init_home_assistant_entity_behavior();
153516
+ var attributes6 = (entity) => entity.attributes;
153517
+ function coverOpenness(entity) {
153518
+ const position = attributes6(entity).current_position;
153519
+ if (position != null) {
153520
+ return Math.min(1, Math.max(0, position / 100));
153521
+ }
153522
+ if (entity.state === CoverDeviceState.open) return 1;
153523
+ if (entity.state === CoverDeviceState.closed) return 0;
153524
+ return null;
153525
+ }
153526
+ function coverLevelAction(percent3, supportsPosition) {
153527
+ const position = Math.round(Math.min(1, Math.max(0, percent3)) * 100);
153528
+ if (supportsPosition) {
153529
+ return { action: "cover.set_cover_position", data: { position } };
153530
+ }
153531
+ return { action: position >= 50 ? "cover.open_cover" : "cover.close_cover" };
153532
+ }
153533
+ var supportsPositionControl = (agent) => {
153534
+ const entity = agent.get(HomeAssistantEntityBehavior).entity.state;
153535
+ const supportedFeatures = attributes6(entity).supported_features ?? 0;
153536
+ return (supportedFeatures & CoverSupportedFeatures.support_set_position) !== 0;
153537
+ };
153538
+ var CoverAsLightOnOffServer = OnOffServer2({
153539
+ isOn: (entity) => entity.state !== CoverDeviceState.closed,
153540
+ turnOn: () => ({ action: "cover.open_cover" }),
153541
+ turnOff: () => ({ action: "cover.close_cover" })
153542
+ });
153543
+ var CoverAsLightLevelControlServer = LevelControlServer2({
153544
+ getValuePercent: (entity) => coverOpenness(entity),
153545
+ moveToLevelPercent: (percent3, agent) => coverLevelAction(percent3, supportsPositionControl(agent))
153546
+ });
153547
+ var baseBehaviors = [
153548
+ IdentifyServer2,
153549
+ BasicInformationServer2,
153550
+ HomeAssistantEntityBehavior,
153551
+ GroupsServer,
153552
+ ScenesManagementServer,
153553
+ CoverAsLightOnOffServer,
153554
+ CoverAsLightLevelControlServer
153555
+ ];
153556
+ var CoverAsDimmableLightType = DimmableLightDevice.with(
153557
+ ...baseBehaviors
153558
+ );
153559
+ var CoverAsDimmableLightWithBatteryType = DimmableLightDevice.with(
153560
+ ...baseBehaviors,
153561
+ DefaultPowerSourceServer
153562
+ );
153563
+
153493
153564
  // src/matter/endpoints/legacy/cover/behaviors/cover-window-covering-server.ts
153494
153565
  init_dist();
153495
153566
  init_esm();
@@ -153842,7 +153913,7 @@ function adjustPositionForWriting(position, flags2, matterSemantics) {
153842
153913
 
153843
153914
  // src/matter/endpoints/legacy/cover/behaviors/cover-window-covering-server.ts
153844
153915
  var logger206 = Logger.get("CoverWindowCoveringServer");
153845
- var attributes6 = (entity) => entity.attributes;
153916
+ var attributes7 = (entity) => entity.attributes;
153846
153917
  var DEVICE_CLASS_TO_MATTER_TYPE = {
153847
153918
  curtain: {
153848
153919
  type: WindowCovering3.WindowCoveringType.Drapery,
@@ -153878,7 +153949,7 @@ var deviceClassMapping = (entity) => {
153878
153949
  if (typeof raw !== "string") return void 0;
153879
153950
  const mapping = DEVICE_CLASS_TO_MATTER_TYPE[raw.toLowerCase()];
153880
153951
  if (!mapping) return void 0;
153881
- const supportedFeatures = attributes6(entity).supported_features ?? 0;
153952
+ const supportedFeatures = attributes7(entity).supported_features ?? 0;
153882
153953
  const hasLift = (supportedFeatures & CoverSupportedFeatures.support_open) !== 0;
153883
153954
  const hasTilt = (supportedFeatures & CoverSupportedFeatures.support_open_tilt) !== 0;
153884
153955
  if (mapping.type === WindowCovering3.WindowCoveringType.TiltBlindTiltOnly) {
@@ -153928,20 +153999,20 @@ var shouldSwapOpenClose = (agent) => {
153928
153999
  const { featureFlags } = agent.env.get(BridgeDataProvider);
153929
154000
  return featureFlags?.coverSwapOpenClose === true;
153930
154001
  };
153931
- var supportsPositionControl = (agent) => {
154002
+ var supportsPositionControl2 = (agent) => {
153932
154003
  const homeAssistant = agent.get(HomeAssistantEntityBehavior);
153933
- const supportedFeatures = attributes6(homeAssistant.entity.state).supported_features ?? 0;
154004
+ const supportedFeatures = attributes7(homeAssistant.entity.state).supported_features ?? 0;
153934
154005
  return (supportedFeatures & CoverSupportedFeatures.support_set_position) !== 0;
153935
154006
  };
153936
154007
  var supportsTiltPositionControl = (agent) => {
153937
154008
  const homeAssistant = agent.get(HomeAssistantEntityBehavior);
153938
- const supportedFeatures = attributes6(homeAssistant.entity.state).supported_features ?? 0;
154009
+ const supportedFeatures = attributes7(homeAssistant.entity.state).supported_features ?? 0;
153939
154010
  return (supportedFeatures & CoverSupportedFeatures.support_set_tilt_position) !== 0;
153940
154011
  };
153941
154012
  var liftShouldUseTilt = (supportedFeatures) => (supportedFeatures & CoverSupportedFeatures.support_open) === 0 && (supportedFeatures & CoverSupportedFeatures.support_open_tilt) !== 0;
153942
154013
  var liftFallsBackToTilt = (agent) => {
153943
154014
  const homeAssistant = agent.get(HomeAssistantEntityBehavior);
153944
- const supportedFeatures = attributes6(homeAssistant.entity.state).supported_features ?? 0;
154015
+ const supportedFeatures = attributes7(homeAssistant.entity.state).supported_features ?? 0;
153945
154016
  return liftShouldUseTilt(supportedFeatures);
153946
154017
  };
153947
154018
  var openLiftAction = (agent) => ({
@@ -153977,7 +154048,7 @@ var setTiltPositionAction = (position, agent) => {
153977
154048
  };
153978
154049
  var config6 = {
153979
154050
  getCurrentLiftPosition: (entity, agent) => {
153980
- let position = attributes6(entity).current_position;
154051
+ let position = attributes7(entity).current_position;
153981
154052
  if (position == null) {
153982
154053
  const coverState = entity.state;
153983
154054
  position = coverState === CoverDeviceState.closed ? 0 : coverState === CoverDeviceState.open ? 100 : void 0;
@@ -153985,7 +154056,7 @@ var config6 = {
153985
154056
  return position == null ? null : adjustPositionForReading2(position, agent);
153986
154057
  },
153987
154058
  getCurrentTiltPosition: (entity, agent) => {
153988
- let position = attributes6(entity).current_tilt_position;
154059
+ let position = attributes7(entity).current_tilt_position;
153989
154060
  if (position == null) {
153990
154061
  const coverState = entity.state;
153991
154062
  position = coverState === CoverDeviceState.closed ? 0 : coverState === CoverDeviceState.open ? 100 : void 0;
@@ -154015,7 +154086,7 @@ var config6 = {
154015
154086
  if (liftFallsBackToTilt(agent)) {
154016
154087
  return setTiltPositionAction(position, agent);
154017
154088
  }
154018
- if (!supportsPositionControl(agent)) {
154089
+ if (!supportsPositionControl2(agent)) {
154019
154090
  const adjustedPosition = adjustPositionForWriting2(position, agent);
154020
154091
  const shouldOpen = adjustedPosition != null && adjustedPosition >= 50;
154021
154092
  const swapped = shouldSwapOpenClose(agent);
@@ -154062,7 +154133,7 @@ var CoverDeviceType = (supportedFeatures, hasBattery, entityId) => {
154062
154133
  logger207.info(
154063
154134
  `[${entityId}] Creating WindowCovering with features: [${[...features3].join(", ")}], supported_features=${supportedFeatures}`
154064
154135
  );
154065
- const baseBehaviors = [
154136
+ const baseBehaviors2 = [
154066
154137
  BasicInformationServer2,
154067
154138
  IdentifyServer2,
154068
154139
  HomeAssistantEntityBehavior,
@@ -154070,16 +154141,16 @@ var CoverDeviceType = (supportedFeatures, hasBattery, entityId) => {
154070
154141
  ];
154071
154142
  if (hasBattery) {
154072
154143
  return WindowCoveringDevice.with(
154073
- ...baseBehaviors,
154144
+ ...baseBehaviors2,
154074
154145
  DefaultPowerSourceServer
154075
154146
  );
154076
154147
  }
154077
- return WindowCoveringDevice.with(...baseBehaviors);
154148
+ return WindowCoveringDevice.with(...baseBehaviors2);
154078
154149
  };
154079
154150
  function CoverDevice(homeAssistantEntity) {
154080
154151
  const entityId = homeAssistantEntity.entity.entity_id;
154081
- const attributes8 = homeAssistantEntity.entity.state.attributes;
154082
- const hasBatteryAttr = attributes8.battery_level != null || attributes8.battery != null;
154152
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
154153
+ const hasBatteryAttr = attributes9.battery_level != null || attributes9.battery != null;
154083
154154
  const hasBatteryEntity = !!homeAssistantEntity.mapping?.batteryEntity;
154084
154155
  const hasBattery = hasBatteryAttr || hasBatteryEntity;
154085
154156
  if (hasBattery) {
@@ -154091,8 +154162,13 @@ function CoverDevice(homeAssistantEntity) {
154091
154162
  `[${entityId}] Creating cover without battery (batteryAttr=${hasBatteryAttr}, batteryEntity=${homeAssistantEntity.mapping?.batteryEntity ?? "none"})`
154092
154163
  );
154093
154164
  }
154165
+ if (homeAssistantEntity.mapping?.coverExposeAsDimmableLight) {
154166
+ logger207.info(`[${entityId}] Exposing cover as a Dimmable Light (#372)`);
154167
+ const type = hasBattery ? CoverAsDimmableLightWithBatteryType : CoverAsDimmableLightType;
154168
+ return type.set({ homeAssistantEntity });
154169
+ }
154094
154170
  return CoverDeviceType(
154095
- attributes8.supported_features ?? 0,
154171
+ attributes9.supported_features ?? 0,
154096
154172
  hasBattery,
154097
154173
  entityId
154098
154174
  ).set({
@@ -154416,9 +154492,9 @@ function EventDevice(homeAssistantEntity) {
154416
154492
  init_dist();
154417
154493
  init_home_assistant_entity_behavior();
154418
154494
  function FanDevice2(homeAssistantEntity) {
154419
- const attributes8 = homeAssistantEntity.entity.state.attributes;
154420
- const supportedFeatures = attributes8.supported_features ?? 0;
154421
- const hasBatteryAttr = attributes8.battery_level != null || attributes8.battery != null;
154495
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
154496
+ const supportedFeatures = attributes9.supported_features ?? 0;
154497
+ const hasBatteryAttr = attributes9.battery_level != null || attributes9.battery != null;
154422
154498
  const hasBatteryEntity = !!homeAssistantEntity.mapping?.batteryEntity;
154423
154499
  const hasBattery = hasBatteryAttr || hasBatteryEntity;
154424
154500
  const hasSetSpeed = testBit(supportedFeatures, FanDeviceFeature.SET_SPEED);
@@ -154426,7 +154502,7 @@ function FanDevice2(homeAssistantEntity) {
154426
154502
  supportedFeatures,
154427
154503
  FanDeviceFeature.PRESET_MODE
154428
154504
  );
154429
- const presetModes = attributes8.preset_modes ?? [];
154505
+ const presetModes = attributes9.preset_modes ?? [];
154430
154506
  const speedPresets = presetModes.filter((m) => m.toLowerCase() !== "auto");
154431
154507
  if (!hasSetSpeed && speedPresets.length === 0) {
154432
154508
  const onOffDevice = hasBattery ? OnOffPlugInUnitDevice.with(
@@ -154598,10 +154674,10 @@ var HumidifierWithAutoAndSensor = FanDevice.with(
154598
154674
  HumidifierHumidityMeasurementServer
154599
154675
  );
154600
154676
  function HumidifierDevice(homeAssistantEntity) {
154601
- const attributes8 = homeAssistantEntity.entity.state.attributes;
154602
- const availableModes = attributes8.available_modes ?? [];
154677
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
154678
+ const availableModes = attributes9.available_modes ?? [];
154603
154679
  const supportsAuto = availableModes.some((m) => m.toLowerCase() === "auto");
154604
- const hasHumiditySensor = attributes8.current_humidity != null;
154680
+ const hasHumiditySensor = attributes9.current_humidity != null;
154605
154681
  if (supportsAuto && hasHumiditySensor) {
154606
154682
  return HumidifierWithAutoAndSensor.set({ homeAssistantEntity });
154607
154683
  }
@@ -155387,11 +155463,11 @@ function LawnMowerDevice(homeAssistantEntity) {
155387
155463
  if (homeAssistantEntity.entity.state === void 0) {
155388
155464
  return void 0;
155389
155465
  }
155390
- const attributes8 = homeAssistantEntity.entity.state.attributes;
155466
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
155391
155467
  let device = LawnMowerEndpointType.with(
155392
155468
  createLawnMowerRvcRunModeServer()
155393
155469
  ).set({ homeAssistantEntity });
155394
- const hasBattery = homeAssistantEntity.mapping?.batteryEntity != null || attributes8.battery_level != null || attributes8.battery != null;
155470
+ const hasBattery = homeAssistantEntity.mapping?.batteryEntity != null || attributes9.battery_level != null || attributes9.battery != null;
155395
155471
  if (hasBattery) {
155396
155472
  device = device.with(DefaultPowerSourceServer);
155397
155473
  }
@@ -155912,8 +155988,8 @@ var colorModes = [
155912
155988
  LightDeviceColorMode.RGBWW
155913
155989
  ];
155914
155990
  function LightDevice(homeAssistantEntity) {
155915
- const attributes8 = homeAssistantEntity.entity.state.attributes;
155916
- const supportedColorModes = attributes8.supported_color_modes ?? [];
155991
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
155992
+ const supportedColorModes = attributes9.supported_color_modes ?? [];
155917
155993
  const supportsBrightness = supportedColorModes.some(
155918
155994
  (mode) => brightnessModes.includes(mode)
155919
155995
  );
@@ -155923,7 +155999,7 @@ function LightDevice(homeAssistantEntity) {
155923
155999
  const supportsColorTemperature = supportedColorModes.includes(
155924
156000
  LightDeviceColorMode.COLOR_TEMP
155925
156001
  );
155926
- const hasBatteryAttr = attributes8.battery_level != null || attributes8.battery != null;
156002
+ const hasBatteryAttr = attributes9.battery_level != null || attributes9.battery != null;
155927
156003
  const hasBatteryEntity = !!homeAssistantEntity.mapping?.batteryEntity;
155928
156004
  const hasBattery = hasBatteryAttr || hasBatteryEntity;
155929
156005
  const deviceType = supportsColorControl || supportsColorTemperature ? ExtendedColorLightType(
@@ -156598,8 +156674,8 @@ var MediaPlayerKeypadInputServer = class extends KeypadInputServer {
156598
156674
  if (!homeAssistant.isAvailable) {
156599
156675
  return { status: KeypadInput3.Status.InvalidKeyInCurrentState };
156600
156676
  }
156601
- const attributes8 = homeAssistant.entity.state.attributes;
156602
- const features3 = attributes8.supported_features ?? 0;
156677
+ const attributes9 = homeAssistant.entity.state.attributes;
156678
+ const features3 = attributes9.supported_features ?? 0;
156603
156679
  const action = this.mapKeyToAction(request.keyCode, features3);
156604
156680
  if (!action) {
156605
156681
  logger214.debug(
@@ -156855,8 +156931,8 @@ var VideoPlayerEndpointType = BasicVideoPlayerDevice.with(
156855
156931
  MediaPlayerKeypadInputServer
156856
156932
  );
156857
156933
  function VideoPlayerDevice(homeAssistantEntity) {
156858
- const attributes8 = homeAssistantEntity.entity.state.attributes;
156859
- const supportedFeatures = attributes8.supported_features ?? 0;
156934
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
156935
+ const supportedFeatures = attributes9.supported_features ?? 0;
156860
156936
  let device = VideoPlayerEndpointType;
156861
156937
  const supportsPower = testBit(supportedFeatures, MediaPlayerDeviceFeature.TURN_ON) && testBit(supportedFeatures, MediaPlayerDeviceFeature.TURN_OFF);
156862
156938
  if (supportsPower) {
@@ -157015,9 +157091,9 @@ function SpeakerLevelControlServer(config11) {
157015
157091
  // src/matter/endpoints/legacy/media-player/behaviors/media-player-level-control-server.ts
157016
157092
  var MediaPlayerLevelControlServer = SpeakerLevelControlServer({
157017
157093
  getValuePercent: (state) => {
157018
- const attributes8 = state.attributes;
157019
- if (attributes8.volume_level != null) {
157020
- return attributes8.volume_level;
157094
+ const attributes9 = state.attributes;
157095
+ if (attributes9.volume_level != null) {
157096
+ return attributes9.volume_level;
157021
157097
  }
157022
157098
  return 0;
157023
157099
  },
@@ -157051,15 +157127,15 @@ var SpeakerEndpointType = SpeakerDevice.with(
157051
157127
  HomeAssistantEntityBehavior
157052
157128
  );
157053
157129
  function MediaPlayerDevice(homeAssistantEntity) {
157054
- const attributes8 = homeAssistantEntity.entity.state.attributes;
157055
- if (attributes8.device_class === MediaPlayerDeviceClass.Tv) {
157130
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
157131
+ if (attributes9.device_class === MediaPlayerDeviceClass.Tv) {
157056
157132
  return VideoPlayerDevice(homeAssistantEntity);
157057
157133
  }
157058
157134
  return SpeakerMediaPlayerDevice(homeAssistantEntity);
157059
157135
  }
157060
157136
  function SpeakerMediaPlayerDevice(homeAssistantEntity) {
157061
- const attributes8 = homeAssistantEntity.entity.state.attributes;
157062
- const supportedFeatures = attributes8.supported_features ?? 0;
157137
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
157138
+ const supportedFeatures = attributes9.supported_features ?? 0;
157063
157139
  let device = SpeakerEndpointType;
157064
157140
  const supportsPower = testBit(supportedFeatures, MediaPlayerDeviceFeature.TURN_ON) && testBit(supportedFeatures, MediaPlayerDeviceFeature.TURN_OFF);
157065
157141
  const supportsMute = testBit(
@@ -157313,8 +157389,8 @@ var AirQualitySensorServerImpl = class extends AirQualityServerWithFeatures {
157313
157389
  return;
157314
157390
  }
157315
157391
  const state = entity.state.state;
157316
- const attributes8 = entity.state.attributes;
157317
- const deviceClass = attributes8.device_class;
157392
+ const attributes9 = entity.state.attributes;
157393
+ const deviceClass = attributes9.device_class;
157318
157394
  let airQuality = AirQuality3.AirQualityEnum.Unknown;
157319
157395
  if (state != null && !Number.isNaN(+state)) {
157320
157396
  const value = +state;
@@ -157646,12 +157722,12 @@ init_home_assistant_entity_behavior();
157646
157722
  var flowSensorConfig = {
157647
157723
  getValue(entity) {
157648
157724
  const state = entity.state;
157649
- const attributes8 = entity.attributes;
157725
+ const attributes9 = entity.attributes;
157650
157726
  const flow = state == null || Number.isNaN(+state) ? null : +state;
157651
157727
  if (flow == null) {
157652
157728
  return void 0;
157653
157729
  }
157654
- const unit = attributes8.unit_of_measurement?.toLowerCase();
157730
+ const unit = attributes9.unit_of_measurement?.toLowerCase();
157655
157731
  if (unit === "l/min") {
157656
157732
  return flow * 0.06;
157657
157733
  }
@@ -158129,12 +158205,12 @@ init_home_assistant_entity_behavior();
158129
158205
  var pressureSensorConfig = {
158130
158206
  getValue(entity) {
158131
158207
  const state = entity.state;
158132
- const attributes8 = entity.attributes;
158208
+ const attributes9 = entity.attributes;
158133
158209
  const pressure = state == null || Number.isNaN(+state) ? null : +state;
158134
158210
  if (pressure == null) {
158135
158211
  return void 0;
158136
158212
  }
158137
- return convertPressureToHpa(pressure, attributes8.unit_of_measurement);
158213
+ return convertPressureToHpa(pressure, attributes9.unit_of_measurement);
158138
158214
  }
158139
158215
  };
158140
158216
  var PressureSensorType = PressureSensorDevice.with(
@@ -158243,14 +158319,14 @@ var temperatureSensorConfig = {
158243
158319
  getValue(entity, agent) {
158244
158320
  const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
158245
158321
  const state = entity.state;
158246
- const attributes8 = entity.attributes;
158322
+ const attributes9 = entity.attributes;
158247
158323
  const temperature3 = state == null || Number.isNaN(+state) ? null : +state;
158248
158324
  if (temperature3 == null) {
158249
158325
  return void 0;
158250
158326
  }
158251
158327
  return Temperature.withUnit(
158252
158328
  temperature3,
158253
- attributes8.unit_of_measurement ?? fallbackUnit
158329
+ attributes9.unit_of_measurement ?? fallbackUnit
158254
158330
  );
158255
158331
  }
158256
158332
  };
@@ -158294,8 +158370,8 @@ var TvocConcentrationMeasurementServerBase = TotalVolatileOrganicCompoundsConcen
158294
158370
  ConcentrationMeasurement3.Feature.NumericMeasurement
158295
158371
  );
158296
158372
  function getMeasurementUnit(entity) {
158297
- const attributes8 = entity.state.attributes;
158298
- if (attributes8.device_class === SensorDeviceClass.volatile_organic_compounds_parts) {
158373
+ const attributes9 = entity.state.attributes;
158374
+ if (attributes9.device_class === SensorDeviceClass.volatile_organic_compounds_parts) {
158299
158375
  return ConcentrationMeasurement3.MeasurementUnit.Ppb;
158300
158376
  }
158301
158377
  return ConcentrationMeasurement3.MeasurementUnit.Ugm3;
@@ -158380,8 +158456,8 @@ var TvocAirQualityServer = class extends TvocAirQualityServerBase {
158380
158456
  return;
158381
158457
  }
158382
158458
  const state = entity.state.state;
158383
- const attributes8 = entity.state.attributes;
158384
- const deviceClass = attributes8.device_class;
158459
+ const attributes9 = entity.state.attributes;
158460
+ const deviceClass = attributes9.device_class;
158385
158461
  let airQuality = AirQuality3.AirQualityEnum.Unknown;
158386
158462
  logger216.debug(
158387
158463
  `[${entity.entity_id}] TVOC update: state="${state}", device_class="${deviceClass}"`
@@ -158713,14 +158789,14 @@ var temperatureConfig3 = {
158713
158789
  getValue(entity, agent) {
158714
158790
  const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
158715
158791
  const state = entity.state;
158716
- const attributes8 = entity.attributes;
158792
+ const attributes9 = entity.attributes;
158717
158793
  const temperature3 = state == null || Number.isNaN(+state) ? null : +state;
158718
158794
  if (temperature3 == null) {
158719
158795
  return void 0;
158720
158796
  }
158721
158797
  return Temperature.withUnit(
158722
158798
  temperature3,
158723
- attributes8.unit_of_measurement ?? fallbackUnit
158799
+ attributes9.unit_of_measurement ?? fallbackUnit
158724
158800
  );
158725
158801
  }
158726
158802
  };
@@ -158748,8 +158824,8 @@ var pressureConfig2 = {
158748
158824
  if (state) {
158749
158825
  const pressure = state.state == null || Number.isNaN(+state.state) ? null : +state.state;
158750
158826
  if (pressure != null) {
158751
- const attributes8 = state.attributes;
158752
- return convertPressureToHpa(pressure, attributes8.unit_of_measurement);
158827
+ const attributes9 = state.attributes;
158828
+ return convertPressureToHpa(pressure, attributes9.unit_of_measurement);
158753
158829
  }
158754
158830
  }
158755
158831
  }
@@ -158809,14 +158885,14 @@ var temperatureConfig4 = {
158809
158885
  getValue(entity, agent) {
158810
158886
  const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
158811
158887
  const state = entity.state;
158812
- const attributes8 = entity.attributes;
158888
+ const attributes9 = entity.attributes;
158813
158889
  const temperature3 = state == null || Number.isNaN(+state) ? null : +state;
158814
158890
  if (temperature3 == null) {
158815
158891
  return void 0;
158816
158892
  }
158817
158893
  return Temperature.withUnit(
158818
158894
  temperature3,
158819
- attributes8.unit_of_measurement ?? fallbackUnit
158895
+ attributes9.unit_of_measurement ?? fallbackUnit
158820
158896
  );
158821
158897
  }
158822
158898
  };
@@ -158830,8 +158906,8 @@ var pressureConfig3 = {
158830
158906
  if (state) {
158831
158907
  const pressure = state.state == null || Number.isNaN(+state.state) ? null : +state.state;
158832
158908
  if (pressure != null) {
158833
- const attributes8 = state.attributes;
158834
- return convertPressureToHpa(pressure, attributes8.unit_of_measurement);
158909
+ const attributes9 = state.attributes;
158910
+ return convertPressureToHpa(pressure, attributes9.unit_of_measurement);
158835
158911
  }
158836
158912
  }
158837
158913
  }
@@ -158873,8 +158949,8 @@ var tempDt = { deviceType: DeviceTypeId(770), revision: 2 };
158873
158949
  var humidityDt = { deviceType: DeviceTypeId(775), revision: 2 };
158874
158950
  var pressureDt = { deviceType: DeviceTypeId(773), revision: 2 };
158875
158951
  function SensorDevice(homeAssistantEntity) {
158876
- const attributes8 = homeAssistantEntity.entity.state.attributes;
158877
- const deviceClass = attributes8.device_class;
158952
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
158953
+ const deviceClass = attributes9.device_class;
158878
158954
  const mapping = homeAssistantEntity.mapping;
158879
158955
  if (deviceClass === SensorDeviceClass.temperature) {
158880
158956
  const hasHumidity = !!mapping?.humidityEntity;
@@ -159191,9 +159267,9 @@ var UNNAMED_ROOM_PATTERN = /^(Room|Raum|Zimmer|Chambre|Habitación|Stanza)\s+\d+
159191
159267
  function isUnnamedRoom(roomName) {
159192
159268
  return UNNAMED_ROOM_PATTERN.test(roomName.trim());
159193
159269
  }
159194
- function parseVacuumRooms(attributes8, includeUnnamedRooms = false) {
159270
+ function parseVacuumRooms(attributes9, includeUnnamedRooms = false) {
159195
159271
  floorCounter = 0;
159196
- const sources2 = [attributes8.rooms, attributes8.segments, attributes8.room_list];
159272
+ const sources2 = [attributes9.rooms, attributes9.segments, attributes9.room_list];
159197
159273
  for (const source of sources2) {
159198
159274
  let rooms = parseRoomData(source);
159199
159275
  if (rooms.length > 0) {
@@ -159203,7 +159279,7 @@ function parseVacuumRooms(attributes8, includeUnnamedRooms = false) {
159203
159279
  return rooms;
159204
159280
  }
159205
159281
  }
159206
- let mappingRooms = parseRoomMapping(attributes8.room_mapping);
159282
+ let mappingRooms = parseRoomMapping(attributes9.room_mapping);
159207
159283
  if (mappingRooms.length > 0) {
159208
159284
  if (!includeUnnamedRooms) {
159209
159285
  mappingRooms = mappingRooms.filter((room) => !isUnnamedRoom(room.name));
@@ -159237,11 +159313,11 @@ function getRoomIdFromMode(mode) {
159237
159313
  }
159238
159314
  return mode - ROOM_MODE_BASE2;
159239
159315
  }
159240
- function isXiaomiMiotVacuum(attributes8) {
159241
- if (Array.isArray(attributes8.room_mapping) && attributes8.room_mapping.length > 0) {
159316
+ function isXiaomiMiotVacuum(attributes9) {
159317
+ if (Array.isArray(attributes9.room_mapping) && attributes9.room_mapping.length > 0) {
159242
159318
  return true;
159243
159319
  }
159244
- const sources2 = [attributes8.rooms, attributes8.segments, attributes8.room_list];
159320
+ const sources2 = [attributes9.rooms, attributes9.segments, attributes9.room_list];
159245
159321
  for (const source of sources2) {
159246
159322
  if (Array.isArray(source) && source.length > 0 && typeof source[0] === "object" && source[0] !== null && "id" in source[0]) {
159247
159323
  return true;
@@ -159249,8 +159325,8 @@ function isXiaomiMiotVacuum(attributes8) {
159249
159325
  }
159250
159326
  return false;
159251
159327
  }
159252
- function isDreameVacuum(attributes8) {
159253
- const roomsData = attributes8.rooms;
159328
+ function isDreameVacuum(attributes9) {
159329
+ const roomsData = attributes9.rooms;
159254
159330
  if (!roomsData || typeof roomsData !== "object" || Array.isArray(roomsData)) {
159255
159331
  return false;
159256
159332
  }
@@ -159261,8 +159337,8 @@ function isDreameVacuum(attributes8) {
159261
159337
  }
159262
159338
  return false;
159263
159339
  }
159264
- function isRoborockVacuum(attributes8) {
159265
- const roomsData = attributes8.rooms;
159340
+ function isRoborockVacuum(attributes9) {
159341
+ const roomsData = attributes9.rooms;
159266
159342
  if (!roomsData || typeof roomsData !== "object" || Array.isArray(roomsData)) {
159267
159343
  return false;
159268
159344
  }
@@ -159272,8 +159348,8 @@ function isRoborockVacuum(attributes8) {
159272
159348
  ([key, value]) => /^\d+$/.test(key) && typeof value === "string"
159273
159349
  );
159274
159350
  }
159275
- function isEcovacsVacuum(attributes8) {
159276
- const roomsData = attributes8.rooms;
159351
+ function isEcovacsVacuum(attributes9) {
159352
+ const roomsData = attributes9.rooms;
159277
159353
  if (!roomsData || typeof roomsData !== "object" || Array.isArray(roomsData)) {
159278
159354
  return false;
159279
159355
  }
@@ -159456,9 +159532,9 @@ function roomsToAreas(rooms, maps = []) {
159456
159532
  }
159457
159533
  }));
159458
159534
  }
159459
- function buildRoomNameLookup(attributes8) {
159535
+ function buildRoomNameLookup(attributes9) {
159460
159536
  const lookup = /* @__PURE__ */ new Map();
159461
- const mapping = attributes8?.room_mapping;
159537
+ const mapping = attributes9?.room_mapping;
159462
159538
  if (!Array.isArray(mapping)) return lookup;
159463
159539
  for (const entry of mapping) {
159464
159540
  if (Array.isArray(entry) && entry.length >= 3 && (typeof entry[0] === "number" || typeof entry[0] === "string") && typeof entry[2] === "string") {
@@ -159470,8 +159546,8 @@ function buildRoomNameLookup(attributes8) {
159470
159546
  }
159471
159547
  return lookup;
159472
159548
  }
159473
- function buttonEntitiesToRooms(entityIds, attributes8) {
159474
- const nameLookup = buildRoomNameLookup(attributes8);
159549
+ function buttonEntitiesToRooms(entityIds, attributes9) {
159550
+ const nameLookup = buildRoomNameLookup(attributes9);
159475
159551
  return entityIds.map((entityId) => {
159476
159552
  const segmentMatch = entityId.match(/segment[_-]?(\d+)$/);
159477
159553
  if (segmentMatch && nameLookup.size > 0) {
@@ -159491,15 +159567,15 @@ function buttonEntitiesToRooms(entityIds, attributes8) {
159491
159567
  };
159492
159568
  });
159493
159569
  }
159494
- function createVacuumServiceAreaServer(attributes8, roomEntities, includeUnnamedRooms = false) {
159570
+ function createVacuumServiceAreaServer(attributes9, roomEntities, includeUnnamedRooms = false) {
159495
159571
  let rooms;
159496
159572
  if (roomEntities && roomEntities.length > 0) {
159497
- rooms = buttonEntitiesToRooms(roomEntities, attributes8);
159573
+ rooms = buttonEntitiesToRooms(roomEntities, attributes9);
159498
159574
  logger221.info(
159499
159575
  `Using ${rooms.length} button entities as rooms: ${rooms.map((r) => r.name).join(", ")}`
159500
159576
  );
159501
159577
  } else {
159502
- rooms = parseVacuumRooms(attributes8, includeUnnamedRooms);
159578
+ rooms = parseVacuumRooms(attributes9, includeUnnamedRooms);
159503
159579
  if (rooms.length > 0) {
159504
159580
  logger221.info(
159505
159581
  `Using ${rooms.length} rooms from attributes: ${rooms.map((r) => r.name).join(", ")}`
@@ -159609,7 +159685,7 @@ function buildValetudoSegmentAction(vacuumEntityId, segmentIds, valetudoIdentifi
159609
159685
  }
159610
159686
  };
159611
159687
  }
159612
- function buildSupportedModes2(attributes8, includeUnnamedRooms = false, customAreas, disableRoomModes = false) {
159688
+ function buildSupportedModes2(attributes9, includeUnnamedRooms = false, customAreas, disableRoomModes = false) {
159613
159689
  const modes = [
159614
159690
  {
159615
159691
  label: "Idle",
@@ -159638,7 +159714,7 @@ function buildSupportedModes2(attributes8, includeUnnamedRooms = false, customAr
159638
159714
  }
159639
159715
  }
159640
159716
  } else {
159641
- const rooms = parseVacuumRooms(attributes8, includeUnnamedRooms);
159717
+ const rooms = parseVacuumRooms(attributes9, includeUnnamedRooms);
159642
159718
  rooms.sort((a, b) => a.name.localeCompare(b.name));
159643
159719
  for (const room of rooms) {
159644
159720
  const modeValue = getRoomModeValue(room);
@@ -159767,11 +159843,11 @@ var vacuumRvcRunModeConfig = {
159767
159843
  return isCleaning ? 1 /* Cleaning */ : 0 /* Idle */;
159768
159844
  },
159769
159845
  getSupportedModes: (entity, agent) => {
159770
- const attributes8 = entity.attributes;
159846
+ const attributes9 = entity.attributes;
159771
159847
  const mapping = agent.get(HomeAssistantEntityBehavior).state.mapping;
159772
159848
  const customAreas = mapping?.customServiceAreas;
159773
159849
  return buildSupportedModes2(
159774
- attributes8,
159850
+ attributes9,
159775
159851
  false,
159776
159852
  customAreas && customAreas.length > 0 ? customAreas : void 0,
159777
159853
  mapping?.disableCustomAreaRoomModes
@@ -159785,7 +159861,7 @@ var vacuumRvcRunModeConfig = {
159785
159861
  if (selectedAreas.length > 0) {
159786
159862
  const homeAssistant = agent.get(HomeAssistantEntityBehavior);
159787
159863
  const entity = homeAssistant.entity;
159788
- const attributes8 = entity.state.attributes;
159864
+ const attributes9 = entity.state.attributes;
159789
159865
  const session = getSession(homeAssistant.endpoint);
159790
159866
  const customAreas = homeAssistant.state.mapping?.customServiceAreas;
159791
159867
  if (customAreas && customAreas.length > 0) {
@@ -159835,7 +159911,7 @@ var vacuumRvcRunModeConfig = {
159835
159911
  homeAssistant.state.mapping?.valetudoIdentifier
159836
159912
  );
159837
159913
  }
159838
- const rooms = parseVacuumRooms(attributes8);
159914
+ const rooms = parseVacuumRooms(attributes9);
159839
159915
  const roomIds = [];
159840
159916
  let targetMapName;
159841
159917
  for (const areaId of selectedAreas) {
@@ -159851,7 +159927,7 @@ var vacuumRvcRunModeConfig = {
159851
159927
  logger222.info(
159852
159928
  `Starting cleaning with selected areas: ${roomIds.join(", ")}`
159853
159929
  );
159854
- if (isDreameVacuum(attributes8)) {
159930
+ if (isDreameVacuum(attributes9)) {
159855
159931
  if (targetMapName) {
159856
159932
  const vacName = vacuumEntityId.replace("vacuum.", "");
159857
159933
  const selectedMapEntity = `select.${vacName}_selected_map`;
@@ -159871,7 +159947,7 @@ var vacuumRvcRunModeConfig = {
159871
159947
  }
159872
159948
  };
159873
159949
  }
159874
- if (isRoborockVacuum(attributes8) || isXiaomiMiotVacuum(attributes8)) {
159950
+ if (isRoborockVacuum(attributes9) || isXiaomiMiotVacuum(attributes9)) {
159875
159951
  return {
159876
159952
  action: "vacuum.send_command",
159877
159953
  data: {
@@ -159880,7 +159956,7 @@ var vacuumRvcRunModeConfig = {
159880
159956
  }
159881
159957
  };
159882
159958
  }
159883
- if (isEcovacsVacuum(attributes8)) {
159959
+ if (isEcovacsVacuum(attributes9)) {
159884
159960
  const roomIdStr = roomIds.join(",");
159885
159961
  logger222.info(
159886
159962
  `Ecovacs vacuum: Using spot_area for rooms: ${roomIdStr}`
@@ -159918,7 +159994,7 @@ var vacuumRvcRunModeConfig = {
159918
159994
  cleanRoom: (roomMode, agent) => {
159919
159995
  const homeAssistant = agent.get(HomeAssistantEntityBehavior);
159920
159996
  const entity = homeAssistant.entity;
159921
- const attributes8 = entity.state.attributes;
159997
+ const attributes9 = entity.state.attributes;
159922
159998
  logger222.info(`cleanRoom called: roomMode=${roomMode}`);
159923
159999
  const cleanAreaRooms = homeAssistant.state.mapping?.cleanAreaRooms;
159924
160000
  if (cleanAreaRooms && cleanAreaRooms.length > 0) {
@@ -159964,7 +160040,7 @@ var vacuumRvcRunModeConfig = {
159964
160040
  homeAssistant.state.mapping?.valetudoIdentifier
159965
160041
  );
159966
160042
  }
159967
- const rooms = parseVacuumRooms(attributes8);
160043
+ const rooms = parseVacuumRooms(attributes9);
159968
160044
  const numericIdFromMode = getRoomIdFromMode(roomMode);
159969
160045
  logger222.info(
159970
160046
  `cleanRoom: numericIdFromMode=${numericIdFromMode}, available rooms: ${JSON.stringify(rooms.map((r) => ({ id: r.id, name: r.name, modeValue: getRoomModeValue(r) })))}`
@@ -159972,7 +160048,7 @@ var vacuumRvcRunModeConfig = {
159972
160048
  const room = rooms.find((r) => getRoomModeValue(r) === roomMode);
159973
160049
  if (room) {
159974
160050
  const commandId3 = room.originalId ?? room.id;
159975
- if (isDreameVacuum(attributes8)) {
160051
+ if (isDreameVacuum(attributes9)) {
159976
160052
  if (room.mapName) {
159977
160053
  const vacuumName = vacuumEntityId.replace("vacuum.", "");
159978
160054
  const selectedMapEntity = `select.${vacuumName}_selected_map`;
@@ -159995,7 +160071,7 @@ var vacuumRvcRunModeConfig = {
159995
160071
  }
159996
160072
  };
159997
160073
  }
159998
- if (isRoborockVacuum(attributes8) || isXiaomiMiotVacuum(attributes8)) {
160074
+ if (isRoborockVacuum(attributes9) || isXiaomiMiotVacuum(attributes9)) {
159999
160075
  logger222.debug(
160000
160076
  `Using vacuum.send_command with app_segment_clean for room ${room.name} (commandId: ${commandId3}, id: ${room.id})`
160001
160077
  );
@@ -160007,7 +160083,7 @@ var vacuumRvcRunModeConfig = {
160007
160083
  }
160008
160084
  };
160009
160085
  }
160010
- if (isEcovacsVacuum(attributes8)) {
160086
+ if (isEcovacsVacuum(attributes9)) {
160011
160087
  const roomIdStr = String(commandId3);
160012
160088
  logger222.info(
160013
160089
  `Ecovacs vacuum: Using spot_area for room ${room.name} (id: ${roomIdStr})`
@@ -160031,12 +160107,12 @@ var vacuumRvcRunModeConfig = {
160031
160107
  return { action: "vacuum.start" };
160032
160108
  }
160033
160109
  };
160034
- function createVacuumRvcRunModeServer(attributes8, includeUnnamedRooms = false, customAreas, disableRoomModes = false) {
160035
- const allRooms = parseVacuumRooms(attributes8, true);
160036
- const rooms = includeUnnamedRooms ? allRooms : parseVacuumRooms(attributes8, false);
160110
+ function createVacuumRvcRunModeServer(attributes9, includeUnnamedRooms = false, customAreas, disableRoomModes = false) {
160111
+ const allRooms = parseVacuumRooms(attributes9, true);
160112
+ const rooms = includeUnnamedRooms ? allRooms : parseVacuumRooms(attributes9, false);
160037
160113
  const filteredCount = allRooms.length - rooms.length;
160038
160114
  const supportedModes2 = buildSupportedModes2(
160039
- attributes8,
160115
+ attributes9,
160040
160116
  includeUnnamedRooms,
160041
160117
  customAreas,
160042
160118
  disableRoomModes
@@ -160055,7 +160131,7 @@ function createVacuumRvcRunModeServer(attributes8, includeUnnamedRooms = false,
160055
160131
  }
160056
160132
  if (allRooms.length === 0) {
160057
160133
  logger222.debug(
160058
- `No rooms found. Attributes: rooms=${JSON.stringify(attributes8.rooms)}, segments=${JSON.stringify(attributes8.segments)}, room_list=${attributes8.room_list}`
160134
+ `No rooms found. Attributes: rooms=${JSON.stringify(attributes9.rooms)}, segments=${JSON.stringify(attributes9.segments)}, room_list=${attributes9.room_list}`
160059
160135
  );
160060
160136
  }
160061
160137
  return RvcRunModeServer2(vacuumRvcRunModeConfig, {
@@ -160119,8 +160195,8 @@ var VacuumPowerSourceServer = PowerSourceServer2({
160119
160195
  return Math.max(0, Math.min(100, battery));
160120
160196
  }
160121
160197
  }
160122
- const attributes8 = entity.attributes;
160123
- const batteryLevel = attributes8.battery_level ?? attributes8.battery;
160198
+ const attributes9 = entity.attributes;
160199
+ const batteryLevel = attributes9.battery_level ?? attributes9.battery;
160124
160200
  if (batteryLevel == null) {
160125
160201
  return null;
160126
160202
  }
@@ -160579,11 +160655,11 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
160579
160655
  const hasCleanTypes = !!cleaningModeOptions && cleaningModeOptions.length > 0;
160580
160656
  return {
160581
160657
  getCurrentMode: (entity, agent) => {
160582
- const attributes8 = entity.attributes;
160658
+ const attributes9 = entity.attributes;
160583
160659
  let cleanType = 0 /* Sweeping */;
160584
160660
  if (hasCleanTypes) {
160585
- if (attributes8.cleaning_mode) {
160586
- cleanType = parseCleanType(attributes8.cleaning_mode);
160661
+ if (attributes9.cleaning_mode) {
160662
+ cleanType = parseCleanType(attributes9.cleaning_mode);
160587
160663
  } else {
160588
160664
  const selectEntityId = getCleaningModeSelectEntity(agent);
160589
160665
  const { state } = readSelectEntity(selectEntityId, agent);
@@ -160599,7 +160675,7 @@ function createCleanModeConfig(fanSpeedList, mopIntensityList, cleaningModeOptio
160599
160675
  speedState = sel.state;
160600
160676
  entityOptions = sel.options;
160601
160677
  } else {
160602
- speedState = attributes8.fan_speed ?? void 0;
160678
+ speedState = attributes9.fan_speed ?? void 0;
160603
160679
  }
160604
160680
  let speedMode = fanSpeedToModeId(speedState, fanSpeedList);
160605
160681
  if (speedMode === void 0 && speedState && entityOptions) {
@@ -160834,12 +160910,12 @@ function createDefaultRvcCleanModeServer() {
160834
160910
  currentMode: MODE_VACUUM
160835
160911
  });
160836
160912
  }
160837
- function supportsCleaningModes(attributes8) {
160838
- return isDreameVacuum(attributes8) || isEcovacsVacuum(attributes8);
160913
+ function supportsCleaningModes(attributes9) {
160914
+ return isDreameVacuum(attributes9) || isEcovacsVacuum(attributes9);
160839
160915
  }
160840
- function resolveFanSpeedList(attributes8, suctionLevelEntity) {
160841
- if (attributes8.fan_speed_list && attributes8.fan_speed_list.length > 1) {
160842
- return attributes8.fan_speed_list;
160916
+ function resolveFanSpeedList(attributes9, suctionLevelEntity) {
160917
+ if (attributes9.fan_speed_list && attributes9.fan_speed_list.length > 1) {
160918
+ return attributes9.fan_speed_list;
160843
160919
  }
160844
160920
  if (suctionLevelEntity) {
160845
160921
  return ["quiet", "standard", "strong"];
@@ -160948,7 +161024,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
160948
161024
  return void 0;
160949
161025
  }
160950
161026
  const entityId = homeAssistantEntity.entity.entity_id;
160951
- const attributes8 = homeAssistantEntity.entity.state.attributes;
161027
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
160952
161028
  const customAreas = homeAssistantEntity.mapping?.customServiceAreas;
160953
161029
  logger226.info(
160954
161030
  `Creating vacuum endpoint for ${entityId}, mapping: ${JSON.stringify(homeAssistantEntity.mapping ?? "none")}`
@@ -160956,7 +161032,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
160956
161032
  const cleanAreaRooms = homeAssistantEntity.mapping?.cleanAreaRooms;
160957
161033
  let device = VacuumEndpointType.with(
160958
161034
  cleanAreaRooms && cleanAreaRooms.length > 0 ? createCleanAreaRvcRunModeServer(cleanAreaRooms) : createVacuumRvcRunModeServer(
160959
- attributes8,
161035
+ attributes9,
160960
161036
  false,
160961
161037
  customAreas && customAreas.length > 0 ? customAreas : void 0,
160962
161038
  homeAssistantEntity.mapping?.disableCustomAreaRoomModes
@@ -160968,7 +161044,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
160968
161044
  }
160969
161045
  device = device.with(VacuumPowerSourceServer);
160970
161046
  const roomEntities = homeAssistantEntity.mapping?.roomEntities;
160971
- const rooms = parseVacuumRooms(attributes8);
161047
+ const rooms = parseVacuumRooms(attributes9);
160972
161048
  logger226.info(
160973
161049
  `${entityId}: customAreas=${customAreas?.length ?? 0}, roomEntities=${JSON.stringify(roomEntities ?? [])}, parsedRooms=${rooms.length}, cleanAreaRooms=${cleanAreaRooms?.length ?? 0}`
160974
161050
  );
@@ -160985,14 +161061,14 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
160985
161061
  } else if (rooms.length > 0 || roomEntities && roomEntities.length > 0) {
160986
161062
  logger226.info(`${entityId}: Adding ServiceArea (${rooms.length} rooms)`);
160987
161063
  device = device.with(
160988
- createVacuumServiceAreaServer(attributes8, roomEntities)
161064
+ createVacuumServiceAreaServer(attributes9, roomEntities)
160989
161065
  );
160990
161066
  } else {
160991
161067
  logger226.info(`${entityId}: Adding ServiceArea (default single-area)`);
160992
161068
  device = device.with(createDefaultServiceAreaServer());
160993
161069
  }
160994
161070
  const fanSpeedList = resolveFanSpeedList(
160995
- attributes8,
161071
+ attributes9,
160996
161072
  homeAssistantEntity.mapping?.suctionLevelEntity
160997
161073
  );
160998
161074
  const mopIntensityList = resolveMopIntensityList(
@@ -161004,7 +161080,7 @@ function VacuumDevice(homeAssistantEntity, includeOnOff = false, cleaningModeOpt
161004
161080
  );
161005
161081
  device = device.with(
161006
161082
  createVacuumRvcCleanModeServer(
161007
- attributes8,
161083
+ attributes9,
161008
161084
  fanSpeedList,
161009
161085
  mopIntensityList,
161010
161086
  cleaningModeOptions,
@@ -161103,9 +161179,9 @@ init_home_assistant_entity_behavior();
161103
161179
 
161104
161180
  // src/matter/endpoints/legacy/water-heater/behaviors/water-heater-thermostat-server.ts
161105
161181
  var getUnit2 = (agent) => agent.env.get(HomeAssistantConfig).unitSystem.temperature;
161106
- var attributes7 = (entity) => entity.attributes;
161182
+ var attributes8 = (entity) => entity.attributes;
161107
161183
  var getTemp2 = (agent, entity, attributeName) => {
161108
- const temperature3 = attributes7(entity)[attributeName];
161184
+ const temperature3 = attributes8(entity)[attributeName];
161109
161185
  const unit = getUnit2(agent);
161110
161186
  if (temperature3 != null) {
161111
161187
  return Temperature.withUnit(+temperature3, unit);
@@ -161119,14 +161195,14 @@ var config10 = {
161119
161195
  getTargetHeatingTemperature: (entity, agent) => getTemp2(agent, entity, "temperature"),
161120
161196
  getTargetCoolingTemperature: (entity, agent) => getTemp2(agent, entity, "temperature"),
161121
161197
  getSystemMode: (entity) => {
161122
- const operationMode = attributes7(entity).operation_mode;
161198
+ const operationMode = attributes8(entity).operation_mode;
161123
161199
  if (operationMode === "off") {
161124
161200
  return Thermostat3.SystemMode.Off;
161125
161201
  }
161126
161202
  return Thermostat3.SystemMode.Heat;
161127
161203
  },
161128
161204
  getRunningMode: (entity) => {
161129
- const operationMode = attributes7(entity).operation_mode;
161205
+ const operationMode = attributes8(entity).operation_mode;
161130
161206
  if (operationMode === "off") {
161131
161207
  return Thermostat3.ThermostatRunningMode.Off;
161132
161208
  }
@@ -161193,14 +161269,14 @@ function toMatterTemp2(value) {
161193
161269
  return Math.round(num * 100);
161194
161270
  }
161195
161271
  function WaterHeaterDevice(homeAssistantEntity) {
161196
- const attributes8 = homeAssistantEntity.entity.state.attributes;
161272
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
161197
161273
  logger227.debug(
161198
- `Creating device for ${homeAssistantEntity.entity.entity_id}, min_temp=${attributes8.min_temp}, max_temp=${attributes8.max_temp}`
161274
+ `Creating device for ${homeAssistantEntity.entity.entity_id}, min_temp=${attributes9.min_temp}, max_temp=${attributes9.max_temp}`
161199
161275
  );
161200
- const minLimit = toMatterTemp2(attributes8.min_temp) ?? 0;
161201
- const maxLimit = toMatterTemp2(attributes8.max_temp) ?? 12e3;
161202
- const currentTemp = toMatterTemp2(attributes8.current_temperature) ?? toMatterTemp2(attributes8.temperature) ?? 2100;
161203
- const heatingSetpoint = toMatterTemp2(attributes8.temperature) ?? 1e4;
161276
+ const minLimit = toMatterTemp2(attributes9.min_temp) ?? 0;
161277
+ const maxLimit = toMatterTemp2(attributes9.max_temp) ?? 12e3;
161278
+ const currentTemp = toMatterTemp2(attributes9.current_temperature) ?? toMatterTemp2(attributes9.temperature) ?? 2100;
161279
+ const heatingSetpoint = toMatterTemp2(attributes9.temperature) ?? 1e4;
161204
161280
  return WaterHeaterDeviceType.set({
161205
161281
  homeAssistantEntity,
161206
161282
  thermostat: {
@@ -161219,21 +161295,21 @@ init_home_assistant_entity_behavior();
161219
161295
  var temperatureConfig5 = {
161220
161296
  getValue(entity, agent) {
161221
161297
  const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
161222
- const attributes8 = entity.attributes;
161223
- const temperature3 = attributes8.temperature;
161298
+ const attributes9 = entity.attributes;
161299
+ const temperature3 = attributes9.temperature;
161224
161300
  if (temperature3 == null || Number.isNaN(temperature3)) {
161225
161301
  return void 0;
161226
161302
  }
161227
161303
  return Temperature.withUnit(
161228
161304
  temperature3,
161229
- attributes8.temperature_unit ?? fallbackUnit
161305
+ attributes9.temperature_unit ?? fallbackUnit
161230
161306
  );
161231
161307
  }
161232
161308
  };
161233
161309
  var humidityConfig5 = {
161234
161310
  getValue(entity) {
161235
- const attributes8 = entity.attributes;
161236
- const humidity = attributes8.humidity;
161311
+ const attributes9 = entity.attributes;
161312
+ const humidity = attributes9.humidity;
161237
161313
  if (humidity == null || Number.isNaN(humidity)) {
161238
161314
  return null;
161239
161315
  }
@@ -161242,12 +161318,12 @@ var humidityConfig5 = {
161242
161318
  };
161243
161319
  var pressureConfig4 = {
161244
161320
  getValue(entity) {
161245
- const attributes8 = entity.attributes;
161246
- const pressure = attributes8.pressure;
161321
+ const attributes9 = entity.attributes;
161322
+ const pressure = attributes9.pressure;
161247
161323
  if (pressure == null || Number.isNaN(pressure)) {
161248
161324
  return void 0;
161249
161325
  }
161250
- return convertPressureToHpa(pressure, attributes8.pressure_unit);
161326
+ return convertPressureToHpa(pressure, attributes9.pressure_unit);
161251
161327
  }
161252
161328
  };
161253
161329
  var WeatherSensorType = TemperatureSensorDevice.with(
@@ -162529,7 +162605,7 @@ function processEvent(store, updates) {
162529
162605
  entityState = { ...entityState };
162530
162606
  const { "+": toAdd, "-": toRemove } = updates.c[entityId];
162531
162607
  const attributesChanged = toAdd?.a || toRemove?.a;
162532
- const attributes8 = attributesChanged ? { ...entityState.attributes } : entityState.attributes;
162608
+ const attributes9 = attributesChanged ? { ...entityState.attributes } : entityState.attributes;
162533
162609
  if (toAdd) {
162534
162610
  if (toAdd.s !== void 0) {
162535
162611
  entityState.state = toAdd.s;
@@ -162549,16 +162625,16 @@ function processEvent(store, updates) {
162549
162625
  entityState.last_updated = new Date(toAdd.lu * 1e3).toISOString();
162550
162626
  }
162551
162627
  if (toAdd.a) {
162552
- Object.assign(attributes8, toAdd.a);
162628
+ Object.assign(attributes9, toAdd.a);
162553
162629
  }
162554
162630
  }
162555
162631
  if (toRemove?.a) {
162556
162632
  for (const key of toRemove.a) {
162557
- delete attributes8[key];
162633
+ delete attributes9[key];
162558
162634
  }
162559
162635
  }
162560
162636
  if (attributesChanged) {
162561
- entityState.attributes = attributes8;
162637
+ entityState.attributes = attributes9;
162562
162638
  }
162563
162639
  state[entityId] = entityState;
162564
162640
  }
@@ -162863,7 +162939,7 @@ var BridgeEndpointManager = class extends Service {
162863
162939
  this.pluginEndpoints.delete(deviceId);
162864
162940
  }
162865
162941
  };
162866
- this.pluginManager.onDeviceStateUpdated = (pluginName, deviceId, clusterId3, attributes8) => {
162942
+ this.pluginManager.onDeviceStateUpdated = (pluginName, deviceId, clusterId3, attributes9) => {
162867
162943
  const endpoint = this.pluginEndpoints.get(deviceId);
162868
162944
  if (!endpoint) return;
162869
162945
  const behaviorType = endpoint.type.behaviors[clusterId3];
@@ -162874,7 +162950,7 @@ var BridgeEndpointManager = class extends Service {
162874
162950
  return;
162875
162951
  }
162876
162952
  this.pluginStateUpdating.add(deviceId);
162877
- endpoint.setStateOf(behaviorType, attributes8).catch((e) => {
162953
+ endpoint.setStateOf(behaviorType, attributes9).catch((e) => {
162878
162954
  this.log.warn(
162879
162955
  `Plugin "${pluginName}": failed to update "${clusterId3}" on "${deviceId}":`,
162880
162956
  e
@@ -164693,12 +164769,12 @@ function ServerModeVacuumDevice(homeAssistantEntity, includeOnOff = false, clean
164693
164769
  if (homeAssistantEntity.entity.state === void 0) {
164694
164770
  return void 0;
164695
164771
  }
164696
- const attributes8 = homeAssistantEntity.entity.state.attributes;
164772
+ const attributes9 = homeAssistantEntity.entity.state.attributes;
164697
164773
  const cleanAreaRooms = homeAssistantEntity.mapping?.cleanAreaRooms;
164698
164774
  const customAreas = homeAssistantEntity.mapping?.customServiceAreas;
164699
164775
  let device = ServerModeVacuumEndpointType.with(
164700
164776
  cleanAreaRooms && cleanAreaRooms.length > 0 ? createCleanAreaRvcRunModeServer(cleanAreaRooms) : createVacuumRvcRunModeServer(
164701
- attributes8,
164777
+ attributes9,
164702
164778
  false,
164703
164779
  customAreas && customAreas.length > 0 ? customAreas : void 0,
164704
164780
  homeAssistantEntity.mapping?.disableCustomAreaRoomModes
@@ -164709,20 +164785,20 @@ function ServerModeVacuumDevice(homeAssistantEntity, includeOnOff = false, clean
164709
164785
  }
164710
164786
  device = device.with(VacuumPowerSourceServer);
164711
164787
  const roomEntities = homeAssistantEntity.mapping?.roomEntities;
164712
- const rooms = parseVacuumRooms(attributes8);
164788
+ const rooms = parseVacuumRooms(attributes9);
164713
164789
  if (cleanAreaRooms && cleanAreaRooms.length > 0) {
164714
164790
  device = device.with(createCleanAreaServiceAreaServer(cleanAreaRooms));
164715
164791
  } else if (customAreas && customAreas.length > 0) {
164716
164792
  device = device.with(createCustomServiceAreaServer(customAreas));
164717
164793
  } else if (rooms.length > 0 || roomEntities && roomEntities.length > 0) {
164718
164794
  device = device.with(
164719
- createVacuumServiceAreaServer(attributes8, roomEntities)
164795
+ createVacuumServiceAreaServer(attributes9, roomEntities)
164720
164796
  );
164721
164797
  } else {
164722
164798
  device = device.with(createDefaultServiceAreaServer());
164723
164799
  }
164724
164800
  const fanSpeedList = resolveFanSpeedList(
164725
- attributes8,
164801
+ attributes9,
164726
164802
  homeAssistantEntity.mapping?.suctionLevelEntity
164727
164803
  );
164728
164804
  const mopIntensityList = resolveMopIntensityList(
@@ -164731,7 +164807,7 @@ function ServerModeVacuumDevice(homeAssistantEntity, includeOnOff = false, clean
164731
164807
  if (cleaningModeOptions || fanSpeedList || mopIntensityList) {
164732
164808
  device = device.with(
164733
164809
  createVacuumRvcCleanModeServer(
164734
- attributes8,
164810
+ attributes9,
164735
164811
  fanSpeedList,
164736
164812
  mopIntensityList,
164737
164813
  cleaningModeOptions,