hoffmation-base 2.22.18 → 3.0.0-alpha.0

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 (115) hide show
  1. package/lib/models/command/ShutterSetLevelCommand.d.ts +10 -0
  2. package/lib/models/command/ShutterSetLevelCommand.js +17 -0
  3. package/lib/models/command/WindowRestoreDesiredPositionCommand.d.ts +7 -0
  4. package/lib/models/command/WindowRestoreDesiredPositionCommand.js +12 -0
  5. package/lib/models/command/WindowSetDesiredPositionCommand.d.ts +8 -0
  6. package/lib/models/command/WindowSetDesiredPositionCommand.js +13 -0
  7. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.d.ts +7 -0
  8. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.js +12 -0
  9. package/lib/models/command/actuatorSetStateCommand.d.ts +13 -0
  10. package/lib/models/command/actuatorSetStateCommand.js +22 -0
  11. package/lib/models/command/actuatorToggleCommand.d.ts +8 -0
  12. package/lib/models/command/actuatorToggleCommand.js +15 -0
  13. package/lib/models/command/actuatorWriteStateToDeviceCommand.d.ts +9 -0
  14. package/lib/models/command/actuatorWriteStateToDeviceCommand.js +16 -0
  15. package/lib/models/command/baseCommand.d.ts +12 -0
  16. package/lib/models/command/baseCommand.js +34 -0
  17. package/lib/models/command/commandSource.d.ts +8 -0
  18. package/lib/models/command/commandSource.js +12 -0
  19. package/lib/models/command/commandType.d.ts +23 -0
  20. package/lib/models/command/commandType.js +27 -0
  21. package/lib/models/command/dimmerSetLightCommand.d.ts +22 -0
  22. package/lib/models/command/dimmerSetLightCommand.js +40 -0
  23. package/lib/models/command/floorSetAllShuttersCommand.d.ts +16 -0
  24. package/lib/models/command/floorSetAllShuttersCommand.js +21 -0
  25. package/lib/models/command/index.d.ts +24 -0
  26. package/lib/models/command/index.js +51 -0
  27. package/lib/models/command/lampSetLightCommand.d.ts +9 -0
  28. package/lib/models/command/lampSetLightCommand.js +15 -0
  29. package/lib/models/command/lampSetTimeBasedCommand.d.ts +18 -0
  30. package/lib/models/command/lampSetTimeBasedCommand.js +25 -0
  31. package/lib/models/command/lampToggleLightCommand.d.ts +19 -0
  32. package/lib/models/command/lampToggleLightCommand.js +24 -0
  33. package/lib/models/command/ledSetLightCommand.d.ts +25 -0
  34. package/lib/models/command/ledSetLightCommand.js +41 -0
  35. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.d.ts +9 -0
  36. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.js +13 -0
  37. package/lib/models/command/restoreTargetAutomaticValueCommand.d.ts +8 -0
  38. package/lib/models/command/restoreTargetAutomaticValueCommand.js +15 -0
  39. package/lib/models/command/roomRestoreLightCommand.d.ts +7 -0
  40. package/lib/models/command/roomRestoreLightCommand.js +12 -0
  41. package/lib/models/command/roomRestoreShutterPositionCommand.d.ts +8 -0
  42. package/lib/models/command/roomRestoreShutterPositionCommand.js +13 -0
  43. package/lib/models/command/roomSetLightTimeBasedCommand.d.ts +14 -0
  44. package/lib/models/command/roomSetLightTimeBasedCommand.js +19 -0
  45. package/lib/models/command/shutterSunriseUpCommand.d.ts +7 -0
  46. package/lib/models/command/shutterSunriseUpCommand.js +12 -0
  47. package/lib/models/command/shutterSunsetDownCommand.d.ts +7 -0
  48. package/lib/models/command/shutterSunsetDownCommand.js +12 -0
  49. package/lib/models/command/wledSetLightCommand.d.ts +12 -0
  50. package/lib/models/command/wledSetLightCommand.js +28 -0
  51. package/lib/models/index.d.ts +1 -0
  52. package/lib/models/index.js +1 -0
  53. package/lib/models/rooms/RoomBase.d.ts +2 -2
  54. package/lib/models/rooms/RoomBase.js +5 -5
  55. package/lib/models/rooms/iRoomBase.d.ts +2 -5
  56. package/lib/server/devices/baseDeviceInterfaces/iActuator.d.ts +5 -6
  57. package/lib/server/devices/baseDeviceInterfaces/iDimmableLamp.d.ts +3 -8
  58. package/lib/server/devices/baseDeviceInterfaces/iLamp.d.ts +6 -16
  59. package/lib/server/devices/baseDeviceInterfaces/iLedRgbCct.d.ts +2 -16
  60. package/lib/server/devices/baseDeviceInterfaces/iShutter.d.ts +2 -2
  61. package/lib/server/devices/baseDeviceInterfaces/iTemporaryDisableAutomatic.d.ts +2 -1
  62. package/lib/server/devices/dachs/dachs.d.ts +5 -4
  63. package/lib/server/devices/dachs/dachs.js +13 -21
  64. package/lib/server/devices/groups/Window.d.ts +3 -3
  65. package/lib/server/devices/groups/Window.js +9 -15
  66. package/lib/server/devices/groups/lightGroup.d.ts +9 -7
  67. package/lib/server/devices/groups/lightGroup.js +46 -40
  68. package/lib/server/devices/groups/presenceGroup.js +2 -2
  69. package/lib/server/devices/groups/tasterGroup.js +22 -6
  70. package/lib/server/devices/groups/windowGroup.d.ts +5 -7
  71. package/lib/server/devices/groups/windowGroup.js +25 -43
  72. package/lib/server/devices/hmIPDevices/hmIpLampe.d.ts +8 -7
  73. package/lib/server/devices/hmIPDevices/hmIpLampe.js +19 -31
  74. package/lib/server/devices/hmIPDevices/hmIpRoll.d.ts +2 -2
  75. package/lib/server/devices/hmIPDevices/hmIpRoll.js +17 -15
  76. package/lib/server/devices/sharedFunctions/lampUtils.d.ts +8 -7
  77. package/lib/server/devices/sharedFunctions/lampUtils.js +47 -27
  78. package/lib/server/devices/wledDevice.d.ts +9 -8
  79. package/lib/server/devices/wledDevice.js +37 -52
  80. package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.d.ts +5 -4
  81. package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.js +13 -21
  82. package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.d.ts +8 -12
  83. package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +32 -45
  84. package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.d.ts +3 -3
  85. package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.js +11 -32
  86. package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.d.ts +2 -2
  87. package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +9 -7
  88. package/lib/server/devices/zigbee/zigbeeBlitzShp.js +2 -2
  89. package/lib/server/devices/zigbee/zigbeeHeimanSmoke.js +1 -1
  90. package/lib/server/devices/zigbee/zigbeeIlluActuator.d.ts +0 -2
  91. package/lib/server/devices/zigbee/zigbeeIlluActuator.js +0 -6
  92. package/lib/server/devices/zigbee/zigbeeIlluLampe.d.ts +4 -4
  93. package/lib/server/devices/zigbee/zigbeeIlluLampe.js +6 -11
  94. package/lib/server/devices/zigbee/zigbeeInnr142C.d.ts +0 -4
  95. package/lib/server/devices/zigbee/zigbeeInnr142C.js +0 -33
  96. package/lib/server/devices/zigbee/zigbeeUbisysActuator.d.ts +0 -2
  97. package/lib/server/devices/zigbee/zigbeeUbisysActuator.js +0 -6
  98. package/lib/server/devices/zigbee/zigbeeUbisysLampe.d.ts +4 -4
  99. package/lib/server/devices/zigbee/zigbeeUbisysLampe.js +6 -11
  100. package/lib/server/services/ShutterService.d.ts +2 -7
  101. package/lib/server/services/ShutterService.js +2 -26
  102. package/lib/server/services/Telegram/telegram-Commands.js +2 -1
  103. package/lib/server/services/ac/daikin-service.d.ts +1 -1
  104. package/lib/server/services/ac/daikin-service.js +7 -2
  105. package/lib/server/services/ac/own-daikin-device.d.ts +3 -2
  106. package/lib/server/services/ac/own-daikin-device.js +4 -3
  107. package/lib/server/services/api/api-service.js +6 -6
  108. package/lib/server/services/blockAutomaticHandler.d.ts +2 -2
  109. package/lib/server/services/blockAutomaticHandler.js +5 -3
  110. package/lib/server/services/govee/own-govee-device.d.ts +8 -7
  111. package/lib/server/services/govee/own-govee-device.js +36 -47
  112. package/lib/server/services/room-service/room-service.d.ts +6 -10
  113. package/lib/server/services/room-service/room-service.js +19 -25
  114. package/lib/tsconfig.tsbuildinfo +1 -1
  115. package/package.json +21 -20
