hoffmation-base 3.0.0-alpha.2 → 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 (185) 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 +8 -1
  5. package/lib/models/command/WindowRestoreDesiredPositionCommand.d.ts +5 -0
  6. package/lib/models/command/WindowRestoreDesiredPositionCommand.js +5 -0
  7. package/lib/models/command/WindowSetDesiredPositionCommand.d.ts +6 -0
  8. package/lib/models/command/WindowSetDesiredPositionCommand.js +6 -0
  9. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.d.ts +5 -0
  10. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.js +5 -0
  11. package/lib/models/command/actuatorSetStateCommand.d.ts +7 -0
  12. package/lib/models/command/actuatorSetStateCommand.js +9 -2
  13. package/lib/models/command/actuatorToggleCommand.d.ts +5 -0
  14. package/lib/models/command/actuatorToggleCommand.js +6 -1
  15. package/lib/models/command/actuatorWriteStateToDeviceCommand.d.ts +7 -1
  16. package/lib/models/command/actuatorWriteStateToDeviceCommand.js +12 -2
  17. package/lib/models/command/baseCommand.d.ts +14 -1
  18. package/lib/models/command/baseCommand.js +40 -6
  19. package/lib/models/command/blockAutomaticCommand.d.ts +17 -0
  20. package/lib/models/command/blockAutomaticCommand.js +22 -0
  21. package/lib/models/command/blockAutomaticLiftBlockCommand.d.ts +12 -0
  22. package/lib/models/command/blockAutomaticLiftBlockCommand.js +17 -0
  23. package/lib/models/command/blockAutomaticUntilCommand.d.ts +17 -0
  24. package/lib/models/command/blockAutomaticUntilCommand.js +22 -0
  25. package/lib/models/command/commandSource.d.ts +19 -0
  26. package/lib/models/command/commandSource.js +20 -0
  27. package/lib/models/command/commandType.d.ts +3 -0
  28. package/lib/models/command/commandType.js +3 -0
  29. package/lib/models/command/dimmerSetLightCommand.d.ts +7 -6
  30. package/lib/models/command/dimmerSetLightCommand.js +13 -11
  31. package/lib/models/command/floorSetAllShuttersCommand.d.ts +4 -4
  32. package/lib/models/command/floorSetAllShuttersCommand.js +4 -4
  33. package/lib/models/command/index.d.ts +3 -0
  34. package/lib/models/command/index.js +7 -1
  35. package/lib/models/command/lampSetLightCommand.d.ts +7 -0
  36. package/lib/models/command/lampSetLightCommand.js +8 -1
  37. package/lib/models/command/lampSetTimeBasedCommand.d.ts +4 -4
  38. package/lib/models/command/lampSetTimeBasedCommand.js +5 -5
  39. package/lib/models/command/lampToggleLightCommand.d.ts +5 -5
  40. package/lib/models/command/lampToggleLightCommand.js +6 -6
  41. package/lib/models/command/ledSetLightCommand.d.ts +15 -9
  42. package/lib/models/command/ledSetLightCommand.js +16 -10
  43. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.d.ts +6 -0
  44. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.js +6 -0
  45. package/lib/models/command/restoreTargetAutomaticValueCommand.d.ts +5 -0
  46. package/lib/models/command/restoreTargetAutomaticValueCommand.js +6 -1
  47. package/lib/models/command/roomRestoreLightCommand.d.ts +5 -0
  48. package/lib/models/command/roomRestoreLightCommand.js +5 -0
  49. package/lib/models/command/roomRestoreShutterPositionCommand.d.ts +6 -0
  50. package/lib/models/command/roomRestoreShutterPositionCommand.js +6 -0
  51. package/lib/models/command/roomSetLightTimeBasedCommand.d.ts +3 -3
  52. package/lib/models/command/roomSetLightTimeBasedCommand.js +3 -3
  53. package/lib/models/command/shutterSunriseUpCommand.d.ts +5 -0
  54. package/lib/models/command/shutterSunriseUpCommand.js +5 -0
  55. package/lib/models/command/shutterSunsetDownCommand.d.ts +5 -0
  56. package/lib/models/command/shutterSunsetDownCommand.js +5 -0
  57. package/lib/models/command/wledSetLightCommand.d.ts +11 -0
  58. package/lib/models/command/wledSetLightCommand.js +13 -0
  59. package/lib/models/connectionCallbacks.d.ts +4 -4
  60. package/lib/models/deviceConfig.d.ts +2 -2
  61. package/lib/models/deviceSettings/acSettings.d.ts +6 -5
  62. package/lib/models/deviceSettings/acSettings.js +10 -8
  63. package/lib/models/deviceSettings/actuatorSettings.d.ts +13 -4
  64. package/lib/models/deviceSettings/actuatorSettings.js +19 -9
  65. package/lib/models/deviceSettings/garageDoorOpenerSettings.d.ts +0 -1
  66. package/lib/models/deviceSettings/garageDoorOpenerSettings.js +0 -1
  67. package/lib/models/deviceSettings/heaterSettings.d.ts +0 -6
  68. package/lib/models/deviceSettings/heaterSettings.js +0 -6
  69. package/lib/models/deviceSettings/ledSettings.js +10 -18
  70. package/lib/models/deviceSettings/motionSensorSettings.d.ts +0 -1
  71. package/lib/models/deviceSettings/motionSensorSettings.js +0 -1
  72. package/lib/models/deviceSettings/shutterSettings.d.ts +0 -3
  73. package/lib/models/deviceSettings/shutterSettings.js +0 -3
  74. package/lib/models/deviceSettings/wledSettings.js +5 -13
  75. package/lib/models/groupSettings/heatGroupSettings.d.ts +3 -1
  76. package/lib/models/groupSettings/heatGroupSettings.js +3 -1
  77. package/lib/models/iIdHolder.d.ts +6 -0
  78. package/lib/models/objectSettings.d.ts +2 -2
  79. package/lib/models/objectSettings.js +2 -2
  80. package/lib/models/rooms/RoomBase.d.ts +2 -1
  81. package/lib/models/rooms/RoomBase.js +4 -3
  82. package/lib/models/rooms/iRoomBase.d.ts +17 -0
  83. package/lib/models/rooms/iRoomImportEnforcer.d.ts +4 -0
  84. package/lib/server/devices/Griffe.js +0 -1
  85. package/lib/server/devices/IoBrokerBaseDevice.d.ts +11 -16
  86. package/lib/server/devices/IoBrokerBaseDevice.js +21 -17
  87. package/lib/server/devices/IoBrokerDeviceInfo.d.ts +2 -2
  88. package/lib/server/devices/IoBrokerDeviceInfo.js +6 -4
  89. package/lib/server/devices/baseDeviceInterfaces/iAcDevice.d.ts +30 -3
  90. package/lib/server/devices/baseDeviceInterfaces/iActuator.d.ts +16 -0
  91. package/lib/server/devices/baseDeviceInterfaces/iBaseDevice.d.ts +25 -0
  92. package/lib/server/devices/baseDeviceInterfaces/iBatteryDevice.d.ts +10 -1
  93. package/lib/server/devices/baseDeviceInterfaces/iBluetoothDetector.d.ts +5 -5
  94. package/lib/server/devices/baseDeviceInterfaces/iButtonSwitch.d.ts +13 -0
  95. package/lib/server/devices/baseDeviceInterfaces/iCameraDevice.d.ts +10 -0
  96. package/lib/server/devices/baseDeviceInterfaces/iDimmableLamp.d.ts +9 -2
  97. package/lib/server/devices/baseDeviceInterfaces/iEnergyManager.d.ts +13 -2
  98. package/lib/server/devices/baseDeviceInterfaces/iExcessEnergyConsumer.d.ts +16 -2
  99. package/lib/server/devices/baseDeviceInterfaces/iGarageDoorOpener.d.ts +10 -0
  100. package/lib/server/devices/baseDeviceInterfaces/iHandleSensor.d.ts +12 -0
  101. package/lib/server/devices/baseDeviceInterfaces/iHeater.d.ts +12 -2
  102. package/lib/server/devices/baseDeviceInterfaces/iHumiditySensor.d.ts +7 -0
  103. package/lib/server/devices/baseDeviceInterfaces/iLamp.d.ts +4 -0
  104. package/lib/server/devices/baseDeviceInterfaces/iLedRgbCct.d.ts +5 -0
  105. package/lib/server/devices/baseDeviceInterfaces/iMotionSensor.d.ts +7 -1
  106. package/lib/server/devices/baseDeviceInterfaces/iScene.d.ts +7 -0
  107. package/lib/server/devices/baseDeviceInterfaces/iShutter.d.ts +7 -0
  108. package/lib/server/devices/baseDeviceInterfaces/iSmokeDetectorDevice.d.ts +7 -0
  109. package/lib/server/devices/baseDeviceInterfaces/iSpeaker.d.ts +25 -0
  110. package/lib/server/devices/baseDeviceInterfaces/iTemperatureSensor.d.ts +11 -0
  111. package/lib/server/devices/baseDeviceInterfaces/iTemporaryDisableAutomatic.d.ts +7 -0
  112. package/lib/server/devices/baseDeviceInterfaces/iTvDevice.d.ts +12 -0
  113. package/lib/server/devices/baseDeviceInterfaces/iVibrationSensor.d.ts +0 -1
  114. package/lib/server/devices/blueIris/cameraDevice.d.ts +2 -3
  115. package/lib/server/devices/blueIris/cameraDevice.js +2 -3
  116. package/lib/server/devices/dachs/interfaces/KeyListEntity.d.ts +0 -8
  117. package/lib/server/devices/dachs/interfaces/KeyListEntity.js +0 -8
  118. package/lib/server/devices/dachs/lib/dachsHttpClient.d.ts +1 -1
  119. package/lib/server/devices/groups/Window.d.ts +1 -0
  120. package/lib/server/devices/groups/Window.js +1 -0
  121. package/lib/server/devices/groups/heatGroup.d.ts +7 -6
  122. package/lib/server/devices/groups/heatGroup.js +8 -9
  123. package/lib/server/devices/groups/lightGroup.d.ts +2 -2
  124. package/lib/server/devices/groups/lightGroup.js +11 -10
  125. package/lib/server/devices/groups/presenceGroup.d.ts +0 -1
  126. package/lib/server/devices/groups/presenceGroup.js +0 -1
  127. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.d.ts +0 -1
  128. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.js +0 -6
  129. package/lib/server/devices/hmIPDevices/hmIpLampe.js +1 -2
  130. package/lib/server/devices/hmIPDevices/hmIpRoll.js +2 -2
  131. package/lib/server/devices/iDeviceUpdater.d.ts +11 -0
  132. package/lib/server/devices/jsObject/jsObjectEnergyManager.d.ts +1 -1
  133. package/lib/server/devices/jsObject/jsObjectEnergyManager.js +1 -1
  134. package/lib/server/devices/sharedFunctions/lampUtils.d.ts +1 -0
  135. package/lib/server/devices/sharedFunctions/lampUtils.js +32 -15
  136. package/lib/server/devices/wledDevice.d.ts +1 -0
  137. package/lib/server/devices/wledDevice.js +13 -8
  138. package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.js +1 -2
  139. package/lib/server/devices/zigbee/BaseDevices/zigbeeDevice.d.ts +0 -2
  140. package/lib/server/devices/zigbee/BaseDevices/zigbeeDevice.js +9 -18
  141. package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +8 -8
  142. package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.d.ts +2 -1
  143. package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.js +6 -4
  144. package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.d.ts +1 -1
  145. package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.js +1 -1
  146. package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +3 -3
  147. package/lib/server/devices/zigbee/BaseDevices/zigbeeSwitch.d.ts +1 -1
  148. package/lib/server/devices/zigbee/zigbeeAquaraVibra.d.ts +1 -1
  149. package/lib/server/devices/zigbee/zigbeeEuroHeater.d.ts +2 -3
  150. package/lib/server/devices/zigbee/zigbeeEuroHeater.js +2 -3
  151. package/lib/server/ioBroker/connection.d.ts +20 -20
  152. package/lib/server/ioBroker/connection.js +29 -21
  153. package/lib/server/ioBroker/socketIOConnectOptions.d.ts +2 -2
  154. package/lib/server/ioBroker/socketIOVisCommand.d.ts +5 -1
  155. package/lib/server/services/Sonos/polly-service.js +1 -2
  156. package/lib/server/services/Translation/res.d.ts +34 -19
  157. package/lib/server/services/Translation/res.js +34 -19
  158. package/lib/server/services/ac/ac-device.d.ts +0 -5
  159. package/lib/server/services/ac/ac-device.js +17 -18
  160. package/lib/server/services/ac/daikin-service.js +2 -1
  161. package/lib/server/services/ac/own-daikin-device.js +12 -4
  162. package/lib/server/services/api/api-service.d.ts +117 -52
  163. package/lib/server/services/api/api-service.js +160 -68
  164. package/lib/server/services/blockAutomaticHandler.d.ts +6 -8
  165. package/lib/server/services/blockAutomaticHandler.js +15 -13
  166. package/lib/server/services/dbo/iPersist.d.ts +96 -0
  167. package/lib/server/services/govee/own-govee-device.js +4 -7
  168. package/lib/server/services/https-service.d.ts +3 -2
  169. package/lib/server/services/https-service.js +3 -2
  170. package/lib/server/services/log-service/log-service.d.ts +2 -2
  171. package/lib/server/services/log-service/log-service.js +2 -2
  172. package/lib/server/services/news-service.d.ts +5 -6
  173. package/lib/server/services/news-service.js +5 -6
  174. package/lib/server/services/room-service/room-service.d.ts +3 -2
  175. package/lib/server/services/room-service/room-service.js +4 -3
  176. package/lib/server/services/settings-service.d.ts +3 -2
  177. package/lib/server/services/settings-service.js +3 -2
  178. package/lib/server/services/utils/iDisposeable.d.ts +3 -0
  179. package/lib/server/services/victron/victron-device.d.ts +2 -2
  180. package/lib/server/services/victron/victron-device.js +2 -2
  181. package/lib/server/services/weather/weather-current.d.ts +0 -2
  182. package/lib/server/services/weather/weather-service.d.ts +4 -1
  183. package/lib/server/services/weather/weather-service.js +4 -0
  184. package/lib/tsconfig.tsbuildinfo +1 -1
  185. package/package.json +6 -5
