@riddix/hamh 2.1.0-alpha.502 → 2.1.0-alpha.504

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.
@@ -169319,10 +169319,6 @@ function AutomationDevice(homeAssistantEntity) {
169319
169319
  return AutomationDeviceType.set({ homeAssistantEntity });
169320
169320
  }
169321
169321
 
169322
- // src/matter/endpoints/legacy/binary-sensor/index.ts
169323
- init_dist();
169324
- init_esm();
169325
-
169326
169322
  // ../../node_modules/.pnpm/@matter+main@0.16.10/node_modules/@matter/main/dist/esm/forwards/behaviors/boolean-state.js
169327
169323
  init_nodejs();
169328
169324
 
@@ -169392,6 +169388,10 @@ var ContactSensorWithBatteryType = ContactSensorDevice.with(
169392
169388
  })
169393
169389
  );
169394
169390
 
169391
+ // src/matter/endpoints/legacy/binary-sensor/index.ts
169392
+ init_dist();
169393
+ init_esm();
169394
+
169395
169395
  // src/matter/endpoints/legacy/binary-sensor/motion-sensor.ts
169396
169396
  init_home_assistant_entity_behavior();
169397
169397
 
@@ -175186,6 +175186,16 @@ function SensorDevice(homeAssistantEntity) {
175186
175186
  return void 0;
175187
175187
  }
175188
175188
 
175189
+ // src/matter/endpoints/legacy/switch/dimmable-plugin-unit.ts
175190
+ init_home_assistant_entity_behavior();
175191
+ var DimmablePlugInUnitType = DimmablePlugInUnitDevice.with(
175192
+ IdentifyServer2,
175193
+ BasicInformationServer2,
175194
+ HomeAssistantEntityBehavior,
175195
+ LightOnOffServer,
175196
+ LightLevelControlServer
175197
+ );
175198
+
175189
175199
  // src/matter/endpoints/legacy/switch/index.ts
175190
175200
  init_home_assistant_entity_behavior();
175191
175201
  var SwitchOnOffServer = OnOffServer2();
