hoffmation-base 2.15.2 → 2.15.4

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.
package/lib/index.js CHANGED
@@ -68,12 +68,12 @@ class HoffmationBase {
68
68
  }
69
69
  static initializePostRoomCreationBeforeIoBroker() {
70
70
  server_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Hoffmation-Base Post Room Creation`);
71
- server_1.Trilateration.initialize();
72
71
  server_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Hoffmation-Base Post Room Creation finished`);
73
72
  }
74
73
  static initializePostIoBroker(defaultMuellSonos) {
75
74
  var _a, _b;
76
75
  server_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Hoffmation-Base Post ioBrokerInitializations`);
76
+ server_1.Trilateration.initialize();
77
77
  if (server_1.SettingsService.TelegramActive)
78
78
  server_1.TelegramCommands.initialize();
79
79
  if ((_a = server_1.SettingsService.settings.sonos) === null || _a === void 0 ? void 0 : _a.active) {
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TrilaterationBasePoint = void 0;
4
4
  const trilaterationRatedCoordinate_1 = require("./trilaterationRatedCoordinate");
5
5
  const trilaterationPoint_1 = require("./trilaterationPoint");
6
+ const services_1 = require("../../services");
7
+ const models_1 = require("../../../models");
6
8
  class TrilaterationBasePoint {
7
9
  constructor(x, y, z, roomName, _maximumDistance = 8) {
8
10
  this.x = x;
@@ -34,16 +36,18 @@ class TrilaterationBasePoint {
34
36
  }
35
37
  fillMap(points) {
36
38
  var _a;
39
+ let count = 0;
37
40
  for (const point of points) {
38
41
  const distance = point.getDot5Distance(this.ownPoint);
39
42
  if (distance > this._maximumDistance) {
40
43
  continue;
41
44
  }
42
- if (!this.precalculatedDistances.has(distance)) {
43
- this.precalculatedDistances.set(distance, []);
44
- }
45
- (_a = this.precalculatedDistances.get(distance)) === null || _a === void 0 ? void 0 : _a.push(point.coordinateName);
45
+ count++;
46
+ const distancePoints = (_a = this.precalculatedDistances.get(distance)) !== null && _a !== void 0 ? _a : [];
47
+ distancePoints.push(point.coordinateName);
48
+ this.precalculatedDistances.set(distance, distancePoints);
46
49
  }
50
+ services_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Filled ${count} distances for Trilateration in room: ${this.roomName}`);
47
51
  }
48
52
  }
49
53
  exports.TrilaterationBasePoint = TrilaterationBasePoint;