@@ -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,18 +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;
9
26
  /**
10
- * Disable automatic Turn-On for given amount of ms and turn off immediately.
11
- * @param {number} timeout
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
12
29
  */
13
- deactivateAutomaticChange(timeout: number): void;
14
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
+ */
15
36
  setDesiredMode(mode: AcMode, writeToDevice: boolean): void;
37
+ /**
38
+ * Turns the air-conditioning device on without changing the settings
39
+ */
16
40
  turnOn(): void;
41
+ /**
42
+ * Turns the air-conditioning device off
43
+ */
17
44
  turnOff(): void;
18
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
  }
@@ -5,6 +5,10 @@ export interface iLamp extends iActuator {
5
5
  * The state value of the device
6
6
  */
7
7
  readonly lightOn: boolean;
8
+ /**
9
+ * Changes the state of the lamp based on the time
10
+ * @param {LampSetTimeBasedCommand} command - The command to execute
11
+ */
8
12
  setTimeBased(command: LampSetTimeBasedCommand): void;
9
13
  /**
10
14
  * Toggles the state of the lamp
@@ -4,5 +4,10 @@ export interface iLedRgbCct extends iDimmableLamp {
4
4
  settings: LedSettings;
5
5
  readonly color: string;
6
6
  readonly colortemp: number;
7
+ /**
8
+ * This function sets the light to a specific value
9
+ * Accessible in API
10
+ * @param {LedSetLightCommand} c - The command to execute
11
+ */
7
12
  setLight(c: LedSetLightCommand): void;
8
13
  }
