hoffmation-base 3.0.0-alpha.20 → 3.0.0-alpha.21

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.
Files changed (159) hide show
  1. package/lib/liquid-pid.d.ts +2 -5
  2. package/lib/liquid-pid.js +2 -5
  3. package/lib/models/command/ShutterSetLevelCommand.d.ts +7 -0
  4. package/lib/models/command/ShutterSetLevelCommand.js +7 -1
  5. package/lib/models/command/WindowRestoreDesiredPositionCommand.d.ts +5 -0
  6. package/lib/models/command/WindowRestoreDesiredPositionCommand.js +5 -1
  7. package/lib/models/command/WindowSetDesiredPositionCommand.d.ts +6 -0
  8. package/lib/models/command/WindowSetDesiredPositionCommand.js +6 -1
  9. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.d.ts +5 -0
  10. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.js +5 -1
  11. package/lib/models/command/actuatorSetStateCommand.d.ts +7 -0
  12. package/lib/models/command/actuatorSetStateCommand.js +7 -1
  13. package/lib/models/command/actuatorToggleCommand.d.ts +5 -0
  14. package/lib/models/command/actuatorToggleCommand.js +5 -1
  15. package/lib/models/command/actuatorWriteStateToDeviceCommand.d.ts +6 -0
  16. package/lib/models/command/actuatorWriteStateToDeviceCommand.js +6 -1
  17. package/lib/models/command/baseCommand.d.ts +10 -0
  18. package/lib/models/command/baseCommand.js +16 -1
  19. package/lib/models/command/blockAutomaticCommand.d.ts +4 -4
  20. package/lib/models/command/blockAutomaticCommand.js +4 -4
  21. package/lib/models/command/blockAutomaticLiftBlockCommand.d.ts +2 -2
  22. package/lib/models/command/blockAutomaticLiftBlockCommand.js +2 -2
  23. package/lib/models/command/blockAutomaticUntilCommand.d.ts +4 -4
  24. package/lib/models/command/blockAutomaticUntilCommand.js +4 -4
  25. package/lib/models/command/commandSource.d.ts +19 -0
  26. package/lib/models/command/commandSource.js +20 -1
  27. package/lib/models/command/dimmerSetLightCommand.d.ts +7 -6
  28. package/lib/models/command/dimmerSetLightCommand.js +7 -6
  29. package/lib/models/command/floorSetAllShuttersCommand.d.ts +4 -4
  30. package/lib/models/command/floorSetAllShuttersCommand.js +4 -4
  31. package/lib/models/command/lampSetLightCommand.d.ts +7 -0
  32. package/lib/models/command/lampSetLightCommand.js +7 -1
  33. package/lib/models/command/lampSetTimeBasedCommand.d.ts +4 -4
  34. package/lib/models/command/lampSetTimeBasedCommand.js +4 -4
  35. package/lib/models/command/lampToggleLightCommand.d.ts +5 -5
  36. package/lib/models/command/lampToggleLightCommand.js +5 -5
  37. package/lib/models/command/ledSetLightCommand.d.ts +15 -9
  38. package/lib/models/command/ledSetLightCommand.js +15 -10
  39. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.d.ts +6 -0
  40. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.js +6 -1
  41. package/lib/models/command/restoreTargetAutomaticValueCommand.d.ts +5 -0
  42. package/lib/models/command/restoreTargetAutomaticValueCommand.js +5 -1
  43. package/lib/models/command/roomRestoreLightCommand.d.ts +5 -0
  44. package/lib/models/command/roomRestoreLightCommand.js +5 -1
  45. package/lib/models/command/roomRestoreShutterPositionCommand.d.ts +6 -0
  46. package/lib/models/command/roomRestoreShutterPositionCommand.js +6 -1
  47. package/lib/models/command/roomSetLightTimeBasedCommand.d.ts +3 -3
  48. package/lib/models/command/roomSetLightTimeBasedCommand.js +3 -3
  49. package/lib/models/command/shutterSunriseUpCommand.d.ts +5 -0
  50. package/lib/models/command/shutterSunriseUpCommand.js +5 -1
  51. package/lib/models/command/shutterSunsetDownCommand.d.ts +5 -0
  52. package/lib/models/command/shutterSunsetDownCommand.js +5 -1
  53. package/lib/models/command/wledSetLightCommand.d.ts +10 -0
  54. package/lib/models/command/wledSetLightCommand.js +10 -1
  55. package/lib/models/connectionCallbacks.d.ts +4 -4
  56. package/lib/models/deviceConfig.d.ts +2 -2
  57. package/lib/models/deviceSettings/acSettings.d.ts +0 -5
  58. package/lib/models/deviceSettings/acSettings.js +0 -5
  59. package/lib/models/deviceSettings/actuatorSettings.d.ts +0 -8
  60. package/lib/models/deviceSettings/actuatorSettings.js +0 -8
  61. package/lib/models/deviceSettings/garageDoorOpenerSettings.d.ts +0 -1
  62. package/lib/models/deviceSettings/garageDoorOpenerSettings.js +0 -1
  63. package/lib/models/deviceSettings/heaterSettings.d.ts +0 -6
  64. package/lib/models/deviceSettings/heaterSettings.js +0 -6
  65. package/lib/models/deviceSettings/motionSensorSettings.d.ts +0 -1
  66. package/lib/models/deviceSettings/motionSensorSettings.js +0 -1
  67. package/lib/models/deviceSettings/shutterSettings.d.ts +0 -3
  68. package/lib/models/deviceSettings/shutterSettings.js +0 -3
  69. package/lib/models/groupSettings/heatGroupSettings.d.ts +0 -2
  70. package/lib/models/groupSettings/heatGroupSettings.js +0 -2
  71. package/lib/models/iIdHolder.d.ts +6 -0
  72. package/lib/models/objectSettings.d.ts +2 -2
  73. package/lib/models/objectSettings.js +2 -2
  74. package/lib/models/rooms/RoomBase.d.ts +2 -1
  75. package/lib/models/rooms/RoomBase.js +2 -1
  76. package/lib/models/rooms/iRoomBase.d.ts +17 -0
  77. package/lib/models/rooms/iRoomImportEnforcer.d.ts +4 -0
  78. package/lib/server/devices/Griffe.js +0 -1
  79. package/lib/server/devices/IoBrokerBaseDevice.d.ts +9 -16
  80. package/lib/server/devices/IoBrokerBaseDevice.js +9 -16
  81. package/lib/server/devices/IoBrokerDeviceInfo.d.ts +2 -2
  82. package/lib/server/devices/IoBrokerDeviceInfo.js +6 -4
  83. package/lib/server/devices/baseDeviceInterfaces/iAcDevice.d.ts +32 -0
  84. package/lib/server/devices/baseDeviceInterfaces/iActuator.d.ts +16 -0
  85. package/lib/server/devices/baseDeviceInterfaces/iBaseDevice.d.ts +25 -0
  86. package/lib/server/devices/baseDeviceInterfaces/iBatteryDevice.d.ts +10 -1
  87. package/lib/server/devices/baseDeviceInterfaces/iBluetoothDetector.d.ts +5 -5
  88. package/lib/server/devices/baseDeviceInterfaces/iButtonSwitch.d.ts +13 -0
  89. package/lib/server/devices/baseDeviceInterfaces/iCameraDevice.d.ts +10 -0
  90. package/lib/server/devices/baseDeviceInterfaces/iDimmableLamp.d.ts +9 -2
  91. package/lib/server/devices/baseDeviceInterfaces/iEnergyManager.d.ts +13 -2
  92. package/lib/server/devices/baseDeviceInterfaces/iExcessEnergyConsumer.d.ts +16 -2
  93. package/lib/server/devices/baseDeviceInterfaces/iGarageDoorOpener.d.ts +10 -0
  94. package/lib/server/devices/baseDeviceInterfaces/iHandleSensor.d.ts +12 -0
  95. package/lib/server/devices/baseDeviceInterfaces/iHeater.d.ts +12 -2
  96. package/lib/server/devices/baseDeviceInterfaces/iHumiditySensor.d.ts +7 -0
  97. package/lib/server/devices/baseDeviceInterfaces/iLamp.d.ts +4 -0
  98. package/lib/server/devices/baseDeviceInterfaces/iLedRgbCct.d.ts +5 -0
  99. package/lib/server/devices/baseDeviceInterfaces/iMotionSensor.d.ts +7 -1
  100. package/lib/server/devices/baseDeviceInterfaces/iScene.d.ts +7 -0
  101. package/lib/server/devices/baseDeviceInterfaces/iShutter.d.ts +7 -0
  102. package/lib/server/devices/baseDeviceInterfaces/iSmokeDetectorDevice.d.ts +7 -0
  103. package/lib/server/devices/baseDeviceInterfaces/iSpeaker.d.ts +25 -0
  104. package/lib/server/devices/baseDeviceInterfaces/iTemperatureSensor.d.ts +11 -0
  105. package/lib/server/devices/baseDeviceInterfaces/iTemporaryDisableAutomatic.d.ts +7 -0
  106. package/lib/server/devices/baseDeviceInterfaces/iTvDevice.d.ts +12 -0
  107. package/lib/server/devices/baseDeviceInterfaces/iVibrationSensor.d.ts +0 -1
  108. package/lib/server/devices/blueIris/cameraDevice.d.ts +2 -3
  109. package/lib/server/devices/blueIris/cameraDevice.js +2 -3
  110. package/lib/server/devices/dachs/interfaces/KeyListEntity.d.ts +0 -8
  111. package/lib/server/devices/dachs/interfaces/KeyListEntity.js +0 -8
  112. package/lib/server/devices/dachs/lib/dachsHttpClient.d.ts +1 -1
  113. package/lib/server/devices/groups/Window.d.ts +1 -0
  114. package/lib/server/devices/groups/Window.js +1 -0
  115. package/lib/server/devices/groups/heatGroup.d.ts +6 -6
  116. package/lib/server/devices/groups/heatGroup.js +6 -6
  117. package/lib/server/devices/groups/presenceGroup.d.ts +0 -1
  118. package/lib/server/devices/groups/presenceGroup.js +0 -1
  119. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.d.ts +0 -1
  120. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.js +0 -6
  121. package/lib/server/devices/iDeviceUpdater.d.ts +11 -0
  122. package/lib/server/devices/jsObject/jsObjectEnergyManager.d.ts +1 -1
  123. package/lib/server/devices/jsObject/jsObjectEnergyManager.js +1 -1
  124. package/lib/server/devices/sharedFunctions/lampUtils.js +3 -1
  125. package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.d.ts +1 -1
  126. package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.js +1 -1
  127. package/lib/server/devices/zigbee/BaseDevices/zigbeeSwitch.d.ts +1 -1
  128. package/lib/server/devices/zigbee/zigbeeAquaraVibra.d.ts +1 -1
  129. package/lib/server/devices/zigbee/zigbeeEuroHeater.d.ts +2 -3
  130. package/lib/server/devices/zigbee/zigbeeEuroHeater.js +2 -3
  131. package/lib/server/ioBroker/connection.d.ts +20 -20
  132. package/lib/server/ioBroker/connection.js +29 -21
  133. package/lib/server/ioBroker/socketIOConnectOptions.d.ts +2 -2
  134. package/lib/server/ioBroker/socketIOVisCommand.d.ts +5 -1
  135. package/lib/server/services/Sonos/polly-service.js +1 -2
  136. package/lib/server/services/Translation/res.d.ts +34 -19
  137. package/lib/server/services/Translation/res.js +34 -19
  138. package/lib/server/services/api/api-service.d.ts +72 -70
  139. package/lib/server/services/api/api-service.js +72 -70
  140. package/lib/server/services/blockAutomaticHandler.js +5 -0
  141. package/lib/server/services/dbo/iPersist.d.ts +96 -0
  142. package/lib/server/services/https-service.d.ts +3 -2
  143. package/lib/server/services/https-service.js +3 -2
  144. package/lib/server/services/log-service/log-service.d.ts +2 -2
  145. package/lib/server/services/log-service/log-service.js +2 -2
  146. package/lib/server/services/news-service.d.ts +5 -6
  147. package/lib/server/services/news-service.js +5 -6
  148. package/lib/server/services/room-service/room-service.d.ts +3 -2
  149. package/lib/server/services/room-service/room-service.js +4 -3
  150. package/lib/server/services/settings-service.d.ts +3 -2
  151. package/lib/server/services/settings-service.js +3 -2
  152. package/lib/server/services/utils/iDisposeable.d.ts +3 -0
  153. package/lib/server/services/victron/victron-device.d.ts +2 -2
  154. package/lib/server/services/victron/victron-device.js +2 -2
  155. package/lib/server/services/weather/weather-current.d.ts +0 -2
  156. package/lib/server/services/weather/weather-service.d.ts +4 -1
  157. package/lib/server/services/weather/weather-service.js +4 -0
  158. package/lib/tsconfig.tsbuildinfo +1 -1
  159. package/package.json +6 -5
