@riddix/hamh 2.1.0-alpha.375 → 2.1.0-alpha.376

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.
@@ -148293,7 +148293,8 @@ function entityMappingApi(mappingStorage) {
148293
148293
  powerEntity: body.powerEntity,
148294
148294
  energyEntity: body.energyEntity,
148295
148295
  suctionLevelEntity: body.suctionLevelEntity,
148296
- mopIntensityEntity: body.mopIntensityEntity
148296
+ mopIntensityEntity: body.mopIntensityEntity,
148297
+ customServiceAreas: body.customServiceAreas
148297
148298
  };
148298
148299
  const config10 = await mappingStorage.setMapping(request);
148299
148300
  res.status(200).json(config10);
@@ -172204,7 +172205,8 @@ var vacuumRvcRunModeConfig = {
172204
172205
  return { action: "vacuum.stop" };
172205
172206
  },
172206
172207
  cleanRoom: (roomMode, agent) => {
172207
- const entity = agent.get(HomeAssistantEntityBehavior).entity;
172208
+ const homeAssistant = agent.get(HomeAssistantEntityBehavior);
172209
+ const entity = homeAssistant.entity;
172208
172210
  const attributes7 = entity.state.attributes;
172209
172211
  const rooms = parseVacuumRooms(attributes7);
172210
172212
  const numericIdFromMode = getRoomIdFromMode(roomMode);
@@ -172218,6 +172220,20 @@ var vacuumRvcRunModeConfig = {
172218
172220
  logger180.info(
172219
172221
  `Found room by mode match: ${room ? `${room.name} (id=${room.id})` : "none"}`
172220
172222
  );
172223
+ const customAreas = homeAssistant.state.mapping?.customServiceAreas;
172224
+ if (customAreas && customAreas.length > 0 && room) {
172225
+ const area = customAreas.find((a) => a.name === room.name);
172226
+ if (area) {
172227
+ logger180.info(
172228
+ `cleanRoom: custom service area "${area.name}" \u2192 ${area.service}`
172229
+ );
172230
+ return {
172231
+ action: area.service,
172232
+ target: area.target,
172233
+ data: area.data
172234
+ };
172235
+ }
172236
+ }
172221
172237
  if (room) {
172222
172238
  const commandId3 = room.originalId ?? room.id;
172223
172239
  const vacuumEntityId = entity.entity_id;