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
@@ -4,12 +4,9 @@
4
4
  *
5
5
  * I'm a NodeJS guy not a scientist, so please be a careful!!!
6
6
  * FYI: http://en.wikipedia.org/wiki/PID_controller
7
- *
8
- * @module controller
9
- *
10
7
  * @author https://github.com/hekike/liquid-pid
11
- * @licence MIT
12
- **/
8
+ * licence: MIT
9
+ */
13
10
  export declare class PIDController {
14
11
  private _Tref;
15
12
  private readonly _Pmax;
package/lib/liquid-pid.js CHANGED
@@ -7,12 +7,9 @@ exports.PIDController = void 0;
7
7
  *
8
8
  * I'm a NodeJS guy not a scientist, so please be a careful!!!
9
9
  * FYI: http://en.wikipedia.org/wiki/PID_controller
10
- *
11
- * @module controller
12
- *
13
10
  * @author https://github.com/hekike/liquid-pid
14
- * @licence MIT
15
- **/
11
+ * licence: MIT
12
+ */
16
13
  class PIDController {
17
14
  constructor(options) {
18
15
  var _a, _b, _c, _d, _f, _g;
@@ -5,6 +5,13 @@ export declare class ShutterSetLevelCommand extends BaseCommand {
5
5
  readonly level: number;
6
6
  readonly skipOpenWarning: boolean;
7
7
  _commandType: CommandType;
8
+ /**
9
+ * Command to set the level of a shutter
10
+ * @param source - The source of the command
11
+ * @param level - The level to set the shutter to (0: close, 100: completely open)
12
+ * @param reason - You can provide a reason for clarification
13
+ * @param skipOpenWarning - Whether to skip the warning of window being open
14
+ */
8
15
  constructor(source: CommandSource | BaseCommand, level: number, reason?: string, skipOpenWarning?: boolean);
9
16
  get logMessage(): string;
10
17
  }
@@ -4,7 +4,13 @@ exports.ShutterSetLevelCommand = void 0;
4
4
  const baseCommand_1 = require("./baseCommand");
5
5
  const commandType_1 = require("./commandType");
6
6
  class ShutterSetLevelCommand extends baseCommand_1.BaseCommand {
7
- // TODO: Missing Comment
7
+ /**
8
+ * Command to set the level of a shutter
9
+ * @param source - The source of the command
10
+ * @param level - The level to set the shutter to (0: close, 100: completely open)
11
+ * @param reason - You can provide a reason for clarification
12
+ * @param skipOpenWarning - Whether to skip the warning of window being open
13
+ */
8
14
  constructor(source, level, reason = '', skipOpenWarning = false) {
9
15
  super(source, reason);
10
16
  this.level = level;
@@ -3,5 +3,10 @@ import { CommandSource } from './commandSource';
3
3
  import { CommandType } from './commandType';
4
4
  export declare class WindowRestoreDesiredPositionCommand extends BaseCommand {
5
5
  _commandType: CommandType;
6
+ /**
7
+ * Command to restore the desired position of the shutter of a window
8
+ * @param source - The source of the command
9
+ * @param reason - You can provide a reason for clarification
10
+ */
6
11
  constructor(source: CommandSource | BaseCommand, reason?: string);
7
12
  }
@@ -4,7 +4,11 @@ exports.WindowRestoreDesiredPositionCommand = void 0;
4
4
  const baseCommand_1 = require("./baseCommand");
5
5
  const commandType_1 = require("./commandType");
6
6
  class WindowRestoreDesiredPositionCommand extends baseCommand_1.BaseCommand {
7
- // TODO: Missing Comment
7
+ /**
8
+ * Command to restore the desired position of the shutter of a window
9
+ * @param source - The source of the command
10
+ * @param reason - You can provide a reason for clarification
11
+ */
8
12
  constructor(source, reason = '') {
9
13
  super(source, reason);
10
14
  this._commandType = commandType_1.CommandType.WindowRestoreDesiredPositionCommand;
@@ -4,5 +4,11 @@ import { CommandType } from './commandType';
4
4
  export declare class WindowSetDesiredPositionCommand extends BaseCommand {
5
5
  readonly position: number;
6
6
  _commandType: CommandType;
7
+ /**
8
+ * Command to set the desired position of the shutter of a window
9
+ * @param source - The source of the command
10
+ * @param position - The desired position of the shutter (0 closed, 100 open)
11
+ * @param reason - You can provide a reason for clarification
12
+ */
7
13
  constructor(source: CommandSource | BaseCommand, position: number, reason?: string);
8
14
  }
@@ -4,7 +4,12 @@ exports.WindowSetDesiredPositionCommand = void 0;
4
4
  const baseCommand_1 = require("./baseCommand");
5
5
  const commandType_1 = require("./commandType");
6
6
  class WindowSetDesiredPositionCommand extends baseCommand_1.BaseCommand {
7
- // TODO: Missing Comment
7
+ /**
8
+ * Command to set the desired position of the shutter of a window
9
+ * @param source - The source of the command
10
+ * @param position - The desired position of the shutter (0 closed, 100 open)
11
+ * @param reason - You can provide a reason for clarification
12
+ */
8
13
  constructor(source, position, reason = '') {
9
14
  super(source, reason);
10
15
  this.position = position;
@@ -3,5 +3,10 @@ import { CommandSource } from './commandSource';
3
3
  import { CommandType } from './commandType';
4
4
  export declare class WindowSetRolloByWeatherStatusCommand extends BaseCommand {
5
5
  _commandType: CommandType;
6
+ /**
7
+ * Command to set the desired position of the shutter of a window based on the weather status
8
+ * @param source - The source of the command
9
+ * @param reason - You can provide a reason for clarification
10
+ */
6
11
  constructor(source: CommandSource | BaseCommand, reason?: string);
7
12
  }
@@ -4,7 +4,11 @@ exports.WindowSetRolloByWeatherStatusCommand = void 0;
4
4
  const baseCommand_1 = require("./baseCommand");
5
5
  const commandType_1 = require("./commandType");
6
6
  class WindowSetRolloByWeatherStatusCommand extends baseCommand_1.BaseCommand {
7
- // TODO: Missing Comment
7
+ /**
8
+ * Command to set the desired position of the shutter of a window based on the weather status
9
+ * @param source - The source of the command
10
+ * @param reason - You can provide a reason for clarification
11
+ */
8
12
  constructor(source, reason = '') {
9
13
  super(source, reason);
10
14
  this._commandType = commandType_1.CommandType.WindowSetRolloByWeatherStatusCommand;
@@ -7,6 +7,13 @@ export declare class ActuatorSetStateCommand extends BaseCommand {
7
7
  readonly on: boolean;
8
8
  timeout: number;
9
9
  _commandType: CommandType;
10
+ /**
11
+ * Command to set the state of an actuator
12
+ * @param source - The source of the command
13
+ * @param on - The new state of the actuator
14
+ * @param reason - You can provide a reason for clarification
15
+ * @param timeout - If provided, the device automatic will be turned off for the given time in ms
16
+ */
10
17
  constructor(source: CommandSource | BaseCommand, on: boolean, reason?: string, timeout?: number);
11
18
  get logMessage(): string;
12
19
  static byActuatorAndToggleCommand(device: iActuator, c: ActuatorToggleCommand): ActuatorSetStateCommand;
@@ -4,7 +4,13 @@ exports.ActuatorSetStateCommand = void 0;
4
4
  const baseCommand_1 = require("./baseCommand");
5
5
  const commandType_1 = require("./commandType");
6
6
  class ActuatorSetStateCommand extends baseCommand_1.BaseCommand {
7
- // TODO: Missing Comment
7
+ /**
8
+ * Command to set the state of an actuator
9
+ * @param source - The source of the command
10
+ * @param on - The new state of the actuator
11
+ * @param reason - You can provide a reason for clarification
12
+ * @param timeout - If provided, the device automatic will be turned off for the given time in ms
13
+ */
8
14
  constructor(source, on, reason = '', timeout = -1) {
9
15
  super(source, reason);
10
16
  this.on = on;
@@ -3,6 +3,11 @@ import { BaseCommand } from './baseCommand';
3
3
  import { CommandSource } from './commandSource';
4
4
  export declare class ActuatorToggleCommand extends BaseCommand {
5
5
  _commandType: CommandType;
6
+ /**
7
+ * Command to toggle the state of an actuator
8
+ * @param source - The source of the command
9
+ * @param reason - You can provide a reason for clarification
10
+ */
6
11
  constructor(source: CommandSource | BaseCommand, reason?: string);
7
12
  get logMessage(): string;
8
13
  }
@@ -4,7 +4,11 @@ exports.ActuatorToggleCommand = void 0;
4
4
  const commandType_1 = require("./commandType");
5
5
  const baseCommand_1 = require("./baseCommand");
6
6
  class ActuatorToggleCommand extends baseCommand_1.BaseCommand {
7
- // TODO: Missing Comment
7
+ /**
8
+ * Command to toggle the state of an actuator
9
+ * @param source - The source of the command
10
+ * @param reason - You can provide a reason for clarification
11
+ */
8
12
  constructor(source, reason = '') {
9
13
  super(source, reason);
10
14
  this._commandType = commandType_1.CommandType.ActuatorToggleCommand;
@@ -4,6 +4,12 @@ import { CommandSource } from './commandSource';
4
4
  export declare class ActuatorWriteStateToDeviceCommand extends BaseCommand {
5
5
  readonly stateValue: boolean;
6
6
  _commandType: CommandType;
7
+ /**
8
+ * Command to write the state of an actuator to the device
9
+ * @param source - The source of the command
10
+ * @param stateValue - The new state of the actuator
11
+ * @param reason - You can provide a reason for clarification
12
+ */
7
13
  constructor(source: CommandSource | BaseCommand, stateValue: boolean, reason?: string);
8
14
  get logMessage(): string;
9
15
  }
@@ -5,7 +5,12 @@ const baseCommand_1 = require("./baseCommand");
5
5
  const commandType_1 = require("./commandType");
6
6
  const actuatorSetStateCommand_1 = require("./actuatorSetStateCommand");
7
7
  class ActuatorWriteStateToDeviceCommand extends baseCommand_1.BaseCommand {
8
- // TODO: Missing Comment
8
+ /**
9
+ * Command to write the state of an actuator to the device
10
+ * @param source - The source of the command
11
+ * @param stateValue - The new state of the actuator
12
+ * @param reason - You can provide a reason for clarification
13
+ */
9
14
  constructor(source, stateValue, reason = '') {
10
15
  super(source, reason);
11
16
  this.stateValue = stateValue;
@@ -5,6 +5,16 @@ export declare abstract class BaseCommand {
5
5
  readonly reason: string;
6
6
  readonly timestamp: Date;
7
7
  abstract _commandType: CommandType;
8
+ /**
9
+ * If set, this will be used in regards to checking if this is a force/manual/automatic action.
10
+ * @type {CommandSource | undefined} The source of the command
11
+ */
12
+ overrideCommandSource: CommandSource | undefined;
13
+ /**
14
+ * Base class for all commands
15
+ * @param source - The source of the command
16
+ * @param reason - You can provide a reason for clarification
17
+ */
8
18
  protected constructor(source?: CommandSource | BaseCommand, reason?: string);
9
19
  get isAutomaticAction(): boolean;
10
20
  get isForceAction(): boolean;
@@ -3,7 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseCommand = void 0;
4
4
  const commandSource_1 = require("./commandSource");
5
5
  class BaseCommand {
6
- // TODO: Missing Comment
6
+ /**
7
+ * Base class for all commands
8
+ * @param source - The source of the command
9
+ * @param reason - You can provide a reason for clarification
10
+ */
7
11
  constructor(source = commandSource_1.CommandSource.Unknown, reason = '') {
8
12
  this.source = source;
9
13
  this.reason = reason;
@@ -16,18 +20,29 @@ class BaseCommand {
16
20
  return this.source === commandSource_1.CommandSource.Automatic;
17
21
  }
18
22
  get isForceAction() {
23
+ if (this.overrideCommandSource !== undefined) {
24
+ return (this.overrideCommandSource === commandSource_1.CommandSource.Manual ||
25
+ this.overrideCommandSource === commandSource_1.CommandSource.API ||
26
+ this.overrideCommandSource === commandSource_1.CommandSource.Force);
27
+ }
19
28
  if (this.source instanceof BaseCommand) {
20
29
  return this.source.isForceAction;
21
30
  }
22
31
  return (this.source === commandSource_1.CommandSource.Manual || this.source === commandSource_1.CommandSource.API || this.source === commandSource_1.CommandSource.Force);
23
32
  }
24
33
  get isManual() {
34
+ if (this.overrideCommandSource !== undefined) {
35
+ return this.overrideCommandSource === commandSource_1.CommandSource.Manual || this.overrideCommandSource === commandSource_1.CommandSource.API;
36
+ }
25
37
  if (this.source instanceof BaseCommand) {
26
38
  return this.source.isManual;
27
39
  }
28
40
  return this.source === commandSource_1.CommandSource.Manual || this.source === commandSource_1.CommandSource.API;
29
41
  }
30
42
  get isInitial() {
43
+ if (this.overrideCommandSource !== undefined) {
44
+ return this.overrideCommandSource === commandSource_1.CommandSource.Initial;
45
+ }
31
46
  if (this.source instanceof BaseCommand) {
32
47
  return this.source.isInitial;
33
48
  }
@@ -8,10 +8,10 @@ export declare class BlockAutomaticCommand extends BaseCommand {
8
8
  _commandType: CommandType;
9
9
  /**
10
10
  * Command to disable automatic actions for a specific duration.
11
- * @param {CommandSource} source The source of the command.
12
- * @param {number} durationMS The duration in milliseconds for the automatic actions to be disabled.
13
- * @param reason You can provide an individual reason here for debugging purpose.
14
- * @param {CollisionSolving} onCollideAction The action to take if a block is already active. --> Default: overrideIfGreater
11
+ * @param source - The source of the command.
12
+ * @param durationMS - The duration in milliseconds for the automatic actions to be disabled.
13
+ * @param reason - You can provide an individual reason here for debugging purpose.
14
+ * @param onCollideAction - The action to take if a block is already active. --> Default: overrideIfGreater
15
15
  */
16
16
  constructor(source: CommandSource | BaseCommand, durationMS: number, reason?: string, onCollideAction?: CollisionSolving);
17
17
  }
@@ -7,10 +7,10 @@ const baseCommand_1 = require("./baseCommand");
7
7
  class BlockAutomaticCommand extends baseCommand_1.BaseCommand {
8
8
  /**
9
9
  * Command to disable automatic actions for a specific duration.
10
- * @param {CommandSource} source The source of the command.
11
- * @param {number} durationMS The duration in milliseconds for the automatic actions to be disabled.
12
- * @param reason You can provide an individual reason here for debugging purpose.
13
- * @param {CollisionSolving} onCollideAction The action to take if a block is already active. --> Default: overrideIfGreater
10
+ * @param source - The source of the command.
11
+ * @param durationMS - The duration in milliseconds for the automatic actions to be disabled.
12
+ * @param reason - You can provide an individual reason here for debugging purpose.
13
+ * @param onCollideAction - The action to take if a block is already active. --> Default: overrideIfGreater
14
14
  */
15
15
  constructor(source, durationMS, reason = '', onCollideAction = collisionSolving_1.CollisionSolving.overrideIfGreater) {
16
16
  super(source, reason);
@@ -5,8 +5,8 @@ export declare class BlockAutomaticLiftBlockCommand extends BaseCommand {
5
5
  _commandType: CommandType;
6
6
  /**
7
7
  * Command to lift a block --> Restore the automatic actions.
8
- * @param {CommandSource | BaseCommand} source The source of the command.
9
- * @param {string} reason You can provide an individual reason here for debugging purpose.
8
+ * @param source - The source of the command.
9
+ * @param reason - You can provide an individual reason here for debugging purpose.
10
10
  */
11
11
  constructor(source: CommandSource | BaseCommand, reason?: string);
12
12
  }
@@ -6,8 +6,8 @@ const baseCommand_1 = require("./baseCommand");
6
6
  class BlockAutomaticLiftBlockCommand extends baseCommand_1.BaseCommand {
7
7
  /**
8
8
  * Command to lift a block --> Restore the automatic actions.
9
- * @param {CommandSource | BaseCommand} source The source of the command.
10
- * @param {string} reason You can provide an individual reason here for debugging purpose.
9
+ * @param source - The source of the command.
10
+ * @param reason - You can provide an individual reason here for debugging purpose.
11
11
  */
12
12
  constructor(source, reason = '') {
13
13
  super(source, reason);
@@ -8,10 +8,10 @@ export declare class BlockAutomaticUntilCommand extends BaseCommand {
8
8
  _commandType: CommandType;
9
9
  /**
10
10
  * Command to disable automatic actions until a specific date.
11
- * @param {CommandSource} source The source of the command.
12
- * @param {Date} targetDate The date until the automatic actions will be disabled.
13
- * @param reason You can provide an individual reason here for debugging purpose.
14
- * @param {CollisionSolving} onCollideAction The action to take if a block is already active. --> Default: overrideIfGreater
11
+ * @param source - The source of the command.
12
+ * @param targetDate - The date until the automatic actions will be disabled.
13
+ * @param reason - You can provide an individual reason here for debugging purpose.
14
+ * @param onCollideAction - The action to take if a block is already active. --> Default: overrideIfGreater
15
15
  */
16
16
  constructor(source: CommandSource | BaseCommand, targetDate: Date, reason?: string, onCollideAction?: CollisionSolving);
17
17
  }
@@ -7,10 +7,10 @@ const baseCommand_1 = require("./baseCommand");
7
7
  class BlockAutomaticUntilCommand extends baseCommand_1.BaseCommand {
8
8
  /**
9
9
  * Command to disable automatic actions until a specific date.
10
- * @param {CommandSource} source The source of the command.
11
- * @param {Date} targetDate The date until the automatic actions will be disabled.
12
- * @param reason You can provide an individual reason here for debugging purpose.
13
- * @param {CollisionSolving} onCollideAction The action to take if a block is already active. --> Default: overrideIfGreater
10
+ * @param source - The source of the command.
11
+ * @param targetDate - The date until the automatic actions will be disabled.
12
+ * @param reason - You can provide an individual reason here for debugging purpose.
13
+ * @param onCollideAction - The action to take if a block is already active. --> Default: overrideIfGreater
14
14
  */
15
15
  constructor(source, targetDate, reason = '', onCollideAction = collisionSolving_1.CollisionSolving.overrideIfGreater) {
16
16
  super(source, reason);
@@ -1,8 +1,27 @@
1
1
  export declare enum CommandSource {
2
+ /**
3
+ * In case of unclear command stack/source this should be used.
4
+ */
2
5
  Unknown = 0,
6
+ /**
7
+ * This should mark all startup commands, as this allows devices to treat this correctly.
8
+ */
3
9
  Initial = 1,
10
+ /**
11
+ * This should mark all commands that are executed as an automatic response to a certain action/change.
12
+ */
4
13
  Automatic = 2,
14
+ /**
15
+ * This should mark all commands that are executed by a user thus having a higher priority than other automatic commands.
16
+ */
5
17
  Manual = 3,
18
+ /**
19
+ * This should mark all commands that are executed by an API call.
20
+ * !WARNING! API could be an automatic call, but also a manual call e.g. using hoffmation-ios or homebridge-hoffmation --> So this is a higher priority than Automatic but still lower than manual/force.
21
+ */
6
22
  API = 4,
23
+ /**
24
+ * This should mark all commands that have highest priority, thus overruling/ignoring certain controls/safety mechanisms.
25
+ */
7
26
  Force = 5
8
27
  }
@@ -1,13 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CommandSource = void 0;
4
- // TODO: Missing Comment
4
+ // Definition: Enum for command source.
5
5
  var CommandSource;
6
6
  (function (CommandSource) {
7
+ /**
8
+ * In case of unclear command stack/source this should be used.
9
+ */
7
10
  CommandSource[CommandSource["Unknown"] = 0] = "Unknown";
11
+ /**
12
+ * This should mark all startup commands, as this allows devices to treat this correctly.
13
+ */
8
14
  CommandSource[CommandSource["Initial"] = 1] = "Initial";
15
+ /**
16
+ * This should mark all commands that are executed as an automatic response to a certain action/change.
17
+ */
9
18
  CommandSource[CommandSource["Automatic"] = 2] = "Automatic";
19
+ /**
20
+ * This should mark all commands that are executed by a user thus having a higher priority than other automatic commands.
21
+ */
10
22
  CommandSource[CommandSource["Manual"] = 3] = "Manual";
23
+ /**
24
+ * This should mark all commands that are executed by an API call.
25
+ * !WARNING! API could be an automatic call, but also a manual call e.g. using hoffmation-ios or homebridge-hoffmation --> So this is a higher priority than Automatic but still lower than manual/force.
26
+ */
11
27
  CommandSource[CommandSource["API"] = 4] = "API";
28
+ /**
29
+ * This should mark all commands that have highest priority, thus overruling/ignoring certain controls/safety mechanisms.
30
+ */
12
31
  CommandSource[CommandSource["Force"] = 5] = "Force";
13
32
  })(CommandSource || (exports.CommandSource = CommandSource = {}));
@@ -9,12 +9,13 @@ export declare class DimmerSetLightCommand extends LampSetLightCommand {
9
9
  transitionTime: number;
10
10
  _commandType: CommandType;
11
11
  /**
12
- * @param {CommandSource | BaseCommand} source
13
- * @param {boolean} on The desired value
14
- * @param {string} reason
15
- * @param {number} timeout A chosen Timeout after which the light should be reset
16
- * @param {number} brightness The desired brightness
17
- * @param {number} transitionTime The transition time during turnOn/turnOff
12
+ * Command to change the light of a dimmer
13
+ * @param source - The source of the command
14
+ * @param on - The desired value
15
+ * @param reason - You can provide a reason for clarity
16
+ * @param timeout - A chosen Timeout after which the light should be reset
17
+ * @param brightness - The desired brightness
18
+ * @param transitionTime - The transition time during turnOn/turnOff
18
19
  */
19
20
  constructor(source: CommandSource | BaseCommand, on: boolean, reason?: string, timeout?: number, brightness?: number, transitionTime?: number);
20
21
  get logMessage(): string;
@@ -6,12 +6,13 @@ const commandType_1 = require("./commandType");
6
6
  const timeCallback_1 = require("../timeCallback");
7
7
  class DimmerSetLightCommand extends lampSetLightCommand_1.LampSetLightCommand {
8
8
  /**
9
- * @param {CommandSource | BaseCommand} source
10
- * @param {boolean} on The desired value
11
- * @param {string} reason
12
- * @param {number} timeout A chosen Timeout after which the light should be reset
13
- * @param {number} brightness The desired brightness
14
- * @param {number} transitionTime The transition time during turnOn/turnOff
9
+ * Command to change the light of a dimmer
10
+ * @param source - The source of the command
11
+ * @param on - The desired value
12
+ * @param reason - You can provide a reason for clarity
13
+ * @param timeout - A chosen Timeout after which the light should be reset
14
+ * @param brightness - The desired brightness
15
+ * @param transitionTime - The transition time during turnOn/turnOff
15
16
  */
16
17
  constructor(source, on, reason = '', timeout = -1, brightness = -1, transitionTime = -1) {
17
18
  super(source, on, reason, timeout);
@@ -7,10 +7,10 @@ export declare class FloorSetAllShuttersCommand extends BaseCommand {
7
7
  _commandType: CommandType;
8
8
  /**
9
9
  * Creates an instance of FloorSetAllShuttersCommand.
10
- * @param {CommandSource | BaseCommand} source
11
- * @param {number} position (0 closed, 100 open)
12
- * @param {number | undefined} specificFloor undefined = all floors
13
- * @param {string} reason
10
+ * @param source - The source of the command
11
+ * @param position - (0 closed, 100 open)
12
+ * @param specificFloor - undefined = all floors
13
+ * @param reason - You can provide a reason for clarity
14
14
  */
15
15
  constructor(source: CommandSource | BaseCommand, position: number, specificFloor?: number | undefined, reason?: string);
16
16
  }
@@ -6,10 +6,10 @@ const commandType_1 = require("./commandType");
6
6
  class FloorSetAllShuttersCommand extends baseCommand_1.BaseCommand {
7
7
  /**
8
8
  * Creates an instance of FloorSetAllShuttersCommand.
9
- * @param {CommandSource | BaseCommand} source
10
- * @param {number} position (0 closed, 100 open)
11
- * @param {number | undefined} specificFloor undefined = all floors
12
- * @param {string} reason
9
+ * @param source - The source of the command
10
+ * @param position - (0 closed, 100 open)
11
+ * @param specificFloor - undefined = all floors
12
+ * @param reason - You can provide a reason for clarity
13
13
  */
14
14
  constructor(source, position, specificFloor = undefined, reason = '') {
15
15
  super(source, reason);
@@ -4,6 +4,13 @@ import { BaseCommand } from './baseCommand';
4
4
  import { ActuatorSetStateCommand } from './actuatorSetStateCommand';
5
5
  export declare class LampSetLightCommand extends ActuatorSetStateCommand {
6
6
  _commandType: CommandType;
7
+ /**
8
+ * Command to set the light of a lamp
9
+ * @param source - The source of the command
10
+ * @param on - The new state of the light
11
+ * @param reason - You can provide a reason for clarification
12
+ * @param timeout - If provided, the device automatic will be turned off for the given time in ms --> Reverts to automatic after the timeout.
13
+ */
7
14
  constructor(source: CommandSource | BaseCommand, on: boolean, reason?: string, timeout?: number);
8
15
  get logMessage(): string;
9
16
  }
@@ -4,7 +4,13 @@ exports.LampSetLightCommand = void 0;
4
4
  const commandType_1 = require("./commandType");
5
5
  const actuatorSetStateCommand_1 = require("./actuatorSetStateCommand");
6
6
  class LampSetLightCommand extends actuatorSetStateCommand_1.ActuatorSetStateCommand {
7
- // TODO: Missing Comment
7
+ /**
8
+ * Command to set the light of a lamp
9
+ * @param source - The source of the command
10
+ * @param on - The new state of the light
11
+ * @param reason - You can provide a reason for clarification
12
+ * @param timeout - If provided, the device automatic will be turned off for the given time in ms --> Reverts to automatic after the timeout.
13
+ */
8
14
  constructor(source, on, reason = '', timeout = -1) {
9
15
  super(source, on, reason, timeout);
10
16
  this._commandType = commandType_1.CommandType.LampSetLightCommand;
@@ -8,10 +8,10 @@ export declare class LampSetTimeBasedCommand extends BaseCommand {
8
8
  _commandType: CommandType;
9
9
  /**
10
10
  * Set's the lamp based on lamp settings for the current time
11
- * @param {CommandSource | BaseCommand} source
12
- * @param {TimeOfDay} time The time to use for calculation of desired state
13
- * @param reason
14
- * @param {number} timeout If > 0 this is the time after which the lamp reverts to its original state
11
+ * @param source - The source of the command
12
+ * @param time - The time to use for calculation of desired state
13
+ * @param reason - You can provide a reason for clarity
14
+ * @param timeout - If > 0 this is the time after which the lamp reverts to its original state
15
15
  */
16
16
  constructor(source: CommandSource | BaseCommand, time: TimeOfDay, reason?: string, timeout?: number);
17
17
  get logMessage(): string;
@@ -7,10 +7,10 @@ const timeCallback_1 = require("../timeCallback");
7
7
  class LampSetTimeBasedCommand extends baseCommand_1.BaseCommand {
8
8
  /**
9
9
  * Set's the lamp based on lamp settings for the current time
10
- * @param {CommandSource | BaseCommand} source
11
- * @param {TimeOfDay} time The time to use for calculation of desired state
12
- * @param reason
13
- * @param {number} timeout If > 0 this is the time after which the lamp reverts to its original state
10
+ * @param source - The source of the command
11
+ * @param time - The time to use for calculation of desired state
12
+ * @param reason - You can provide a reason for clarity
13
+ * @param timeout - If > 0 this is the time after which the lamp reverts to its original state
14
14
  */
15
15
  constructor(source, time, reason = '', timeout = -1) {
16
16
  super(source, reason);
@@ -8,11 +8,11 @@ export declare class LampToggleLightCommand extends ActuatorToggleCommand {
8
8
  readonly calculateTime: boolean;
9
9
  _commandType: CommandType;
10
10
  /**
11
- *
12
- * @param {CommandSource | BaseCommand} source
13
- * @param {string} reason
14
- * @param {TimeOfDay} time The time to use for calculation of desired state
15
- * @param {boolean} calculateTime Alternative to "time", if set the time will be calculated by the lamps room and its settings
11
+ * Command to toggle the light-state of a lamp
12
+ * @param source - The source of the command
13
+ * @param reason - You can provide a reason for clarity
14
+ * @param time - The time to use for calculation of desired state
15
+ * @param calculateTime - Alternative to "time", if set the time will be calculated by the lamps room and its settings
16
16
  */
17
17
  constructor(source: CommandSource | BaseCommand, reason?: string, time?: TimeOfDay | undefined, calculateTime?: boolean);
18
18
  get logMessage(): string;
@@ -5,11 +5,11 @@ const actuatorToggleCommand_1 = require("./actuatorToggleCommand");
5
5
  const commandType_1 = require("./commandType");
6
6
  class LampToggleLightCommand extends actuatorToggleCommand_1.ActuatorToggleCommand {
7
7
  /**
8
- *
9
- * @param {CommandSource | BaseCommand} source
10
- * @param {string} reason
11
- * @param {TimeOfDay} time The time to use for calculation of desired state
12
- * @param {boolean} calculateTime Alternative to "time", if set the time will be calculated by the lamps room and its settings
8
+ * Command to toggle the light-state of a lamp
9
+ * @param source - The source of the command
10
+ * @param reason - You can provide a reason for clarity
11
+ * @param time - The time to use for calculation of desired state
12
+ * @param calculateTime - Alternative to "time", if set the time will be calculated by the lamps room and its settings
13
13
  */
14
14
  constructor(source, reason = '', time, calculateTime = false) {
15
15
  super(source, reason);