hoffmation-base 3.0.0-alpha.24 → 3.0.0-alpha.26

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.
@@ -22,6 +22,7 @@ import { iDachsSettings } from './iDachsSettings';
22
22
  import { iEnergyManagerSettings } from './iEnergyManagerSettings';
23
23
  import { iUnifiSettings } from './iUnifiSettings';
24
24
  import { iBlockAutomaticHandlerDefaults } from './iBlockAutomaticHandlerDefaults';
25
+ import { iRestSettings } from './iRestSettings';
25
26
  /**
26
27
  * The main configuration for Hoffmation normally stored in the `main-config.json` file.
27
28
  */
@@ -66,7 +67,7 @@ export interface iConfig {
66
67
  * The URL to the ioBroker instance.
67
68
  * @deprecated Please use the ioBroker property instead
68
69
  */
69
- ioBrokerUrl: string;
70
+ ioBrokerUrl?: string;
70
71
  /**
71
72
  * @see iIobrokerSettigns
72
73
  */
@@ -95,6 +96,10 @@ export interface iConfig {
95
96
  * @see iPollySettings
96
97
  */
97
98
  polly?: iPollySettings;
99
+ /**
100
+ * @see iRestSettings
101
+ */
102
+ restServer?: iRestSettings;
98
103
  /**
99
104
  * @see iRoomDefaultSettings
100
105
  */
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Interface for the REST settings.
3
+ * This is primarily used to configure the REST service within Hoffmation-Express.
4
+ */
5
+ export interface iRestSettings {
6
+ /**
7
+ * Whether the REST service should be active.
8
+ */
9
+ active: boolean;
10
+ /**
11
+ * The port the REST service should listen on.
12
+ */
13
+ port?: number;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,6 +2,7 @@ export * from './iConfig';
2
2
  export * from './iBlueIrisSettings';
3
3
  export * from './iBluetoothTrackingSettings';
4
4
  export * from './iEspresenseSettings';
5
+ export * from './iRestSettings';
5
6
  export * from './iAsusConfig';
6
7
  export * from './iDaikinSettings';
7
8
  export * from './iEnergyManagerSettings';
@@ -18,6 +18,7 @@ __exportStar(require("./iConfig"), exports);
18
18
  __exportStar(require("./iBlueIrisSettings"), exports);
19
19
  __exportStar(require("./iBluetoothTrackingSettings"), exports);
20
20
  __exportStar(require("./iEspresenseSettings"), exports);
21
+ __exportStar(require("./iRestSettings"), exports);
21
22
  __exportStar(require("./iAsusConfig"), exports);
22
23
  __exportStar(require("./iDaikinSettings"), exports);
23
24
  __exportStar(require("./iEnergyManagerSettings"), exports);
@@ -37,7 +37,7 @@ class DeviceUpdater {
37
37
  classifier = devices_1.Devices.IDENTIFIER_ZIGBEE;
38
38
  devId = idSplit[2].substring(2);
39
39
  }
40
- const device = services_1.API.getDevice(`${classifier}-${devId}`);
40
+ const device = services_1.API.getDevice(`${classifier}-${devId}`, false);
41
41
  if (typeof device === 'undefined' || device.update === undefined) {
42
42
  return;
43
43
  }
@@ -19,7 +19,7 @@ export declare class API {
19
19
  static getDevices(): {
20
20
  [id: string]: iBaseDevice;
21
21
  };
22
- static getDevice(id: string): iBaseDevice;
22
+ static getDevice(id: string, warnIfNotFound?: boolean): iBaseDevice;
23
23
  static getGroup(id: string): BaseGroup | undefined;
24
24
  static getRooms(): Map<string, RoomBase>;
25
25
  static getRoom(id: string): RoomBase | undefined;
@@ -45,9 +45,9 @@ class API {
45
45
  return devices_1.Devices.alLDevices;
46
46
  }
47
47
  // TODO: Missing Comment
48
- static getDevice(id) {
48
+ static getDevice(id, warnIfNotFound = true) {
49
49
  const d = devices_1.Devices.alLDevices[id];
50
- if (d === undefined) {
50
+ if (d === undefined && warnIfNotFound) {
51
51
  log_service_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `Api.getDevice() --> "${id}" not found`);
52
52
  }
53
53
  return d;