@@ -3,12 +3,18 @@ import { iRoomDevice } from './iRoomDevice';
3
3
  export interface iMotionSensor extends iRoomDevice {
4
4
  settings: MotionSensorSettings;
5
5
  readonly movementDetected: boolean;
6
+ /**
7
+ * Time since the last motion was detected in seconds
8
+ */
6
9
  readonly timeSinceLastMotion: number;
7
10
  detectionsToday: number;
8
11
  /**
9
12
  * Adds a callback for when a motion state has changed.
10
- * @param pCallback Function that accepts the new state as parameter
13
+ * @param pCallback - Function that accepts the new state as parameter
11
14
  */
12
15
  addMovementCallback(pCallback: (newState: boolean) => void): void;
16
+ /**
17
+ * Persists the current motion information to the database
18
+ */
13
19
  persistMotionSensor(): void;
14
20
  }
@@ -8,6 +8,13 @@ export interface iScene extends iRoomDevice {
8
8
  readonly on: boolean;
9
9
  readonly automaticEndTimeout: NodeJS.Timeout | null;
10
10
  settings: SceneSettings;
11
+ /**
12
+ * Starts the scene for the given duration
13
+ * @param {number} timeout - If set, the scene will end after the given time in ms
14
+ */
11
15
  startScene(timeout?: number): void;
16
+ /**
17
+ * Ends the scene --> This also stops the automatic end timeout.
18
+ */
12
19
  endScene(): void;
13
20
  }