@@ -9,13 +9,11 @@ class HeatGroupSettings extends groupSettings_1.GroupSettings {
9
9
  this.automaticPoints = [];
10
10
  /**
11
11
  * Whether the temperature should be calculated automatically, or the manualTemperature should be used
12
- * @type {boolean}
13
12
  */
14
13
  this.automaticMode = true;
15
14
  this.automaticFallBackTemperatur = 20;
16
15
  /**
17
16
  * Target temperature when automaticMode is disabled
18
- * @type {number}
19
17
  */
20
18
  this.manualTemperature = 20;
21
19
  }
@@ -3,5 +3,11 @@ import { LogDebugType } from '../server';
3
3
  export interface iIdHolder {
4
4
  readonly id: string;
5
5
  readonly customName: string;
6
+ /**
7
+ * Logs a message for this idHolder
8
+ * @param {LogLevel} level - The log level
9
+ * @param {string} message - The message to log
10
+ * @param {LogDebugType} logDebugType - If provided, this message will only be logged if the debug type is enabled in the settings
11
+ */
6
12
  log(level: LogLevel, message: string, logDebugType?: LogDebugType): void;
7
13
  }
@@ -4,8 +4,8 @@ export declare abstract class ObjectSettings {
4
4
  persist(holder: iIdHolder): void;
5
5
  /**
6
6
  * Loads the settings from the database
7
- * @param {iIdHolder} holder The holder of the settings (e.g. a device)
8
- * @param {() => void} loadDoneCb Callback when loading is done
7
+ * @param holder - The holder of the settings (e.g. a device)
8
+ * @param loadDoneCb - Callback when loading is done
9
9
  */
10
10
  initializeFromDb(holder: iIdHolder, loadDoneCb?: () => void): void;
11
11
  fromPartialObject(_obj: Partial<ObjectSettings>): void;
@@ -14,8 +14,8 @@ class ObjectSettings {
14
14
  }
15
15
  /**
16
16
  * Loads the settings from the database
17
- * @param {iIdHolder} holder The holder of the settings (e.g. a device)
18
- * @param {() => void} loadDoneCb Callback when loading is done
17
+ * @param holder - The holder of the settings (e.g. a device)
18
+ * @param loadDoneCb - Callback when loading is done
19
19
  */
20
20
  initializeFromDb(holder, loadDoneCb) {
21
21
  var _a;
@@ -18,7 +18,7 @@ export declare class RoomBase implements iRoomBase, iIdHolder {
18
18
  get sunsetShutterCallback(): TimeCallback | undefined;
19
19
  /**
20
20
  * For Rooms the id is itss name
21
- * @returns {string} The Roomname
21
+ * @returns The Roomname
22
22
  */
23
23
  get id(): string;
24
24
  get customName(): string;
@@ -39,6 +39,7 @@ export declare class RoomBase implements iRoomBase, iIdHolder {
39
39
  recalcTimeCallbacks(): void;
40
40
  /**
41
41
  * Sets the light based on the current time, rollo Position and room Settings
42
+ * @param c - The command to execute
42
43
  */
43
44
  setLightTimeBased(c: RoomSetLightTimeBasedCommand): void;
44
45
  isNowLightTime(): boolean;
@@ -41,7 +41,7 @@ class RoomBase {
41
41
  }
42
42
  /**
43
43
  * For Rooms the id is itss name
44
- * @returns {string} The Roomname
44
+ * @returns The Roomname
45
45
  */
46
46
  get id() {
47
47
  return this.roomName;
@@ -106,6 +106,7 @@ class RoomBase {
106
106
  }
107
107
  /**
108
108
  * Sets the light based on the current time, rollo Position and room Settings
109
+ * @param c - The command to execute
109
110
  */
110
111
  setLightTimeBased(c) {
111
112
  var _a, _b;
@@ -7,9 +7,26 @@ export interface iRoomBase {
7
7
  sonnenUntergangLichtCallback: TimeCallback | undefined;
8
8
  skipNextRolloUp: boolean;
9
9
  roomName: string;
10
+ /**
11
+ * This function initializes the roomBase object of this room
12
+ */
10
13
  initializeBase(): void;
14
+ /**
15
+ * This function stores the roominformation to the database
16
+ */
11
17
  persist(): void;
18
+ /**
19
+ * This function recalculates the timecallbacks (e.g. sunset, sunrise handling)
20
+ */
12
21
  recalcTimeCallbacks(): void;
22
+ /**
23
+ * This function sets the light in the room based on the command
24
+ * @param {RoomSetLightTimeBasedCommand} c - The command to execute
25
+ */
13
26
  setLightTimeBased(c: RoomSetLightTimeBasedCommand): void;
27
+ /**
28
+ * This function checks if it is now light time respecting the room settings, the current time and the daylight hours for this location.
29
+ * @returns {boolean}
30
+ */
14
31
  isNowLightTime(): boolean;
15
32
  }
@@ -1,3 +1,7 @@
1
1
  export interface iRoomImportEnforcer {
2
+ /**
3
+ * This function is called before initializing single devices,
4
+ * to ensure they can be added to the respective room.
5
+ */
2
6
  addRoomConstructor(): void;
3
7
  }
@@ -8,7 +8,6 @@ class Griffe {
8
8
  static getGriffPosition() {
9
9
  const griffe = Griffe.getAllGriffe();
10
10
  griffe.sort((a, b) => {
11
- a.position;
12
11
  return b.position - a.position;
13
12
  });
14
13
  const response = [`These are the current handle positions:`];
@@ -23,31 +23,24 @@ export declare abstract class IoBrokerBaseDevice implements iRoomDevice {
23
23
  get id(): string;
24
24
  /**
25
25
  * Getter info
26
- * @return {IoBrokerDeviceInfo}
26
+ * @returns The device info
27
27
  */
28
28
  get info(): IoBrokerDeviceInfo;
29
- /**
30
- * Setter info
31
- * @param {IoBrokerDeviceInfo} value
32
- */
33
29
  set info(value: IoBrokerDeviceInfo);
34
- /**
35
- * Getter ioConn
36
- * @return {IOBrokerConnection}
37
- */
38
30
  get ioConn(): IOBrokerConnection | undefined;
39
31
  static addRoom(shortName: string, settings: RoomDeviceAddingSettings): void;
40
32
  static checkMissing(): void;
41
33
  loadDeviceSettings(): void;
42
34
  /**
43
35
  * Allows to react on the state change of a given state with the passed cb
44
- * @param {string} stateName Last part of the id e.g. "available" not "zigbee.0.00158d00053d3e4b.available"
45
- * @param {(val: ioBroker.StateValue) => void} cb Desired Callback Action, with passed ioBroker.StateValue
36
+ * @param stateName - Last part of the id e.g. "available" not "zigbee.0.00158d00053d3e4b.available"
37
+ * @param cb - Desired Callback Action, with passed ioBroker.StateValue
46
38
  */
47
39
  addIndividualStateCallback(stateName: string, cb: (val: ioBroker.StateValue) => void): void;
48
40
  /**
49
41
  * Returns whether a connection to ioBroker is established or not
50
- * @param showError If true, an error message will be written to the log if the connection is not established
42
+ * @param showError - If true, an error message will be written to the log if the connection is not established
43
+ * @returns Whether a connection exists
51
44
  */
52
45
  checkIoConnection(showError?: boolean): boolean;
53
46
  abstract update(idSplit: string[], state: ioBroker.State, initial: boolean, pOverride: boolean): void;
@@ -57,10 +50,10 @@ export declare abstract class IoBrokerBaseDevice implements iRoomDevice {
57
50
  protected addToCorrectRoom(): void;
58
51
  /**
59
52
  * Sets the state of a given data point and returns true if that was successful.
60
- * @param pointId Data point to write to
61
- * @param state Data to write
62
- * @param onSuccess Callback to run on successfully written data
63
- * @param onError Callback to run if an error has occurred during writing the data
53
+ * @param pointId - Data point to write to
54
+ * @param state - Data to write
55
+ * @param onSuccess - Callback to run on successfully written data
56
+ * @param onError - Callback to run if an error has occurred during writing the data
64
57
  */
65
58
  protected setState(pointId: string, state: string | number | boolean | ioBroker.State | ioBroker.SettableState | null, onSuccess?: (() => void) | undefined, onError?: ((error: Error) => void) | undefined): void;
66
59
  }
@@ -37,22 +37,14 @@ class IoBrokerBaseDevice {
37
37
  }
38
38
  /**
39
39
  * Getter info
40
- * @return {IoBrokerDeviceInfo}
40
+ * @returns The device info
41
41
  */
42
42
  get info() {
43
43
  return this._info;
44
44
  }
45
- /**
46
- * Setter info
47
- * @param {IoBrokerDeviceInfo} value
48
- */
49
45
  set info(value) {
50
46
  this._info = value;
51
47
  }
52
- /**
53
- * Getter ioConn
54
- * @return {IOBrokerConnection}
55
- */
56
48
  get ioConn() {
57
49
  return ioBroker_1.ioBrokerMain.iOConnection;
58
50
  }
@@ -74,8 +66,8 @@ class IoBrokerBaseDevice {
74
66
  }
75
67
  /**
76
68
  * Allows to react on the state change of a given state with the passed cb
77
- * @param {string} stateName Last part of the id e.g. "available" not "zigbee.0.00158d00053d3e4b.available"
78
- * @param {(val: ioBroker.StateValue) => void} cb Desired Callback Action, with passed ioBroker.StateValue
69
+ * @param stateName - Last part of the id e.g. "available" not "zigbee.0.00158d00053d3e4b.available"
70
+ * @param cb - Desired Callback Action, with passed ioBroker.StateValue
79
71
  */
80
72
  addIndividualStateCallback(stateName, cb) {
81
73
  let arr = this.individualStateCallbacks.get(stateName);
@@ -89,7 +81,8 @@ class IoBrokerBaseDevice {
89
81
  }
90
82
  /**
91
83
  * Returns whether a connection to ioBroker is established or not
92
- * @param showError If true, an error message will be written to the log if the connection is not established
84
+ * @param showError - If true, an error message will be written to the log if the connection is not established
85
+ * @returns Whether a connection exists
93
86
  */
94
87
  checkIoConnection(showError = false) {
95
88
  if (!this.ioConn && showError) {
@@ -145,10 +138,10 @@ class IoBrokerBaseDevice {
145
138
  }
146
139
  /**
147
140
  * Sets the state of a given data point and returns true if that was successful.
148
- * @param pointId Data point to write to
149
- * @param state Data to write
150
- * @param onSuccess Callback to run on successfully written data
151
- * @param onError Callback to run if an error has occurred during writing the data
141
+ * @param pointId - Data point to write to
142
+ * @param state - Data to write
143
+ * @param onSuccess - Callback to run on successfully written data
144
+ * @param onError - Callback to run if an error has occurred during writing the data
152
145
  */
153
146
  setState(pointId, state, onSuccess = undefined, onError = undefined) {
154
147
  var _a;
@@ -13,8 +13,8 @@ export declare class IoBrokerDeviceInfo extends DeviceInfo {
13
13
  private static replaceInvalidIdChars;
14
14
  /**
15
15
  * Extracts the relevant infos from the passed deviceConfig and combines them in a new Info object
16
- * @param {deviceConfig} pDevConf The device Config based on the extracted devices.json from ioBroker
17
- * @param {boolean} isJsStateChildObject Within JS Objects, creating devices is limited,
16
+ * @param pDevConf - The device Config based on the extracted devices.json from ioBroker
17
+ * @param isJsStateChildObject - Within JS Objects, creating devices is limited,
18
18
  * so we name the first child state for the object creation (e.g. javascript.0.00-EnergyManager.CurrentProduction)
19
19
  */
20
20
  constructor(pDevConf: deviceConfig, isJsStateChildObject?: boolean);
@@ -19,8 +19,8 @@ class IoBrokerDeviceInfo extends DeviceInfo_1.DeviceInfo {
19
19
  }
20
20
  /**
21
21
  * Extracts the relevant infos from the passed deviceConfig and combines them in a new Info object
22
- * @param {deviceConfig} pDevConf The device Config based on the extracted devices.json from ioBroker
23
- * @param {boolean} isJsStateChildObject Within JS Objects, creating devices is limited,
22
+ * @param pDevConf - The device Config based on the extracted devices.json from ioBroker
23
+ * @param isJsStateChildObject - Within JS Objects, creating devices is limited,
24
24
  * so we name the first child state for the object creation (e.g. javascript.0.00-EnergyManager.CurrentProduction)
25
25
  */
26
26
  constructor(pDevConf, isJsStateChildObject = false) {
@@ -46,7 +46,8 @@ class IoBrokerDeviceInfo extends DeviceInfo_1.DeviceInfo {
46
46
  if (idSplit.length > 4) {
47
47
  this.valueName = idSplit[4];
48
48
  }
49
- /** Name-Split
49
+ /**
50
+ * Name-Split
50
51
  * 0: Indikator own "00"
51
52
  * 1: "HmIP"
52
53
  * 2: Raum
@@ -60,7 +61,8 @@ class IoBrokerDeviceInfo extends DeviceInfo_1.DeviceInfo {
60
61
  return;
61
62
  }
62
63
  else {
63
- /** Name-Split
64
+ /**
65
+ * Name-Split
64
66
  * 0: Indikator own "00"
65
67
  * 1: "EnergyManager"
66
68
  * 2: Raum
@@ -1,13 +1,45 @@
1
1
  import { AcSettings } from '../../../models';
2
2
  import { AcMode } from '../../services';
3
3
  import { iBaseDevice } from './iBaseDevice';
4
+ /**
5
+ * Interface for normal air-conditioning devices
6
+ * TODO: Migrate to new Command-Based System
7
+ * TODO: Extend from iActuator
8
+ */
4
9
  export interface iAcDevice extends iBaseDevice {
10
+ /**
11
+ * The settings of the air-conditioning device
12
+ */
5
13
  settings: AcSettings;
14
+ /**
15
+ * Whether the air-conditioning device is currently on
16
+ */
6
17
  readonly on: boolean;
18
+ /**
19
+ * The current temperature of the air-conditioning device in degrees Celsius
20
+ */
7
21
  readonly temperature: number;
22
+ /**
23
+ * The current state of the air-conditioning device
24
+ */
8
25
  readonly mode: AcMode;
26
+ /**
27
+ * This function should be called to inform the air-conditioning device about a change of the room temperature
28
+ * @param {number} newTemperatur - The new temperature of the room in degrees Celsius
29
+ */
9
30
  onTemperaturChange(newTemperatur: number): void;
31
+ /**
32
+ * Updates the desired mode of the air-conditioning device and writes it to the device if desired
33
+ * @param {AcMode} mode - The new desired mode
34
+ * @param {boolean} writeToDevice - Whether to write the new mode to the device
35
+ */
10
36
  setDesiredMode(mode: AcMode, writeToDevice: boolean): void;
37
+ /**
38
+ * Turns the air-conditioning device on without changing the settings
39
+ */
11
40
  turnOn(): void;
41
+ /**
42
+ * Turns the air-conditioning device off
43
+ */
12
44
  turnOff(): void;
13
45
  }
@@ -1,11 +1,19 @@
1
1
  import { ActuatorSetStateCommand, ActuatorSettings, ActuatorToggleCommand, ActuatorWriteStateToDeviceCommand } from '../../../models';
2
2
  import { iRoomDevice } from './iRoomDevice';
3
3
  import { iTemporaryDisableAutomatic } from './iTemporaryDisableAutomatic';
4
+ /**
5
+ * Interface for Actuators.
6
+ * An actuator can be any device whos primary function is to be on or off e.g a light, an outlet, a fan, etc.
7
+ */
4
8
  export interface iActuator extends iRoomDevice, iTemporaryDisableAutomatic {
5
9
  /**
6
10
  * The settings for this Actuator primarily for controlling its automatic actions
7
11
  */
8
12
  settings: ActuatorSettings;
13
+ /**
14
+ * The target automatic state of the device.
15
+ * This is used to store the state the device should be in to fall back to it after automatic was blocked e.g. by a user.
16
+ */
9
17
  targetAutomaticState: boolean;
10
18
  /**
11
19
  * The state value of the device
@@ -25,6 +33,14 @@ export interface iActuator extends iRoomDevice, iTemporaryDisableAutomatic {
25
33
  * @param command
26
34
  */
27
35
  setActuator(command: ActuatorSetStateCommand): void;
36
+ /**
37
+ * Toggles the power state of this actuator
38
+ * @param command
39
+ */
28
40
  toggleActuator(command: ActuatorToggleCommand): boolean;
41
+ /**
42
+ * Writes the desired actuator state to the device
43
+ * @param command
44
+ */
29
45
  writeActuatorStateToDevice(command: ActuatorWriteStateToDeviceCommand): void;
30
46
  }
@@ -3,12 +3,37 @@ import { DeviceType } from '../deviceType';
3
3
  import { DeviceInfo } from '../DeviceInfo';
4
4
  import { DeviceCapability } from '../DeviceCapability';
5
5
  import { iIdHolder } from '../../../models/iIdHolder';
6
+ /**
7
+ * This is the main interface for all devices as it ensures certain base functionality.
8
+ */
6
9
  export interface iBaseDevice extends iIdHolder {
10
+ /**
11
+ * The settings of the device which are overridden by the specific device implementation
12
+ */
7
13
  readonly settings: DeviceSettings | undefined;
14
+ /**
15
+ * The hardware-type of the device.
16
+ */
8
17
  deviceType: DeviceType;
18
+ /**
19
+ * Some basic information about the device (mainly its name, id, room, etc.)
20
+ */
9
21
  info: DeviceInfo;
22
+ /**
23
+ * The capabilities of the device thus referencing other interfaces which then can be used to treat devices regardless of their hardware-type.
24
+ */
10
25
  readonly deviceCapabilities: DeviceCapability[];
26
+ /**
27
+ * This method writes the device Info to the configured persistence layer, to ensure having foreign keys for all other persisted data.
28
+ */
11
29
  persistDeviceInfo(): void;
30
+ /**
31
+ * This method loads the device settings from the configured persistence layer.
32
+ * Whilst this is normally used during startup, it can be called at any time to refresh the settings in case of manual changes within the database.
33
+ */
12
34
  loadDeviceSettings(): void;
35
+ /**
36
+ * This mainly enforces all devices to have a toJSON method to ensure a consistent way of serializing devices.
37
+ */
13
38
  toJSON(): Partial<iBaseDevice>;
14
39
  }
@@ -1,10 +1,19 @@
1
1
  import { iRoomDevice } from './iRoomDevice';
2
+ /**
3
+ * Interface for Battery Devices.
4
+ * A battery device can be any device that is powered by a battery e.g. a remote, a sensor, etc.
5
+ */
2
6
  export interface iBatteryDevice extends iRoomDevice {
7
+ /**
8
+ * The last time the battery was persisted (in milliseconds since 1970)
9
+ */
3
10
  readonly lastBatteryPersist: number;
4
11
  /**
5
12
  * The battery status of the device in percentage
6
- * @type {number}
7
13
  */
8
14
  readonly battery: number;
15
+ /**
16
+ * Method to persist the battery status of the device to the persistence layer
17
+ */
9
18
  persistBatteryDevice(): void;
10
19
  }
@@ -9,16 +9,16 @@ export interface iBluetoothDetector extends iRoomDevice {
9
9
  addProximityCallback(cb: ProximityCallback): void;
10
10
  /**
11
11
  * Gets the distance of a currently present device
12
- * @param {string} deviceName The mapped Device name
13
- * @param {number} maxAge The maximum age in seconds to still respect that device
12
+ * @param {string} deviceName - The mapped Device name
13
+ * @param {number} maxAge - The maximum age in seconds to still respect that device
14
14
  * @returns {number | undefined} Distance in meters or undefined if currently not present
15
15
  */
16
16
  distanceOfDevice(deviceName: string, maxAge: number): number | undefined;
17
17
  /**
18
18
  * Check if a device is currently present and below the given Distance
19
- * @param {string} deviceName The mapped Device name
20
- * @param {number} maxDistance The maximum distance in meters
21
- * @param {number} maxAge The maximum age in seconds to still respect that device
19
+ * @param {string} deviceName - The mapped Device name
20
+ * @param {number} maxDistance - The maximum distance in meters
21
+ * @param {number} maxAge - The maximum age in seconds to still respect that device
22
22
  * @returns {boolean}
23
23
  */
24
24
  isDevicePresent(deviceName: string, maxDistance: number, maxAge: number): boolean;
@@ -9,7 +9,20 @@ export interface iButtonSwitch extends iRoomDevice {
9
9
  buttonBotRight: Button | undefined;
10
10
  buttonBot: Button | undefined;
11
11
  buttonTop: Button | undefined;
12
+ /**
13
+ * Persist the button press to the persistent storage
14
+ * @param {string} buttonName - The name of the button
15
+ * @param {ButtonPressType} pressType - The type of the button press
16
+ */
12
17
  persist(buttonName: string, pressType: ButtonPressType): void;
18
+ /**
19
+ * @returns An description of all configured assignments
20
+ */
13
21
  getButtonAssignment(): string;
22
+ /**
23
+ * Method to simulate a button press (e.g. for testing or to use a specific logic which is bound to this button)
24
+ * @param {ButtonPosition} position - The position of the button
25
+ * @param {ButtonPressType} pressType - The type of the button press
26
+ */
14
27
  pressButton(position: ButtonPosition, pressType: ButtonPressType): Error | null;
15
28
  }
@@ -9,6 +9,16 @@ export interface iCameraDevice extends iMotionSensor {
9
9
  readonly currentImageLink: string;
10
10
  readonly alarmBlockedByGriff: boolean;
11
11
  readonly alarmBlockedByGriffTimeStamp: number;
12
+ /**
13
+ * Inform this camera of certain handles being opened/closed to allow it to react accordingly (e.g. don't send alarm, for owner going into the garden)
14
+ * @param {boolean} open - Whether the handle is open or closed
15
+ */
12
16
  onGriffUpdate(open: boolean): void;
17
+ /**
18
+ * Inform this camera of state updates within iOBroker
19
+ * TODO: Make camera independent of iOBroker
20
+ * @param idSplit - The id split of the state
21
+ * @param state - The state that has been updated
22
+ */
13
23
  update(idSplit: string[], state: ioBroker.State): void;
14
24
  }
@@ -1,12 +1,19 @@
1
1
  import { iLamp } from './iLamp';
2
2
  import { DimmerSetLightCommand, DimmerSettings, LampToggleLightCommand } from '../../../models';
3
+ /**
4
+ * This interface represents a dimmable lamp device.
5
+ */
3
6
  export interface iDimmableLamp extends iLamp {
4
7
  settings: DimmerSettings;
5
8
  readonly brightness: number;
9
+ /**
10
+ * This function toggles the light on or off.
11
+ * @param {LampToggleLightCommand} command - The command to execute on the light device.
12
+ */
6
13
  toggleLight(command: LampToggleLightCommand): void;
7
14
  /**
8
- * This function sets the light to a specific value
9
- * Accessible in API
15
+ * This function sets the light to a specific value.
16
+ * @param {DimmerSetLightCommand} command - The command to execute on the light device.
10
17
  */
11
18
  setLight(command: DimmerSetLightCommand): void;
12
19
  }
@@ -1,12 +1,23 @@
1
1
  import { iExcessEnergyConsumer } from './iExcessEnergyConsumer';
2
2
  import { iBaseDevice } from './iBaseDevice';
3
- export interface iEnergyManager extends iBaseDevice {
3
+ import { iDisposable } from '../../services';
4
+ export interface iEnergyManager extends iBaseDevice, iDisposable {
4
5
  excessEnergy: number;
5
6
  readonly injectingWattage: number;
6
7
  readonly drawingWattage: number;
7
8
  readonly selfConsumingWattage: number;
9
+ /**
10
+ * Add a device that can consume excess energy
11
+ * @param device - The device that can consume excess energy
12
+ */
8
13
  addExcessConsumer(device: iExcessEnergyConsumer): void;
14
+ /**
15
+ * Recalculates power-sharing between devices.
16
+ */
9
17
  recalculatePowerSharing(): void;
10
- cleanup(): void;
18
+ /**
19
+ * Generates a report stating used energy and devices that consumed it
20
+ * @returns The report
21
+ */
11
22
  getReport(): string;
12
23
  }
@@ -1,12 +1,26 @@
1
- import { ExcessEnergyConsumerSettings, LogLevel } from '../../../models';
1
+ import { ExcessEnergyConsumerSettings } from '../../../models';
2
2
  import { iBaseDevice } from './iBaseDevice';
3
3
  export interface iExcessEnergyConsumer extends iBaseDevice {
4
4
  readonly energySettings: ExcessEnergyConsumerSettings;
5
5
  currentConsumption: number;
6
6
  on: boolean;
7
+ /**
8
+ * Check if this device is available to consume excess energy
9
+ * --> Device might be unavailable due to a force action from the user or other circumstances
10
+ * @returns {boolean} Whether this device is available to be turned on to consume excess energy
11
+ */
7
12
  isAvailableForExcessEnergy(): boolean;
8
- log(level: LogLevel, message: string): void;
13
+ /**
14
+ * Turn on this device to consume excess energy
15
+ */
9
16
  turnOnForExcessEnergy(): void;
17
+ /**
18
+ * Turn off this device as we don't have enough excess energy to power it
19
+ */
10
20
  turnOffDueToMissingEnergy(): void;
21
+ /**
22
+ * Check if this device was activated by excess energy
23
+ * @returns {boolean} Whether this device was activated by excess energy
24
+ */
11
25
  wasActivatedByExcessEnergy(): boolean;
12
26
  }
@@ -3,7 +3,17 @@ import { iRoomDevice } from './iRoomDevice';
3
3
  export interface iGarageDoorOpener extends iRoomDevice {
4
4
  settings: GarageDoorOpenerSettings;
5
5
  readonly isClosed: boolean;
6
+ /**
7
+ * Open the garage door
8
+ */
6
9
  open(): void;
10
+ /**
11
+ * Close the garage door
12
+ */
7
13
  close(): void;
14
+ /**
15
+ * Trigger the garage door.
16
+ * This mostly results in driving the door to the opposite state, but if fired rapidly, it might stop the door in the middle.
17
+ */
8
18
  trigger(): void;
9
19
  }
@@ -3,7 +3,19 @@ import { iRoomDevice } from './iRoomDevice';
3
3
  export interface iHandleSensor extends iRoomDevice {
4
4
  position: WindowPosition;
5
5
  minutesOpen: number;
6
+ /**
7
+ * Add a callback that is called when the handle is change to open
8
+ * @param {(pValue: boolean) => void} pCallback - The callback to fire
9
+ */
6
10
  addOffenCallback(pCallback: (pValue: boolean) => void): void;
11
+ /**
12
+ * Add a callback that is called when the handle is changed to ajar
13
+ * @param {(pValue: boolean) => void} pCallback - The callback to fire
14
+ */
7
15
  addKippCallback(pCallback: (pValue: boolean) => void): void;
16
+ /**
17
+ * Add a callback that is called when the handle is changed to closed
18
+ * @param {(pValue: boolean) => void} pCallback - The callback to fire
19
+ */
8
20
  addClosedCallback(pCallback: (pValue: boolean) => void): void;
9
21
  }
@@ -1,7 +1,8 @@
1
1
  /// <reference types="node" />
2
2
  import { HeaterSettings } from '../../../models';
3
3
  import { iRoomDevice } from './iRoomDevice';
4
- export interface iHeater extends iRoomDevice {
4
+ import { iDisposable } from '../../services';
5
+ export interface iHeater extends iRoomDevice, iDisposable {
5
6
  settings: HeaterSettings;
6
7
  desiredTemperature: number;
7
8
  readonly humidity: number;
@@ -10,8 +11,17 @@ export interface iHeater extends iRoomDevice {
10
11
  roomTemperature: number;
11
12
  readonly persistHeaterInterval: NodeJS.Timeout;
12
13
  seasonTurnOff: boolean;
13
- stopAutomaticCheck(): void;
14
+ /**
15
+ * Perform a check to calculate the new desired heater state
16
+ */
14
17
  checkAutomaticChange(): void;
18
+ /**
19
+ * Informs the heater that the temperature of the room has changed
20
+ * @param newTemperatur - The new temperature in degree Celsius.
21
+ */
15
22
  onTemperaturChange(newTemperatur: number): void;
23
+ /**
24
+ * Persists the current heater information to the database
25
+ */
16
26
  persistHeater(): void;
17
27
  }
@@ -4,6 +4,13 @@ export declare const UNDEFINED_HUMIDITY_VALUE = -1;
4
4
  export interface iHumiditySensor extends iRoomDevice {
5
5
  readonly persistHumiditySensorInterval: NodeJS.Timeout;
6
6
  readonly humidity: number;
7
+ /**
8
+ * Add a callback that is called when the humidity changes
9
+ * @param {(pValue: number) => void} pCallback - The callback to fire
10
+ */
7
11
  addHumidityCallback(pCallback: (pValue: number) => void): void;
12
+ /**
13
+ * Persists the current humidity information to the database
14
+ */
8
15
  persistHumiditySensor(): void;
9
16
  }