@@ -175838,6 +175848,26 @@ function createCleanAreaServiceAreaServer(cleanAreaRooms) {
175838
175848
 
175839
175849
  // src/matter/endpoints/legacy/vacuum/behaviors/vacuum-rvc-run-mode-server.ts
175840
175850
  var logger191 = Logger.get("VacuumRvcRunModeServer");
175851
+ function buildValetudoSegmentAction(vacuumEntityId, segmentIds) {
175852
+ const identifier = vacuumEntityId.replace(/^vacuum\.valetudo_/, "");
175853
+ const topic = `valetudo/${identifier}/MapSegmentationCapability/clean/set`;
175854
+ logger191.info(
175855
+ `Valetudo: mqtt.publish to ${topic}, segments: ${segmentIds.join(", ")}`
175856
+ );
175857
+ return {
175858
+ action: "mqtt.publish",
175859
+ target: false,
175860
+ data: {
175861
+ topic,
175862
+ payload: JSON.stringify({
175863
+ action: "start_segment_action",
175864
+ segment_ids: segmentIds.map(String),
175865
+ iterations: 1,
175866
+ customOrder: true
175867
+ })
175868
+ }
175869
+ };
175870
+ }
175841
175871
  function buildSupportedModes2(attributes7, includeUnnamedRooms = false, customAreas) {
175842
175872
  const modes = [
175843
175873
  {
@@ -175996,6 +176026,11 @@ var vacuumRvcRunModeConfig = {
175996
176026
  };
175997
176027
  }
175998
176028
  }
176029
+ const vacuumEntityId = homeAssistant.entityId;
176030
+ if (vacuumEntityId.startsWith("vacuum.valetudo_")) {
176031
+ serviceArea.state.selectedAreas = [];
176032
+ return buildValetudoSegmentAction(vacuumEntityId, selectedAreas);
176033
+ }
175999
176034
  const rooms = parseVacuumRooms(attributes7);
176000
176035
  const roomIds = [];
176001
176036
  let targetMapName;
@@ -176013,25 +176048,6 @@ var vacuumRvcRunModeConfig = {
176013
176048
  `Starting cleaning with selected areas: ${roomIds.join(", ")}`
176014
176049
  );
176015
176050
  serviceArea.state.selectedAreas = [];
176016
- const vacuumEntityId = homeAssistant.entityId;
176017
- if (vacuumEntityId.startsWith("vacuum.valetudo_")) {
176018
- const identifier = vacuumEntityId.replace(/^vacuum\.valetudo_/, "");
176019
- logger191.info(
176020
- `Valetudo vacuum: Using mqtt.publish segment_cleanup for rooms: ${roomIds.join(", ")}`
176021
- );
176022
- return {
176023
- action: "mqtt.publish",
176024
- target: false,
176025
- data: {
176026
- topic: `valetudo/${identifier}/MapSegmentationCapability/clean/set`,
176027
- payload: JSON.stringify({
176028
- segment_ids: roomIds.map(String),
176029
- iterations: 1,
176030
- customOrder: true
176031
- })
176032
- }
176033
- };
176034
- }
176035
176051
  if (isDreameVacuum(attributes7)) {
176036
176052
  if (targetMapName) {
176037
176053
  const vacName = vacuumEntityId.replace("vacuum.", "");
@@ -176136,6 +176152,11 @@ var vacuumRvcRunModeConfig = {
176136
176152
  };
176137
176153
  }
176138
176154
  }
176155
+ const vacuumEntityId = entity.entity_id;
176156
+ if (vacuumEntityId.startsWith("vacuum.valetudo_")) {
176157
+ const segmentId = getRoomIdFromMode(roomMode);
176158
+ return buildValetudoSegmentAction(vacuumEntityId, [segmentId]);
176159
+ }
176139
176160
  const rooms = parseVacuumRooms(attributes7);
176140
176161
  const numericIdFromMode = getRoomIdFromMode(roomMode);
176141
176162
  logger191.info(
@@ -176144,25 +176165,6 @@ var vacuumRvcRunModeConfig = {
176144
176165
  const room = rooms.find((r) => getRoomModeValue(r) === roomMode);
176145
176166
  if (room) {
176146
176167
  const commandId3 = room.originalId ?? room.id;
176147
- const vacuumEntityId = entity.entity_id;
176148
- if (vacuumEntityId.startsWith("vacuum.valetudo_")) {
176149
- const identifier = vacuumEntityId.replace(/^vacuum\.valetudo_/, "");
176150
- logger191.info(
176151
- `Valetudo vacuum: Using mqtt.publish segment_cleanup for room ${room.name} (id: ${commandId3})`
176152
- );
176153
- return {
176154
- action: "mqtt.publish",
176155
- target: false,
176156
- data: {
176157
- topic: `valetudo/${identifier}/MapSegmentationCapability/clean/set`,
176158
- payload: JSON.stringify({
176159
- segment_ids: [String(commandId3)],
176160
- iterations: 1,
176161
- customOrder: true
176162
- })
176163
- }
176164
- };
176165
- }
176166
176168
  if (isDreameVacuum(attributes7)) {
176167
176169
  if (room.mapName) {
176168
176170
  const vacuumName = vacuumEntityId.replace("vacuum.", "");
@@ -177631,6 +177633,9 @@ var matterDeviceTypeFactories = {
177631
177633
  }
177632
177634
  return SwitchDevice(ha);
177633
177635
  },
177636
+ dimmable_plugin_unit: (ha) => DimmablePlugInUnitType.set({
177637
+ homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
177638
+ }),
177634
177639
  on_off_switch: SwitchDevice,
177635
177640
  door_lock: LockDevice,
177636
177641
  window_covering: CoverDevice,
@@ -177686,9 +177691,15 @@ var matterDeviceTypeFactories = {
177686
177691
  electrical_sensor: (ha) => ElectricalSensorType.set({
177687
177692
  homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
177688
177693
  }),
177694
+ contact_sensor: (ha) => ContactSensorType.set({
177695
+ homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
177696
+ }),
177689
177697
  motion_sensor: (ha) => MotionSensorType.set({
177690
177698
  homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
177691
177699
  }),
177700
+ occupancy_sensor: (ha) => OccupancySensorType.set({
177701
+ homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
177702
+ }),
177692
177703
  mode_select: SelectDevice,
177693
177704
  water_valve: ValveDevice,
177694
177705
  pump: PumpEndpoint,