@@ -6,6 +6,13 @@ export interface iShutter extends iRoomDevice {
6
6
  currentLevel: number;
7
7
  desiredWindowShutterLevel: number;
8
8
  window: Window | undefined;
9
+ /**
10
+ * Persists the current information of the shutter to the database
11
+ */
9
12
  persist(): void;
13
+ /**
14
+ * Sets the level of the shutter
15
+ * @param {ShutterSetLevelCommand} command - The command to execute
16
+ */
10
17
  setLevel(command: ShutterSetLevelCommand): void;
11
18
  }
@@ -1,5 +1,12 @@
1
1
  import { iRoomDevice } from './iRoomDevice';
2
2
  export interface iSmokeDetectorDevice extends iRoomDevice {
3
+ /**
4
+ * Indicates if the smoke detector is currently detecting smoke
5
+ */
3
6
  readonly smoke: boolean;
7
+ /**
8
+ * Stops the alarm of the smoke detector
9
+ * @param {boolean} quiet - If true, the alarm will be stopped without announcing alarm end.
10
+ */
4
11
  stopAlarm(quiet: boolean): void;
5
12
  }
@@ -1,8 +1,33 @@
1
1
  import { iRoomDevice } from './iRoomDevice';
2
2
  export interface iSpeaker extends iRoomDevice {
3
+ /**
4
+ * Plays an mp3 file on the device
5
+ * @param {string} mp3Name - The name of the mp3 file to play
6
+ * @param {number} duration - The duration of the mp3 file in seconds
7
+ * @param {number} [volume] - The volume to play the mp3 file with
8
+ * @param {boolean} [onlyWhenPlaying] - If true, the mp3 file will only be played when the device is already playing something
9
+ * @param {boolean} [resolveAfterRevert] - If true, the promise will be resolved after the device has reverted to the previous state
10
+ */
3
11
  playOnDevice(mp3Name: string, duration: number, volume?: number, onlyWhenPlaying?: boolean, resolveAfterRevert?: boolean): void;
12
+ /**
13
+ * Plays a test message on the device
14
+ */
4
15
  playTestMessage(): void;
16
+ /**
17
+ * Plays a file from an url on the device
18
+ * @param {string} url - The url to play
19
+ */
5
20
  playUrl(url: string): void;
21
+ /**
22
+ * Stops the current playback on the device
23
+ */
6
24
  stop(): void;
25
+ /**
26
+ * Speaks a message on the device using the text-to-speech engine
27
+ * @param {string} pMessage - The message to speak
28
+ * @param {number} [volume] - The volume to speak the message with
29
+ * @param {boolean} [onlyWhenPlaying] - If true, the message will only be spoken when the device is already playing something
30
+ * @param {boolean} [resolveAfterRevert] - If true, the promise will be resolved after the device has reverted to the previous state
31
+ */
7
32
  speakOnDevice(pMessage: string, volume?: number, onlyWhenPlaying?: boolean, resolveAfterRevert?: boolean): void;
8
33
  }
