hoffmation-base 3.2.25 → 3.2.27

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.
@@ -8,6 +8,15 @@ export interface iDeviceSettings extends iObjectSettings {
8
8
  *
9
9
  */
10
10
  energySettings: iExcessEnergyConsumerSettings | undefined;
11
+ /**
12
+ * The position of the device in the room in meters
13
+ * @default {x: 0, y: 0, z: 0}
14
+ */
15
+ trilaterationRoomPosition: {
16
+ x: number;
17
+ y: number;
18
+ z: number;
19
+ };
11
20
  /**
12
21
  *
13
22
  */
@@ -0,0 +1,17 @@
1
+ /**
2
+ *
3
+ */
4
+ export interface iTrilaterationCoordinate {
5
+ /**
6
+ *
7
+ */
8
+ x: number;
9
+ /**
10
+ *
11
+ */
12
+ y: number;
13
+ /**
14
+ *
15
+ */
16
+ z: number;
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,19 +1,8 @@
1
+ import { iTrilaterationCoordinate } from './iTrilaterationCoordinate';
1
2
  /**
2
3
  *
3
4
  */
4
- export interface iTrilaterationPoint {
5
- /**
6
- *
7
- */
8
- x: number;
9
- /**
10
- *
11
- */
12
- y: number;
13
- /**
14
- *
15
- */
16
- z: number;
5
+ export interface iTrilaterationPoint extends iTrilaterationCoordinate {
17
6
  /**
18
7
  *
19
8
  */
@@ -53,3 +53,4 @@ export { iDeviceCluster } from './iDevicecluster';
53
53
  export { iDaytime } from './iDaytime';
54
54
  export { iBlockAutomaticHandler } from './iBlockAutomaticHandler';
55
55
  export { iTemperatureMeasurement } from './iTemperatureMeasurement';
56
+ export { iTrilaterationCoordinate } from './iTrilaterationCoordinate';
@@ -1,3 +1,4 @@
1
+ import { iRestUser } from './iRestUser';
1
2
  /**
2
3
  * Interface for the REST settings.
3
4
  * This is primarily used to configure the REST service within Hoffmation-Express.
@@ -7,8 +8,16 @@ export interface iRestSettings {
7
8
  * Whether the REST service should be active.
8
9
  */
9
10
  active: boolean;
11
+ /**
12
+ * Whether the Web UI should be active.
13
+ */
14
+ webUi: boolean;
10
15
  /**
11
16
  * The port the REST service should listen on.
12
17
  */
13
18
  port?: number;
19
+ /**
20
+ * The allowed users for the REST service.
21
+ */
22
+ user?: iRestUser[];
14
23
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ *
3
+ */
4
+ export interface iRestUser {
5
+ /**
6
+ *
7
+ */
8
+ username: string;
9
+ /**
10
+ *
11
+ */
12
+ passwordHash: string;
13
+ /**
14
+ *
15
+ */
16
+ publicKey: string;
17
+ /**
18
+ *
19
+ */
20
+ permissions: string[];
21
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -30,4 +30,5 @@ export { iLedSettings } from './iLedSettings';
30
30
  export { iSceneSettings } from './iSceneSettings';
31
31
  export { iSettingsProvider } from './iSettingsProvider';
32
32
  export { iWledSettings } from './iWledSettings';
33
+ export { iRestUser } from './iRestUser';
33
34
  export { iGlobalHeaterSettings } from './iGlobalHeaterSettings';
@@ -18,6 +18,7 @@ exports.ExampleConfig = {
18
18
  },
19
19
  restServer: {
20
20
  active: true,
21
+ webUi: true,
21
22
  expressPort: 4444,
22
23
  },
23
24
  roomDefault: {
@@ -1,8 +1,13 @@
1
- import { iBlockAutomaticSettings, iDeviceSettings, iExcessEnergyConsumerSettings } from '../../interfaces';
1
+ import { iBlockAutomaticSettings, iDeviceSettings, iExcessEnergyConsumerSettings, iTrilaterationCoordinate } from '../../interfaces';
2
2
  import { ObjectSettings } from '../objectSettings';
3
3
  import { BlockAutomaticCommand, iBaseCommand } from '../../command';
4
4
  export declare abstract class DeviceSettings extends ObjectSettings implements iDeviceSettings {
5
5
  buildBlockAutomaticCommand(c: iBaseCommand): BlockAutomaticCommand | null | undefined;
6
+ /**
7
+ * The position of the device in the room in meters
8
+ * @default {x: 0, y: 0, z: 0}
9
+ */
10
+ trilaterationRoomPosition: iTrilaterationCoordinate;
6
11
  /**
7
12
  * Any device could be an energy consumer, so we have to provide the settings for it
8
13
  * @default undefined
@@ -9,6 +9,11 @@ const command_1 = require("../../command");
9
9
  class DeviceSettings extends objectSettings_1.ObjectSettings {
10
10
  constructor() {
11
11
  super(...arguments);
12
+ /**
13
+ * The position of the device in the room in meters
14
+ * @default {x: 0, y: 0, z: 0}
15
+ */
16
+ this.trilaterationRoomPosition = { x: 0, y: 0, z: 0 };
12
17
  /**
13
18
  * Any device could be an energy consumer, so we have to provide the settings for it
14
19
  * @default undefined
@@ -33,7 +38,7 @@ class DeviceSettings extends objectSettings_1.ObjectSettings {
33
38
  return new command_1.BlockAutomaticCommand(c, (_b = this.blockAutomaticSettings) === null || _b === void 0 ? void 0 : _b.blockAutomaticDurationMS, '', (_c = this.blockAutomaticSettings) === null || _c === void 0 ? void 0 : _c.defaultCollisionSolving, (_d = this.blockAutomaticSettings) === null || _d === void 0 ? void 0 : _d.revertToAutomaticAtBlockLift);
34
39
  }
35
40
  fromPartialObject(_obj) {
36
- var _a;
41
+ var _a, _b;
37
42
  if (_obj.energySettings) {
38
43
  if (this.energySettings === undefined) {
39
44
  this.energySettings = new excessEnergyConsumerSettings_1.ExcessEnergyConsumerSettings();
@@ -47,6 +52,7 @@ class DeviceSettings extends objectSettings_1.ObjectSettings {
47
52
  this.blockAutomaticSettings.fromPartialObject(_obj.blockAutomaticSettings);
48
53
  }
49
54
  this.skipInHomebridge = (_a = _obj.skipInHomebridge) !== null && _a !== void 0 ? _a : this.skipInHomebridge;
55
+ this.trilaterationRoomPosition = (_b = _obj.trilaterationRoomPosition) !== null && _b !== void 0 ? _b : this.trilaterationRoomPosition;
50
56
  super.fromPartialObject(_obj);
51
57
  }
52
58
  toJSON() {