hoffmation-base 2.15.0 → 2.15.1
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.d.ts +1 -0
- package/lib/index.js +5 -1
- package/lib/server/devices/baseDeviceInterfaces/iBluetoothDetector.d.ts +1 -1
- package/lib/server/devices/espresense/detectedBluetoothDevice.js +1 -1
- package/lib/server/devices/espresense/trilateration.js +3 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export declare class HoffmationInitializationObject {
|
|
|
10
10
|
export declare class HoffmationBase {
|
|
11
11
|
static ioMain: ioBrokerMain;
|
|
12
12
|
static initializeBeforeIoBroker(initObject: HoffmationInitializationObject): Promise<void>;
|
|
13
|
+
static initializePostRoomCreationBeforeIoBroker(): void;
|
|
13
14
|
static initializePostIoBroker(defaultMuellSonos?: iSpeaker): void;
|
|
14
15
|
static startIoBroker(devices: Devices): void;
|
|
15
16
|
}
|
package/lib/index.js
CHANGED
|
@@ -63,10 +63,14 @@ class HoffmationBase {
|
|
|
63
63
|
server_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Asus Router settings detected --> initializing`);
|
|
64
64
|
new server_1.AsusRouter(server_1.SettingsService.settings.asusConfig);
|
|
65
65
|
}
|
|
66
|
-
server_1.Trilateration.initialize();
|
|
67
66
|
server_1.TimeCallbackService.init();
|
|
68
67
|
server_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Hoffmation-Base First Initializations finished`);
|
|
69
68
|
}
|
|
69
|
+
static initializePostRoomCreationBeforeIoBroker() {
|
|
70
|
+
server_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Hoffmation-Base Post Room Creation`);
|
|
71
|
+
server_1.Trilateration.initialize();
|
|
72
|
+
server_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Hoffmation-Base Post Room Creation finished`);
|
|
73
|
+
}
|
|
70
74
|
static initializePostIoBroker(defaultMuellSonos) {
|
|
71
75
|
var _a, _b;
|
|
72
76
|
server_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Hoffmation-Base Post ioBrokerInitializations`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { iRoomDevice } from './iRoomDevice';
|
|
2
2
|
import { ProximityCallback, TrilaterationBasePoint } from '../espresense';
|
|
3
3
|
export interface iBluetoothDetector extends iRoomDevice {
|
|
4
|
-
position
|
|
4
|
+
position: TrilaterationBasePoint;
|
|
5
5
|
/**
|
|
6
6
|
* Add callback to react on a specified device entering/leaving a given zone
|
|
7
7
|
* @param cb
|
|
@@ -105,7 +105,7 @@ class DetectedBluetoothDevice {
|
|
|
105
105
|
const distances = [];
|
|
106
106
|
for (const key of this.distanceMap.keys()) {
|
|
107
107
|
const tracker = services_1.API.getDevice(key);
|
|
108
|
-
if (tracker === undefined
|
|
108
|
+
if (tracker === undefined) {
|
|
109
109
|
continue;
|
|
110
110
|
}
|
|
111
111
|
const distance = this.getDistance(key);
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Trilateration = void 0;
|
|
4
4
|
const trilaterationPoint_1 = require("./trilaterationPoint");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const services_1 = require("../../services");
|
|
5
7
|
class Trilateration {
|
|
6
8
|
static addRoom(room, startPoint, endPoint) {
|
|
7
9
|
const points = trilaterationPoint_1.TrilaterationPoint.getPointsInRange(startPoint, endPoint, room.roomName);
|
|
8
10
|
this.possiblePoints.push(...points);
|
|
9
11
|
}
|
|
10
12
|
static initialize() {
|
|
13
|
+
services_1.ServerLogService.writeLog(models_1.LogLevel.Info, `Initializing Trilateration for ${this.basePoints.length} base points, with ${this.possiblePoints.length} possible points.`);
|
|
11
14
|
for (const basePoint of this.basePoints) {
|
|
12
15
|
basePoint.fillMap(this.possiblePoints);
|
|
13
16
|
}
|