@@ -0,0 +1,25 @@
1
+ import { CommandType } from './commandType';
2
+ import { CommandSource } from './commandSource';
3
+ import { BaseCommand } from './baseCommand';
4
+ import { DimmerSetLightCommand } from './dimmerSetLightCommand';
5
+ import { LampSetTimeBasedCommand } from './lampSetTimeBasedCommand';
6
+ import { LedSettings } from '../deviceSettings';
7
+ export declare class LedSetLightCommand extends DimmerSetLightCommand {
8
+ color: string;
9
+ colorTemp: number;
10
+ _commandType: CommandType;
11
+ /**
12
+ *
13
+ * @param {CommandSource | BaseCommand} source
14
+ * @param {boolean} on
15
+ * @param {string} reason
16
+ * @param {number} timeout A chosen Timeout after which the light should be reset
17
+ * @param {number} brightness The desired brightness
18
+ * @param {number} transitionTime The transition time during turnOn/turnOff
19
+ * @param {string} color The desired color in 6 digit hex Code
20
+ * @param {number} colorTemp The desired color Temperature (0 = more White)
21
+ */
22
+ constructor(source: CommandSource | BaseCommand, on: boolean, reason?: string, timeout?: number, brightness?: number, transitionTime?: number, color?: string, colorTemp?: number);
23
+ get logMessage(): string;
24
+ static byTimeBased(settings: LedSettings, c: LampSetTimeBasedCommand): LedSetLightCommand;
25
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LedSetLightCommand = void 0;
4
+ const commandType_1 = require("./commandType");
5
+ const dimmerSetLightCommand_1 = require("./dimmerSetLightCommand");
6
+ const timeCallback_1 = require("../timeCallback");
7
+ class LedSetLightCommand extends dimmerSetLightCommand_1.DimmerSetLightCommand {
8
+ /**
9
+ *
10
+ * @param {CommandSource | BaseCommand} source
11
+ * @param {boolean} on
12
+ * @param {string} reason
13
+ * @param {number} timeout A chosen Timeout after which the light should be reset
14
+ * @param {number} brightness The desired brightness
15
+ * @param {number} transitionTime The transition time during turnOn/turnOff
16
+ * @param {string} color The desired color in 6 digit hex Code
17
+ * @param {number} colorTemp The desired color Temperature (0 = more White)
18
+ */
19
+ constructor(source, on, reason = '', timeout = -1, brightness, transitionTime, color = '', colorTemp = -1) {
20
+ super(source, on, reason, timeout, brightness, transitionTime);
21
+ this.color = color;
22
+ this.colorTemp = colorTemp;
23
+ this._commandType = commandType_1.CommandType.LedSetLightCommand;
24
+ }
25
+ get logMessage() {
26
+ return `Led setLight to ${this.on} from ${this.source} for reason: ${this.reasonTrace}`;
27
+ }
28
+ static byTimeBased(settings, c) {
29
+ switch (c.time) {
30
+ case timeCallback_1.TimeOfDay.Daylight:
31
+ return new LedSetLightCommand(c, settings.dayOn, '', c.timeout, settings.dayBrightness, undefined, settings.dayColor, settings.dayColorTemp);
32
+ case timeCallback_1.TimeOfDay.BeforeSunrise:
33
+ return new LedSetLightCommand(c, settings.dawnOn, '', c.timeout, settings.dawnBrightness, undefined, settings.dawnColor, settings.dawnColorTemp);
34
+ case timeCallback_1.TimeOfDay.AfterSunset:
35
+ return new LedSetLightCommand(c, settings.duskOn, '', c.timeout, settings.duskBrightness, undefined, settings.duskColor, settings.duskColorTemp);
36
+ case timeCallback_1.TimeOfDay.Night:
37
+ return new LedSetLightCommand(c, settings.nightOn, '', c.timeout, settings.nightBrightness, undefined, settings.nightColor, settings.nightColorTemp);
38
+ }
39
+ }
40
+ }
41
+ exports.LedSetLightCommand = LedSetLightCommand;
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from './baseCommand';
2
+ import { CommandType } from './commandType';
3
+ import { CommandSource } from './commandSource';
4
+ import { TimeOfDay } from '../timeCallback';
5
+ export declare class LightGroupSwitchTimeConditionalCommand extends BaseCommand {
6
+ readonly time: TimeOfDay;
7
+ _commandType: CommandType;
8
+ constructor(source: CommandSource | BaseCommand, time: TimeOfDay, reason?: string);
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LightGroupSwitchTimeConditionalCommand = void 0;
4
+ const baseCommand_1 = require("./baseCommand");
5
+ const commandType_1 = require("./commandType");
6
+ class LightGroupSwitchTimeConditionalCommand extends baseCommand_1.BaseCommand {
7
+ constructor(source, time, reason = '') {
8
+ super(source, reason);
9
+ this.time = time;
10
+ this._commandType = commandType_1.CommandType.LightGroupSwitchTimeConditional;
11
+ }
12
+ }
13
+ exports.LightGroupSwitchTimeConditionalCommand = LightGroupSwitchTimeConditionalCommand;
@@ -0,0 +1,8 @@
1
+ import { BaseCommand } from './baseCommand';
2
+ import { CommandSource } from './commandSource';
3
+ import { CommandType } from './commandType';
4
+ export declare class RestoreTargetAutomaticValueCommand extends BaseCommand {
5
+ _commandType: CommandType;
6
+ constructor(source: CommandSource | BaseCommand, reason?: string);
7
+ get logMessage(): string;
8
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RestoreTargetAutomaticValueCommand = void 0;
4
+ const baseCommand_1 = require("./baseCommand");
5
+ const commandType_1 = require("./commandType");
6
+ class RestoreTargetAutomaticValueCommand extends baseCommand_1.BaseCommand {
7
+ constructor(source, reason = '') {
8
+ super(source, reason);
9
+ this._commandType = commandType_1.CommandType.ActuatorRestoreTargetAutomaticValueCommand;
10
+ }
11
+ get logMessage() {
12
+ return `Actuator restore target automatic value from ${this.source} for reason: ${this.reasonTrace}`;
13
+ }
14
+ }
15
+ exports.RestoreTargetAutomaticValueCommand = RestoreTargetAutomaticValueCommand;
@@ -0,0 +1,7 @@
1
+ import { BaseCommand } from './baseCommand';
2
+ import { CommandType } from './commandType';
3
+ import { CommandSource } from './commandSource';
4
+ export declare class RoomRestoreLightCommand extends BaseCommand {
5
+ _commandType: CommandType;
6
+ constructor(source: CommandSource | BaseCommand, reason?: string);
7
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RoomRestoreLightCommand = void 0;
4
+ const baseCommand_1 = require("./baseCommand");
5
+ const commandType_1 = require("./commandType");
6
+ class RoomRestoreLightCommand extends baseCommand_1.BaseCommand {
7
+ constructor(source, reason = '') {
8
+ super(source, reason);
9
+ this._commandType = commandType_1.CommandType.RoomRestoreLightCommand;
10
+ }
11
+ }
12
+ exports.RoomRestoreLightCommand = RoomRestoreLightCommand;
@@ -0,0 +1,8 @@
1
+ import { CommandSource } from './commandSource';
2
+ import { BaseCommand } from './baseCommand';
3
+ import { CommandType } from './commandType';
4
+ export declare class RoomRestoreShutterPositionCommand extends BaseCommand {
5
+ readonly recalc: boolean;
6
+ _commandType: CommandType;
7
+ constructor(source: CommandSource | BaseCommand, recalc?: boolean, reason?: string);
8
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RoomRestoreShutterPositionCommand = void 0;
4
+ const baseCommand_1 = require("./baseCommand");
5
+ const commandType_1 = require("./commandType");
6
+ class RoomRestoreShutterPositionCommand extends baseCommand_1.BaseCommand {
7
+ constructor(source, recalc = false, reason = '') {
8
+ super(source, reason);
9
+ this.recalc = recalc;
10
+ this._commandType = commandType_1.CommandType.RoomRestoreShutterPositionCommand;
11
+ }
12
+ }
13
+ exports.RoomRestoreShutterPositionCommand = RoomRestoreShutterPositionCommand;
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from './baseCommand';
2
+ import { CommandType } from './commandType';
3
+ import { CommandSource } from './commandSource';
4
+ export declare class RoomSetLightTimeBasedCommand extends BaseCommand {
5
+ readonly movementDependant: boolean;
6
+ _commandType: CommandType;
7
+ /**
8
+ * Sets the light based on the current time, rollo Position and room Settings
9
+ * @param source
10
+ * @param movementDependant Only turn light on if there was a movement in the same room
11
+ * @param reason
12
+ */
13
+ constructor(source: CommandSource | BaseCommand, movementDependant?: boolean, reason?: string);
14
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RoomSetLightTimeBasedCommand = void 0;
4
+ const baseCommand_1 = require("./baseCommand");
5
+ const commandType_1 = require("./commandType");
6
+ class RoomSetLightTimeBasedCommand extends baseCommand_1.BaseCommand {
7
+ /**
8
+ * Sets the light based on the current time, rollo Position and room Settings
9
+ * @param source
10
+ * @param movementDependant Only turn light on if there was a movement in the same room
11
+ * @param reason
12
+ */
13
+ constructor(source, movementDependant = false, reason = '') {
14
+ super(source, reason);
15
+ this.movementDependant = movementDependant;
16
+ this._commandType = commandType_1.CommandType.RoomSetLightTimeBasedCommand;
17
+ }
18
+ }
19
+ exports.RoomSetLightTimeBasedCommand = RoomSetLightTimeBasedCommand;
@@ -0,0 +1,7 @@
1
+ import { BaseCommand } from './baseCommand';
2
+ import { CommandSource } from './commandSource';
3
+ import { CommandType } from './commandType';
4
+ export declare class ShutterSunriseUpCommand extends BaseCommand {
5
+ _commandType: CommandType;
6
+ constructor(source: CommandSource | BaseCommand, reason?: string);
7
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShutterSunriseUpCommand = void 0;
4
+ const baseCommand_1 = require("./baseCommand");
5
+ const commandType_1 = require("./commandType");
6
+ class ShutterSunriseUpCommand extends baseCommand_1.BaseCommand {
7
+ constructor(source, reason = '') {
8
+ super(source, reason);
9
+ this._commandType = commandType_1.CommandType.ShutterSunriseUpCommand;
10
+ }
11
+ }
12
+ exports.ShutterSunriseUpCommand = ShutterSunriseUpCommand;
@@ -0,0 +1,7 @@
1
+ import { BaseCommand } from './baseCommand';
2
+ import { CommandSource } from './commandSource';
3
+ import { CommandType } from './commandType';
4
+ export declare class ShutterSunsetDownCommand extends BaseCommand {
5
+ _commandType: CommandType;
6
+ constructor(source: CommandSource | BaseCommand, reason?: string);
7
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShutterSunsetDownCommand = void 0;
4
+ const baseCommand_1 = require("./baseCommand");
5
+ const commandType_1 = require("./commandType");
6
+ class ShutterSunsetDownCommand extends baseCommand_1.BaseCommand {
7
+ constructor(source, reason = '') {
8
+ super(source, reason);
9
+ this._commandType = commandType_1.CommandType.SunsetDownCommand;
10
+ }
11
+ }
12
+ exports.ShutterSunsetDownCommand = ShutterSunsetDownCommand;
@@ -0,0 +1,12 @@
1
+ import { CommandType } from './commandType';
2
+ import { CommandSource } from './commandSource';
3
+ import { BaseCommand } from './baseCommand';
4
+ import { DimmerSetLightCommand } from './dimmerSetLightCommand';
5
+ import { WledSettings } from '../deviceSettings';
6
+ import { LampSetTimeBasedCommand } from './lampSetTimeBasedCommand';
7
+ export declare class WledSetLightCommand extends DimmerSetLightCommand {
8
+ preset?: number | undefined;
9
+ _commandType: CommandType;
10
+ constructor(source: CommandSource | BaseCommand, on: boolean, reason?: string, timeout?: number, brightness?: number, transitionTime?: number, preset?: number | undefined);
11
+ static byTimeBased(settings: WledSettings, c: LampSetTimeBasedCommand): WledSetLightCommand;
12
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WledSetLightCommand = void 0;
4
+ const commandType_1 = require("./commandType");
5
+ const dimmerSetLightCommand_1 = require("./dimmerSetLightCommand");
6
+ const timeCallback_1 = require("../timeCallback");
7
+ class WledSetLightCommand extends dimmerSetLightCommand_1.DimmerSetLightCommand {
8
+ constructor(source, on, reason = '', timeout = -1, brightness = -1, transitionTime = -1, preset) {
9
+ super(source, on, reason, timeout, brightness, transitionTime);
10
+ this.preset = preset;
11
+ this._commandType = commandType_1.CommandType.WledSetLightCommand;
12
+ }
13
+ static byTimeBased(settings, c) {
14
+ switch (c.time) {
15
+ case timeCallback_1.TimeOfDay.Daylight:
16
+ return new WledSetLightCommand(c, settings.dayOn, '', c.timeout, settings.dayBrightness, undefined, settings.dayPreset);
17
+ case timeCallback_1.TimeOfDay.BeforeSunrise:
18
+ return new WledSetLightCommand(c, settings.dawnOn, '', c.timeout, settings.dawnBrightness, undefined, settings.dawnPreset);
19
+ case timeCallback_1.TimeOfDay.AfterSunset:
20
+ return new WledSetLightCommand(c, settings.duskOn, '', c.timeout, settings.duskBrightness, undefined, settings.duskPreset);
21
+ case timeCallback_1.TimeOfDay.Night:
22
+ return new WledSetLightCommand(c, settings.nightOn, '', c.timeout, settings.nightBrightness, undefined, settings.nightPreset);
23
+ default:
24
+ throw new Error(`TimeOfDay ${c.time} not supported`);
25
+ }
26
+ }
27
+ }
28
+ exports.WledSetLightCommand = WledSetLightCommand;
@@ -4,6 +4,7 @@ export * from './persistence/index';
4
4
  export * from './base64Image';
5
5
  export * from './collisionSolving';
6
6
  export * from './connectionCallbacks';
7
+ export * from './command';
7
8
  export * from './daytime';
8
9
  export * from './deviceConfig';
9
10
  export * from './excessEnergyConsumerSettings';
@@ -20,6 +20,7 @@ __exportStar(require("./persistence/index"), exports);
20
20
  __exportStar(require("./base64Image"), exports);
21
21
  __exportStar(require("./collisionSolving"), exports);
22
22
  __exportStar(require("./connectionCallbacks"), exports);
23
+ __exportStar(require("./command"), exports);
23
24
  __exportStar(require("./daytime"), exports);
24
25
  __exportStar(require("./deviceConfig"), exports);
25
26
  __exportStar(require("./excessEnergyConsumerSettings"), exports);
@@ -5,6 +5,7 @@ import { RoomSettingsController } from './RoomSettings';
5
5
  import { iRoomBase } from './iRoomBase';
6
6
  import { RoomInfo } from './roomInfo';
7
7
  import { iIdHolder } from '../iIdHolder';
8
+ import { RoomSetLightTimeBasedCommand } from '../command';
8
9
  export declare class RoomBase implements iRoomBase, iIdHolder {
9
10
  groupMap: Map<GroupType, BaseGroup>;
10
11
  info: RoomInfo;
@@ -38,9 +39,8 @@ export declare class RoomBase implements iRoomBase, iIdHolder {
38
39
  recalcTimeCallbacks(): void;
39
40
  /**
40
41
  * Sets the light based on the current time, rollo Position and room Settings
41
- * @param movementDependant Only turn light on if there was a movement in the same room
42
42
  */
43
- setLightTimeBased(movementDependant?: boolean): void;
43
+ setLightTimeBased(c: RoomSetLightTimeBasedCommand): void;
44
44
  isNowLightTime(): boolean;
45
45
  toJSON(): Partial<RoomBase & {
46
46
  groupDict?: {
@@ -10,6 +10,7 @@ const logLevel_1 = require("../logLevel");
10
10
  const RoomSettings_1 = require("./RoomSettings");
11
11
  const roomInfo_1 = require("./roomInfo");
12
12
  const lodash_1 = __importDefault(require("lodash"));
13
+ const command_1 = require("../command");
13
14
  class RoomBase {
14
15
  constructor(groupMap, roomName, etage = 99, startPoint, endPoint) {
15
16
  this.groupMap = groupMap;
@@ -105,17 +106,16 @@ class RoomBase {
105
106
  }
106
107
  /**
107
108
  * Sets the light based on the current time, rollo Position and room Settings
108
- * @param movementDependant Only turn light on if there was a movement in the same room
109
109
  */
110
- setLightTimeBased(movementDependant = false) {
110
+ setLightTimeBased(c) {
111
111
  var _a, _b;
112
112
  if (!this.LightGroup) {
113
113
  this.log(logLevel_1.LogLevel.Trace, 'Ignore "setLightTimeBased" as we have no lamps');
114
114
  return;
115
115
  }
116
- if (movementDependant && this.PraesenzGroup && !((_a = this.PraesenzGroup) === null || _a === void 0 ? void 0 : _a.anyPresent())) {
116
+ if (c.movementDependant && this.PraesenzGroup && !((_a = this.PraesenzGroup) === null || _a === void 0 ? void 0 : _a.anyPresent())) {
117
117
  this.log(logLevel_1.LogLevel.Trace, 'Turn off lights as no-one is present.');
118
- this.LightGroup.switchAll(false);
118
+ this.LightGroup.switchAll(new command_1.ActuatorSetStateCommand(c, false, 'Room.setLightTimeBased but no one is present'));
119
119
  return;
120
120
  }
121
121
  if (!this.settings.lampOffset && !this.settings.roomIsAlwaysDark) {
@@ -132,7 +132,7 @@ class RoomBase {
132
132
  })))) {
133
133
  timeOfDay = server_1.Utils.nowTime().hours > 16 ? timeCallback_1.TimeOfDay.AfterSunset : timeCallback_1.TimeOfDay.BeforeSunrise;
134
134
  }
135
- this.LightGroup.switchTimeConditional(timeOfDay);
135
+ this.LightGroup.switchTimeConditional(new command_1.LightGroupSwitchTimeConditionalCommand(c, timeOfDay, 'Roombase.setLightTimeBased'));
136
136
  }
137
137
  isNowLightTime() {
138
138
  var _a;
@@ -1,4 +1,5 @@
1
1
  import { TimeCallback } from '../timeCallback';
2
+ import { RoomSetLightTimeBasedCommand } from '../command';
2
3
  export interface iRoomBase {
3
4
  sunriseShutterCallback: TimeCallback | undefined;
4
5
  sunsetShutterCallback: TimeCallback | undefined;
@@ -9,10 +10,6 @@ export interface iRoomBase {
9
10
  initializeBase(): void;
10
11
  persist(): void;
11
12
  recalcTimeCallbacks(): void;
12
- /**
13
- * Sets the light based on the current time, rollo Position and room Settings
14
- * @param movementDependant Only turn light on if there was a movement in the same room
15
- */
16
- setLightTimeBased(movementDependant: boolean): void;
13
+ setLightTimeBased(c: RoomSetLightTimeBasedCommand): void;
17
14
  isNowLightTime(): boolean;
18
15
  }
@@ -1,4 +1,4 @@
1
- import { ActuatorSettings } from '../../../models';
1
+ import { ActuatorSetStateCommand, ActuatorSettings, ActuatorToggleCommand, ActuatorWriteStateToDeviceCommand } from '../../../models';
2
2
  import { iRoomDevice } from './iRoomDevice';
3
3
  import { iTemporaryDisableAutomatic } from './iTemporaryDisableAutomatic';
4
4
  export interface iActuator extends iRoomDevice, iTemporaryDisableAutomatic {
@@ -21,11 +21,10 @@ export interface iActuator extends iRoomDevice, iTemporaryDisableAutomatic {
21
21
  persist(): void;
22
22
  /**
23
23
  * Controls the power state of this actuator
24
- * @param {boolean} pValue the new desired State
25
- * @param {number} timeout if positive the time in ms, after which state should reset to automatic
26
- * @param {boolean} force if true, this command isn't overwritten by automatic actions
27
24
  * Accessible in API
25
+ * @param command
28
26
  */
29
- setActuator(pValue: boolean, timeout?: number, force?: boolean): void;
30
- toggleActuator(force: boolean): boolean;
27
+ setActuator(command: ActuatorSetStateCommand): void;
28
+ toggleActuator(command: ActuatorToggleCommand): boolean;
29
+ writeActuatorStateToDevice(command: ActuatorWriteStateToDeviceCommand): void;
31
30
  }
@@ -1,17 +1,12 @@
1
1
  import { iLamp } from './iLamp';
2
- import { DimmerSettings, TimeOfDay } from '../../../models';
2
+ import { DimmerSetLightCommand, DimmerSettings, LampToggleLightCommand } from '../../../models';
3
3
  export interface iDimmableLamp extends iLamp {
4
4
  settings: DimmerSettings;
5
5
  readonly brightness: number;
6
- toggleLight(time: TimeOfDay, force: boolean, calculateTime: boolean): void;
6
+ toggleLight(command: LampToggleLightCommand): void;
7
7
  /**
8
8
  * This function sets the light to a specific value
9
- * @param pValue The desired value
10
- * @param timeout A chosen Timeout after which the light should be reset
11
- * @param force Wether it is a action based on a user action, to override certain rules
12
- * @param brightness The desired brightness
13
- * @param transitionTime The transition time during turnOn/turnOff
14
9
  * Accessible in API
15
10
  */
16
- setLight(pValue: boolean, timeout?: number, force?: boolean, brightness?: number, transitionTime?: number): void;
11
+ setLight(command: DimmerSetLightCommand): void;
17
12
  }
@@ -1,30 +1,20 @@
1
- import { TimeOfDay } from '../../../models';
1
+ import { LampSetLightCommand, LampSetTimeBasedCommand, LampToggleLightCommand } from '../../../models';
2
2
  import { iActuator } from './iActuator';
3
3
  export interface iLamp extends iActuator {
4
4
  /**
5
5
  * The state value of the device
6
6
  */
7
7
  readonly lightOn: boolean;
8
- /**
9
- * Set's the lamp based on lamp settings for the current time
10
- * @param {TimeOfDay} time The time to use for calculation of desired state
11
- * @param {number} timeout If > 0 this is the time after which the lamp reverts to its original state
12
- * @param {boolean} force To indicate a higher priority than automatic actions (e.g. a user pressing a button)
13
- */
14
- setTimeBased(time: TimeOfDay, timeout?: number, force?: boolean): void;
8
+ setTimeBased(command: LampSetTimeBasedCommand): void;
15
9
  /**
16
10
  * Toggles the state of the lamp
17
- * @param {TimeOfDay} time The time to use for calculation of desired state
18
- * @param {boolean} force To indicate a higher priority than automatic actions (e.g. a user pressing a button)
19
- * @param {boolean} calculateTime Alternative to "time", if set the time will be calculated by the lamps room and its settings
11
+ * @param command
20
12
  */
21
- toggleLight(time?: TimeOfDay, force?: boolean, calculateTime?: boolean): void;
13
+ toggleLight(command: LampToggleLightCommand): void;
22
14
  /**
23
15
  * This function sets the light to a specific value
24
- * @param pValue The desired value
25
- * @param timeout A chosen Timeout after which the light should be reset
26
- * @param force Wether it is a action based on a user action, to override certain rules
27
16
  * Accessible in API
17
+ * @param command
28
18
  */
29
- setLight(pValue: boolean, timeout: number, force: boolean): void;
19
+ setLight(command: LampSetLightCommand): void;
30
20
  }
@@ -1,22 +1,8 @@
1
- import { LedSettings, TimeOfDay } from '../../../models';
1
+ import { LedSetLightCommand, LedSettings } from '../../../models';
2
2
  import { iDimmableLamp } from './iDimmableLamp';
3
3
  export interface iLedRgbCct extends iDimmableLamp {
4
4
  settings: LedSettings;
5
5
  readonly color: string;
6
6
  readonly colortemp: number;
7
- /**
8
- * @inheritDoc
9
- */
10
- setTimeBased(time: TimeOfDay, timeout?: number, force?: boolean): void;
11
- /**
12
- * @inheritDoc
13
- * @param pValue
14
- * @param timeout
15
- * @param force
16
- * @param brightness
17
- * @param transitionTime
18
- * @param {string} color The desired color in 6 digit hex Code
19
- * @param {number} colorTemp The desired color Temperature (0 = more White)
20
- */
21
- setLight(pValue: boolean, timeout?: number, force?: boolean, brightness?: number, transitionTime?: number, color?: string, colorTemp?: number): void;
7
+ setLight(c: LedSetLightCommand): void;
22
8
  }
@@ -1,11 +1,11 @@
1
1
  import { Window } from '../groups';
2
2
  import { iRoomDevice } from './iRoomDevice';
3
- import { ShutterSettings } from '../../../models';
3
+ import { ShutterSetLevelCommand, ShutterSettings } from '../../../models';
4
4
  export interface iShutter extends iRoomDevice {
5
5
  settings: ShutterSettings;
6
6
  currentLevel: number;
7
7
  desiredWindowShutterLevel: number;
8
8
  window: Window | undefined;
9
9
  persist(): void;
10
- setLevel(pPosition: number, initial: boolean, skipOpenWarning?: boolean): void;
10
+ setLevel(command: ShutterSetLevelCommand): void;
11
11
  }
@@ -1,6 +1,7 @@
1
1
  import { BlockAutomaticHandler } from '../../services/blockAutomaticHandler';
2
2
  import { iBaseDevice } from './iBaseDevice';
3
+ import { RestoreTargetAutomaticValueCommand } from '../../../models';
3
4
  export interface iTemporaryDisableAutomatic extends iBaseDevice {
4
5
  readonly blockAutomationHandler: BlockAutomaticHandler;
5
- restoreTargetAutomaticValue(): void;
6
+ restoreTargetAutomaticValue(command: RestoreTargetAutomaticValueCommand): void;
6
7
  }
@@ -1,5 +1,5 @@
1
1
  import { DeviceInfo, DeviceType, iActuator, iBaseDevice } from '../../devices';
2
- import { LogLevel, RoomBase } from '../../../models';
2
+ import { ActuatorSetStateCommand, ActuatorToggleCommand, ActuatorWriteStateToDeviceCommand, LogLevel, RestoreTargetAutomaticValueCommand, RoomBase } from '../../../models';
3
3
  import { DeviceCapability } from '../DeviceCapability';
4
4
  import { LogDebugType, OwnSonosDevice } from '../../services';
5
5
  import { iDachsSettings } from '../../config/iDachsSettings';
@@ -28,7 +28,7 @@ export declare class Dachs implements iBaseDevice, iActuator {
28
28
  get tempWarmWater(): number;
29
29
  get tempHeatStorage(): number;
30
30
  constructor(options: iDachsSettings);
31
- restoreTargetAutomaticValue(): void;
31
+ restoreTargetAutomaticValue(c: RestoreTargetAutomaticValueCommand): void;
32
32
  protected _info: DeviceInfo;
33
33
  get info(): DeviceInfo;
34
34
  set info(info: DeviceInfo);
@@ -41,6 +41,7 @@ export declare class Dachs implements iBaseDevice, iActuator {
41
41
  loadDeviceSettings(): void;
42
42
  private loadData;
43
43
  persist(): void;
44
- setActuator(pValue: boolean, timeout?: number, force?: boolean): void;
45
- toggleActuator(_force: boolean): boolean;
44
+ setActuator(c: ActuatorSetStateCommand): void;
45
+ toggleActuator(c: ActuatorToggleCommand): boolean;
46
+ writeActuatorStateToDevice(c: ActuatorWriteStateToDeviceCommand): void;
46
47
  }
@@ -58,9 +58,9 @@ class Dachs {
58
58
  services_1.Utils.guardedInterval(this.loadData, this.config.refreshInterval, this);
59
59
  this.blockAutomationHandler = new blockAutomaticHandler_1.BlockAutomaticHandler(this.restoreTargetAutomaticValue.bind(this));
60
60
  }
61
- restoreTargetAutomaticValue() {
61
+ restoreTargetAutomaticValue(c) {
62
62
  this.log(models_1.LogLevel.Debug, `Restore Target Automatic value`);
63
- this.setActuator(this.targetAutomaticState);
63
+ this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState, 'Restore Target Automatic value'));
64
64
  }
65
65
  get info() {
66
66
  return this._info;
@@ -132,17 +132,19 @@ class Dachs {
132
132
  var _a;
133
133
  (_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistActuator(this);
134
134
  }
135
- setActuator(pValue, timeout, force) {
136
- if (!pValue || this._dachsOn) {
137
- // Dachs can only be turned on, not off
138
- return;
139
- }
140
- const dontBlock = devices_1.LampUtils.checkUnBlock(this, force, pValue);
141
- if (devices_1.LampUtils.checkBlockActive(this, force, pValue)) {
135
+ setActuator(c) {
136
+ devices_1.LampUtils.setActuator(this, c);
137
+ }
138
+ toggleActuator(c) {
139
+ const setActuatorCommand = models_1.ActuatorSetStateCommand.byActuatorAndToggleCommand(this, c);
140
+ this.setActuator(setActuatorCommand);
141
+ return setActuatorCommand.on;
142
+ }
143
+ writeActuatorStateToDevice(c) {
144
+ this.log(models_1.LogLevel.Debug, c.logMessage, services_1.LogDebugType.SetActuator);
145
+ if (!c.stateValue) {
142
146
  return;
143
147
  }
144
- this.log(models_1.LogLevel.Debug, `Starting Dachs`);
145
- this.queuedValue = pValue;
146
148
  this.client
147
149
  .setKeys({
148
150
  'Stromf_Ew.Anforderung_GLT.bAktiv': '1',
@@ -164,16 +166,6 @@ class Dachs {
164
166
  .catch((error) => {
165
167
  this.log(models_1.LogLevel.Error, `Error while turning on Dachs: ${error}`);
166
168
  });
167
- if (timeout !== undefined && timeout > -1 && !dontBlock) {
168
- this.blockAutomationHandler.disableAutomatic(timeout, models_1.CollisionSolving.overrideIfGreater);
169
- }
170
- }
171
- toggleActuator(_force) {
172
- if (!this._dachsOn) {
173
- this.setActuator(true);
174
- return true;
175
- }
176
- return false;
177
169
  }
178
170
  }
179
171
  exports.Dachs = Dachs;
@@ -1,5 +1,6 @@
1
1
  import { HmIpGriff } from '../hmIPDevices';
2
2
  import { WindowPosition } from '../models';
3
+ import { WindowRestoreDesiredPositionCommand, WindowSetDesiredPositionCommand } from '../../../models';
3
4
  import { iShutter, iVibrationSensor } from '../baseDeviceInterfaces';
4
5
  import { BaseGroup } from './base-group';
5
6
  import { ZigbeeMagnetContact } from '../zigbee';
@@ -12,9 +13,8 @@ export declare class Window extends BaseGroup {
12
13
  constructor(roomName: string, handleIds?: string[], vibrationIds?: string[], shutterIds?: string[], magnetIds?: string[]);
13
14
  /**
14
15
  * sets the desired Pos and moves rollo to this level
15
- * @param {number} value
16
16
  */
17
- setDesiredPosition(value: number): void;
17
+ setDesiredPosition(c: WindowSetDesiredPositionCommand): void;
18
18
  getHandle(): HmIpGriff[];
19
19
  getMagnetContact(): ZigbeeMagnetContact[];
20
20
  getShutter(): iShutter[];
@@ -22,5 +22,5 @@ export declare class Window extends BaseGroup {
22
22
  griffeInPosition(pPosition: WindowPosition): number;
23
23
  initialize(): void;
24
24
  rolloPositionChange(pValue: number): void;
25
- restoreDesiredPosition(): void;
25
+ restoreDesiredPosition(c: WindowRestoreDesiredPositionCommand): void;
26
26
  }