@@ -6,7 +6,18 @@ export interface iTemperatureSensor extends iRoomDevice {
6
6
  roomTemperature: number;
7
7
  iTemperature: number;
8
8
  sTemperature: string;
9
+ /**
10
+ * Adds a callback to be called when the temperature changes
11
+ * @param {(pValue: number) => void} pCallback - The callback to be called
12
+ */
9
13
  addTempChangeCallback(pCallback: (pValue: number) => void): void;
14
+ /**
15
+ * Inform the temperature sensor that the temperature in the room has changed
16
+ * @param {number} newTemperatur - The new temperature in the room in Celsius
17
+ */
10
18
  onTemperaturChange(newTemperatur: number): void;
19
+ /**
20
+ * Persists the current temperature sensor information to the database
21
+ */
11
22
  persistTemperaturSensor(): void;
12
23
  }
@@ -2,6 +2,13 @@ import { BlockAutomaticHandler } from '../../services/blockAutomaticHandler';
2
2
  import { iBaseDevice } from './iBaseDevice';
3
3
  import { RestoreTargetAutomaticValueCommand } from '../../../models';
4
4
  export interface iTemporaryDisableAutomatic extends iBaseDevice {
5
+ /**
6
+ * The block automation handler containing the current block state/time, etc.
7
+ */
5
8
  readonly blockAutomationHandler: BlockAutomaticHandler;
9
+ /**
10
+ * Restores the automatic value/state of the device
11
+ * @param {RestoreTargetAutomaticValueCommand} command - The command to restore the automatic value/state
12
+ */
6
13
  restoreTargetAutomaticValue(command: RestoreTargetAutomaticValueCommand): void;
7
14
  }
