@riddix/hamh 2.1.0-alpha.700 → 2.1.0-alpha.702

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.
@@ -123791,6 +123791,13 @@ var init_water_heater = __esm({
123791
123791
  }
123792
123792
  });
123793
123793
 
123794
+ // ../common/dist/domains/weather.js
123795
+ var init_weather = __esm({
123796
+ "../common/dist/domains/weather.js"() {
123797
+ "use strict";
123798
+ }
123799
+ });
123800
+
123794
123801
  // ../common/dist/domains/index.js
123795
123802
  var init_domains = __esm({
123796
123803
  "../common/dist/domains/index.js"() {
@@ -123807,6 +123814,7 @@ var init_domains = __esm({
123807
123814
  init_sensor();
123808
123815
  init_vacuum();
123809
123816
  init_water_heater();
123817
+ init_weather();
123810
123818
  }
123811
123819
  });
123812
123820
 
@@ -123869,6 +123877,7 @@ var init_home_assistant_domain = __esm({
123869
123877
  HomeAssistantDomain2["vacuum"] = "vacuum";
123870
123878
  HomeAssistantDomain2["valve"] = "valve";
123871
123879
  HomeAssistantDomain2["water_heater"] = "water_heater";
123880
+ HomeAssistantDomain2["weather"] = "weather";
123872
123881
  })(HomeAssistantDomain || (HomeAssistantDomain = {}));
123873
123882
  }
123874
123883
  });
@@ -127326,6 +127335,7 @@ function matterApi(bridgeService, haRegistry) {
127326
127335
  "light",
127327
127336
  "switch",
127328
127337
  "sensor",
127338
+ "weather",
127329
127339
  "binary_sensor",
127330
127340
  "climate",
127331
127341
  "cover",
@@ -151675,6 +151685,13 @@ var hvacActionToRunningMode = {
151675
151685
  [ClimateHvacAction.idle]: Thermostat3.ThermostatRunningMode.Off,
151676
151686
  [ClimateHvacAction.off]: Thermostat3.ThermostatRunningMode.Off
151677
151687
  };
151688
+ function getRunningModeFromHvacAction(entity) {
151689
+ const action = attributes4(entity).hvac_action;
151690
+ if (!action) {
151691
+ return Thermostat3.ThermostatRunningMode.Off;
151692
+ }
151693
+ return hvacActionToRunningMode[action] ?? Thermostat3.ThermostatRunningMode.Off;
151694
+ }
151678
151695
  var hvacModeToSystemMode = {
151679
151696
  [ClimateHvacMode.heat]: Thermostat3.SystemMode.Heat,
151680
151697
  [ClimateHvacMode.cool]: Thermostat3.SystemMode.Cool,
@@ -151820,13 +151837,7 @@ var config4 = {
151820
151837
  homeAssistant.state.mapping?.climateKeepModeOnIdle === true
151821
151838
  );
151822
151839
  },
151823
- getRunningMode: (entity) => {
151824
- const action = attributes4(entity).hvac_action;
151825
- if (!action) {
151826
- return Thermostat3.ThermostatRunningMode.Off;
151827
- }
151828
- return hvacActionToRunningMode[action] ?? Thermostat3.ThermostatRunningMode.Off;
151829
- },
151840
+ getRunningMode: (entity) => getRunningModeFromHvacAction(entity),
151830
151841
  getControlSequence: (entity, agent) => {
151831
151842
  const modes = attributes4(entity).hvac_modes ?? [];
151832
151843
  if (isHeatCoolOnly(modes)) {
@@ -159504,6 +159515,54 @@ function WaterHeaterDevice(homeAssistantEntity) {
159504
159515
  });
159505
159516
  }
159506
159517
 
159518
+ // src/matter/endpoints/legacy/weather/weather-device.ts
159519
+ init_home_assistant_entity_behavior();
159520
+ var temperatureConfig5 = {
159521
+ getValue(entity, agent) {
159522
+ const fallbackUnit = agent.env.get(HomeAssistantConfig).unitSystem.temperature;
159523
+ const attributes7 = entity.attributes;
159524
+ const temperature3 = attributes7.temperature;
159525
+ if (temperature3 == null || Number.isNaN(temperature3)) {
159526
+ return void 0;
159527
+ }
159528
+ return Temperature.withUnit(
159529
+ temperature3,
159530
+ attributes7.temperature_unit ?? fallbackUnit
159531
+ );
159532
+ }
159533
+ };
159534
+ var humidityConfig5 = {
159535
+ getValue(entity) {
159536
+ const attributes7 = entity.attributes;
159537
+ const humidity = attributes7.humidity;
159538
+ if (humidity == null || Number.isNaN(humidity)) {
159539
+ return null;
159540
+ }
159541
+ return humidity;
159542
+ }
159543
+ };
159544
+ var pressureConfig4 = {
159545
+ getValue(entity) {
159546
+ const attributes7 = entity.attributes;
159547
+ const pressure = attributes7.pressure;
159548
+ if (pressure == null || Number.isNaN(pressure)) {
159549
+ return void 0;
159550
+ }
159551
+ return convertPressureToHpa(pressure, attributes7.pressure_unit);
159552
+ }
159553
+ };
159554
+ var WeatherSensorType = TemperatureSensorDevice.with(
159555
+ BasicInformationServer2,
159556
+ IdentifyServer2,
159557
+ HomeAssistantEntityBehavior,
159558
+ TemperatureMeasurementServer2(temperatureConfig5),
159559
+ HumidityMeasurementServer(humidityConfig5),
159560
+ PressureMeasurementServer2(pressureConfig4)
159561
+ );
159562
+ function WeatherDevice(homeAssistant) {
159563
+ return WeatherSensorType.set({ homeAssistantEntity: homeAssistant });
159564
+ }
159565
+
159507
159566
  // src/matter/endpoints/legacy/create-legacy-endpoint-type.ts
159508
159567
  var legacyLogger = Logger.get("LegacyEndpointType");
159509
159568
  function createLegacyEndpointType(entity, mapping, areaName, options) {
@@ -159589,7 +159648,8 @@ var deviceCtrs = {
159589
159648
  alarm_control_panel: AlarmControlPanelDevice,
159590
159649
  remote: RemoteDevice,
159591
159650
  water_heater: WaterHeaterDevice,
159592
- event: EventDevice
159651
+ event: EventDevice,
159652
+ weather: WeatherDevice
159593
159653
  };
159594
159654
  var matterDeviceTypeFactories = {
159595
159655
  on_off_light: (ha) => OnOffLightType.set({ homeAssistantEntity: ha }),