matterbridge-roborock-vacuum-plugin 1.1.0-rc17 → 1.1.0-rc18

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.
@@ -87,7 +87,7 @@ function processValidData(enableMultipleMap, vacuumRooms, roomMap) {
87
87
  const supportedAreas = roomMap?.rooms !== undefined && roomMap.rooms.length > 0
88
88
  ? roomMap.rooms.map((room, index) => {
89
89
  const locationName = room.displayName ?? vacuumRooms.find((r) => r.id === room.globalId || r.id === room.id)?.name ?? `Unknown Room ${randomInt(1000, 9999)}`;
90
- const areaId = index + 100;
90
+ const areaId = enableMultipleMap ? index + 100 : room.id;
91
91
  const mapId = enableMultipleMap ? (room.mapId ?? null) : null;
92
92
  indexMap.set(areaId, { roomId: room.id, mapId: room.mapId ?? null });
93
93
  return {
@@ -103,7 +103,8 @@ export class PlatformRunner {
103
103
  if (segment_id !== -1 && isMappedArea) {
104
104
  this.platform.log.debug(`RoomMap: ${roomMap ? debugStringify(roomMap) : 'undefined'}`);
105
105
  this.platform.log.debug(`Part1: CurrentRoom: ${segment_id}, room name: ${roomMap?.rooms.find((x) => x.id === segment_id || x.alternativeId === segment_id.toString())?.displayName ?? 'unknown'}`);
106
- const areaId = roomIndexMap?.getAreaId(segment_id) ?? null;
106
+ const areaId = roomIndexMap?.getAreaId(segment_id) ?? segment_id;
107
+ this.platform.log.notice(`AreaId: ${areaId}, segment_id: ${segment_id}`);
107
108
  robot.updateAttribute(ServiceArea.Cluster.id, 'currentArea', areaId, platform.log);
108
109
  }
109
110
  if (segment_id == -1) {
@@ -113,7 +114,8 @@ export class PlatformRunner {
113
114
  if (target_segment_id !== -1 && isTargetMappedArea) {
114
115
  this.platform.log.debug(`RoomMap: ${roomMap ? debugStringify(roomMap) : 'undefined'}`);
115
116
  this.platform.log.debug(`Part2: TargetRoom: ${target_segment_id}, room name: ${roomMap?.rooms.find((x) => x.id === target_segment_id || x.alternativeId === segment_id.toString())?.displayName ?? 'unknown'}`);
116
- const areaId = roomIndexMap?.getAreaId(target_segment_id) ?? null;
117
+ const areaId = roomIndexMap?.getAreaId(target_segment_id) ?? target_room_id;
118
+ this.platform.log.notice(`AreaId: ${areaId}, target_segment_id: ${target_segment_id}`);
117
119
  robot.updateAttribute(ServiceArea.Cluster.id, 'currentArea', areaId, platform.log);
118
120
  }
119
121
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "matterbridge-roborock-vacuum-plugin",
3
3
  "type": "DynamicPlatform",
4
- "version": "1.1.0-rc17",
4
+ "version": "1.1.0-rc18",
5
5
  "whiteList": [],
6
6
  "blackList": [],
7
7
  "useInterval": true,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "title": "Matterbridge Roborock Vacuum Plugin",
3
- "description": "matterbridge-roborock-vacuum-plugin v. 1.1.0-rc17 by https://github.com/RinDevJunior",
3
+ "description": "matterbridge-roborock-vacuum-plugin v. 1.1.0-rc18 by https://github.com/RinDevJunior",
4
4
  "type": "object",
5
5
  "required": [
6
6
  "username",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-roborock-vacuum-plugin",
3
- "version": "1.1.0-rc17",
3
+ "version": "1.1.0-rc18",
4
4
  "description": "Matterbridge Roborock Vacuum Plugin",
5
5
  "author": "https://github.com/RinDevJunior",
6
6
  "license": "MIT",
@@ -113,7 +113,7 @@ function processValidData(
113
113
  ? roomMap.rooms.map((room, index) => {
114
114
  const locationName = room.displayName ?? vacuumRooms.find((r) => r.id === room.globalId || r.id === room.id)?.name ?? `Unknown Room ${randomInt(1000, 9999)}`;
115
115
 
116
- const areaId = index + 100;
116
+ const areaId = enableMultipleMap ? index + 100 : room.id;
117
117
  const mapId = enableMultipleMap ? (room.mapId ?? null) : null;
118
118
 
119
119
  indexMap.set(areaId, { roomId: room.id, mapId: room.mapId ?? null });
@@ -137,8 +137,8 @@ export class PlatformRunner {
137
137
  `Part1: CurrentRoom: ${segment_id}, room name: ${roomMap?.rooms.find((x) => x.id === segment_id || x.alternativeId === segment_id.toString())?.displayName ?? 'unknown'}`,
138
138
  );
139
139
 
140
- const areaId = roomIndexMap?.getAreaId(segment_id) ?? null;
141
-
140
+ const areaId = roomIndexMap?.getAreaId(segment_id) ?? segment_id;
141
+ this.platform.log.notice(`AreaId: ${areaId}, segment_id: ${segment_id}`);
142
142
  robot.updateAttribute(ServiceArea.Cluster.id, 'currentArea', areaId, platform.log);
143
143
  }
144
144
 
@@ -152,7 +152,8 @@ export class PlatformRunner {
152
152
  this.platform.log.debug(
153
153
  `Part2: TargetRoom: ${target_segment_id}, room name: ${roomMap?.rooms.find((x) => x.id === target_segment_id || x.alternativeId === segment_id.toString())?.displayName ?? 'unknown'}`,
154
154
  );
155
- const areaId = roomIndexMap?.getAreaId(target_segment_id) ?? null;
155
+ const areaId = roomIndexMap?.getAreaId(target_segment_id) ?? target_room_id;
156
+ this.platform.log.notice(`AreaId: ${areaId}, target_segment_id: ${target_segment_id}`);
156
157
  robot.updateAttribute(ServiceArea.Cluster.id, 'currentArea', areaId, platform.log);
157
158
  }
158
159
  }