@@ -1,8 +1,20 @@
1
1
  import { iRoomDevice } from './iRoomDevice';
2
2
  export interface iTvDevice extends iRoomDevice {
3
3
  readonly on: boolean;
4
+ /**
5
+ * Turns the TV on
6
+ */
4
7
  turnOn(): void;
8
+ /**
9
+ * Turns the TV off
10
+ */
5
11
  turnOff(): void;
12
+ /**
13
+ * Increases the volume of the TV
14
+ */
6
15
  volumeUp(): void;
16
+ /**
17
+ * Decreases the volume of the TV
18
+ */
7
19
  volumeDown(): void;
8
20
  }
@@ -5,5 +5,4 @@ export interface iVibrationSensor extends iRoomDevice {
5
5
  vibrationBlockedByMotion: boolean;
6
6
  vibrationBlockedByMotionTimeStamp: number;
7
7
  vibration: boolean;
8
- alarmCheck(): void;
9
8
  }
@@ -43,8 +43,7 @@ export declare class CameraDevice implements iCameraDevice {
43
43
  get info(): DeviceInfo;
44
44
  set info(info: DeviceInfo);
45
45
  /**
46
- * Time since Last Motion in seconds
47
- * @returns {number}
46
+ * @inheritDoc
48
47
  */
49
48
  get timeSinceLastMotion(): number;
50
49
  get customName(): string;
@@ -52,7 +51,7 @@ export declare class CameraDevice implements iCameraDevice {
52
51
  get room(): RoomBase | undefined;
53
52
  /**
54
53
  * Adds a callback for when a motion state has changed.
55
- * @param pCallback Function that accepts the new state as parameter
54
+ * @param pCallback - Function that accepts the new state as parameter
56
55
  */
57
56
  addMovementCallback(pCallback: (newState: boolean) => void): void;
58
57
  onGriffUpdate(open: boolean): void;
@@ -103,8 +103,7 @@ class CameraDevice {
103
103
  this._info = info;
104
104
  }
105
105
  /**
106
- * Time since Last Motion in seconds
107
- * @returns {number}
106
+ * @inheritDoc
108
107
  */
109
108
  get timeSinceLastMotion() {
110
109
  return Math.round((services_1.Utils.nowMS() - this._lastMotion) / 1000);
@@ -121,7 +120,7 @@ class CameraDevice {
121
120
  }
122
121
  /**
123
122
  * Adds a callback for when a motion state has changed.
124
- * @param pCallback Function that accepts the new state as parameter
123
+ * @param pCallback - Function that accepts the new state as parameter
125
124
  */
126
125
  addMovementCallback(pCallback) {
127
126
  this._movementDetectedCallback.push(pCallback);
@@ -8,11 +8,3 @@ export interface KeyListEntityResponse<V> {
8
8
  rawValue?: string;
9
9
  value: V;
10
10
  }
11
- /**
12
-
13
- "key": "",
14
- "doc": "",
15
- "unit": Number
16
-
17
-
18
- */
@@ -1,10 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
-
5
- "key": "",
6
- "doc": "",
7
- "unit": Number
8
-
9
-
10
- */