@riddix/hamh 2.1.0-alpha.442 → 2.1.0-alpha.444

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.
@@ -146085,6 +146085,13 @@ var init_clusters2 = __esm({
146085
146085
  }
146086
146086
  });
146087
146087
 
146088
+ // ../common/dist/controller-profiles.js
146089
+ var init_controller_profiles = __esm({
146090
+ "../common/dist/controller-profiles.js"() {
146091
+ "use strict";
146092
+ }
146093
+ });
146094
+
146088
146095
  // ../common/dist/diagnostic-event.js
146089
146096
  var init_diagnostic_event = __esm({
146090
146097
  "../common/dist/diagnostic-event.js"() {
@@ -146694,7 +146701,7 @@ var init_bridge_config_schema = __esm({
146694
146701
  title: "Auto Humidity Mapping",
146695
146702
  description: "Automatically combine humidity sensors with temperature sensors from the same Home Assistant device. When enabled, humidity sensors will be merged into temperature sensors to create combined TemperatureHumiditySensor devices.",
146696
146703
  type: "boolean",
146697
- default: false
146704
+ default: true
146698
146705
  },
146699
146706
  autoPressureMapping: {
146700
146707
  title: "Auto Pressure Mapping",
@@ -146999,6 +147006,7 @@ var init_dist = __esm({
146999
147006
  init_bridge_export();
147000
147007
  init_bridge_templates();
147001
147008
  init_clusters2();
147009
+ init_controller_profiles();
147002
147010
  init_diagnostic_event();
147003
147011
  init_domains();
147004
147012
  init_endpoint_data();
@@ -149304,6 +149312,73 @@ function matterApi(bridgeService, haRegistry) {
149304
149312
  areas.sort((a, b) => a.name.localeCompare(b.name));
149305
149313
  res.status(200).json(areas);
149306
149314
  });
149315
+ router.get("/areas/summary", async (_, res) => {
149316
+ if (!haRegistry) {
149317
+ res.status(503).json({ error: "Home Assistant registry not available" });
149318
+ return;
149319
+ }
149320
+ const supportedDomains = /* @__PURE__ */ new Set([
149321
+ "light",
149322
+ "switch",
149323
+ "sensor",
149324
+ "binary_sensor",
149325
+ "climate",
149326
+ "cover",
149327
+ "fan",
149328
+ "lock",
149329
+ "media_player",
149330
+ "vacuum",
149331
+ "valve",
149332
+ "humidifier",
149333
+ "water_heater",
149334
+ "select",
149335
+ "input_select",
149336
+ "input_boolean",
149337
+ "alarm_control_panel",
149338
+ "event",
149339
+ "automation",
149340
+ "script",
149341
+ "scene"
149342
+ ]);
149343
+ const entities = Object.values(haRegistry.entities);
149344
+ const devices = haRegistry.devices;
149345
+ const states = haRegistry.states;
149346
+ const areaSummary = /* @__PURE__ */ new Map();
149347
+ for (const [areaId, areaName] of haRegistry.areas) {
149348
+ areaSummary.set(areaId, { name: areaName, entityCount: 0, domains: {} });
149349
+ }
149350
+ for (const entity of entities) {
149351
+ if (entity.disabled_by != null) continue;
149352
+ const domain = entity.entity_id.split(".")[0];
149353
+ if (!supportedDomains.has(domain)) continue;
149354
+ const state = states[entity.entity_id];
149355
+ if (!state || state.state === "unavailable") continue;
149356
+ let areaId;
149357
+ const entityAreaId = entity.area_id;
149358
+ if (entityAreaId && haRegistry.areas.has(entityAreaId)) {
149359
+ areaId = entityAreaId;
149360
+ } else {
149361
+ const device = entity.device_id ? devices[entity.device_id] : void 0;
149362
+ const deviceAreaId = device?.area_id;
149363
+ if (deviceAreaId && haRegistry.areas.has(deviceAreaId)) {
149364
+ areaId = deviceAreaId;
149365
+ }
149366
+ }
149367
+ if (!areaId) continue;
149368
+ const summary = areaSummary.get(areaId);
149369
+ if (summary) {
149370
+ summary.entityCount++;
149371
+ summary.domains[domain] = (summary.domains[domain] || 0) + 1;
149372
+ }
149373
+ }
149374
+ const result = [...areaSummary.entries()].map(([area_id, data]) => ({
149375
+ area_id,
149376
+ name: data.name,
149377
+ entityCount: data.entityCount,
149378
+ domains: data.domains
149379
+ })).sort((a, b) => a.name.localeCompare(b.name));
149380
+ res.status(200).json(result);
149381
+ });
149307
149382
  router.get("/filter-values", async (_, res) => {
149308
149383
  if (!haRegistry) {
149309
149384
  res.status(503).json({ error: "Home Assistant registry not available" });
@@ -175462,15 +175537,15 @@ var BridgeRegistry = class _BridgeRegistry {
175462
175537
  }
175463
175538
  /**
175464
175539
  * Check if auto humidity mapping is enabled for this bridge.
175465
- * Default: false (disabled by default, user must explicitly enable).
175540
+ * Default: true (enabled by default).
175466
175541
  * When enabled, humidity sensors on the same device as a temperature sensor
175467
175542
  * are combined into a single TemperatureHumiditySensor endpoint.
175468
175543
  * Note: Apple Home does not display humidity on TemperatureSensorDevice
175469
- * endpoints, so users on Apple Home should keep this disabled.
175544
+ * endpoints, so users on Apple Home should explicitly disable this.
175470
175545
  * See: https://github.com/RiDDiX/home-assistant-matter-hub/issues/133
175471
175546
  */
175472
175547
  isAutoHumidityMappingEnabled() {
175473
- return this.dataProvider.featureFlags?.autoHumidityMapping === true || this.dataProvider.featureFlags?.autoComposedDevices === true;
175548
+ return this.dataProvider.featureFlags?.autoHumidityMapping !== false || this.dataProvider.featureFlags?.autoComposedDevices === true;
175474
175549
  }
175475
175550
  /**
175476
175551
  * Find a humidity sensor entity that belongs to the same HA device.