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
@@ -38,34 +38,13 @@ class ZigbeeLedRGBCCT extends zigbeeDimmer_1.ZigbeeDimmer {
38
38
  /**
39
39
  * @inheritDoc
40
40
  */
41
- setTimeBased(time, timeout = -1, force = false) {
42
- switch (time) {
43
- case models_1.TimeOfDay.Night:
44
- if (this.settings.nightOn) {
45
- this.setLight(true, timeout, force, this.settings.nightBrightness, undefined, this.settings.nightColor, this.settings.nightColorTemp);
46
- }
47
- break;
48
- case models_1.TimeOfDay.AfterSunset:
49
- if (this.settings.duskOn) {
50
- this.setLight(true, timeout, force, this.settings.duskBrightness, undefined, this.settings.duskColor, this.settings.duskColorTemp);
51
- }
52
- break;
53
- case models_1.TimeOfDay.BeforeSunrise:
54
- if (this.settings.dawnOn) {
55
- this.setLight(true, timeout, force, this.settings.dawnBrightness, undefined, this.settings.dawnColor, this.settings.dawnColorTemp);
56
- }
57
- break;
58
- case models_1.TimeOfDay.Daylight:
59
- if (this.settings.dayOn) {
60
- this.setLight(true, timeout, force, this.settings.dayBrightness, undefined, this.settings.dayColor, this.settings.dayColorTemp);
61
- }
62
- break;
63
- }
41
+ setTimeBased(c) {
42
+ this.setLight(models_1.LedSetLightCommand.byTimeBased(this.settings, c));
64
43
  }
65
44
  /**
66
45
  * @inheritDoc
67
46
  */
68
- setLight(pValue, timeout, force, brightness = -1, transitionTime, color = '', colorTemp = -1) {
47
+ setLight(c) {
69
48
  if (this._stateIdState === '') {
70
49
  this.log(models_1.LogLevel.Error, `Keine State ID bekannt.`);
71
50
  return;
@@ -74,18 +53,18 @@ class ZigbeeLedRGBCCT extends zigbeeDimmer_1.ZigbeeDimmer {
74
53
  this.log(models_1.LogLevel.Error, `Keine Connection bekannt.`);
75
54
  return;
76
55
  }
77
- if (pValue && brightness === -1 && this.brightness < 10) {
78
- brightness = 10;
56
+ if (c.on && c.brightness === -1 && this.brightness < 10) {
57
+ c.brightness = 10;
79
58
  }
80
- this.log(models_1.LogLevel.Debug, `LED Schalten An: ${pValue}\tHelligkeit: ${brightness}%\tFarbe: "${color}"\tColorTemperatur: ${colorTemp}\tTransition Time: ${transitionTime}`);
81
- const formattedColor = services_1.Utils.formatHex(color);
82
- if (formattedColor !== null && pValue) {
59
+ this.log(models_1.LogLevel.Debug, `LED Schalten An: ${c.on}\tHelligkeit: ${c.brightness}%\tFarbe: "${c.color}"\tColorTemperatur: ${c.colorTemp}\tTransition Time: ${c.transitionTime}`);
60
+ const formattedColor = services_1.Utils.formatHex(c.color);
61
+ if (formattedColor !== null && c.on) {
83
62
  this.setState(this._stateIdColor, formattedColor);
84
63
  }
85
- if (colorTemp > -1 && pValue) {
86
- this.setState(this._stateIdColorTemp, colorTemp);
64
+ if (c.colorTemp > -1 && c.on) {
65
+ this.setState(this._stateIdColorTemp, c.colorTemp);
87
66
  }
88
- super.setLight(pValue, timeout, force, brightness, transitionTime);
67
+ super.setLight(c);
89
68
  }
90
69
  }
91
70
  exports.ZigbeeLedRGBCCT = ZigbeeLedRGBCCT;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { DeviceType } from '../../deviceType';
3
- import { ShutterCalibration, ShutterSettings } from '../../../../models';
3
+ import { ShutterCalibration, ShutterSetLevelCommand, ShutterSettings } from '../../../../models';
4
4
  import { ZigbeeDevice } from './zigbeeDevice';
5
5
  import { iShutter } from '../../baseDeviceInterfaces';
6
6
  import { Window } from '../../groups';
@@ -23,7 +23,7 @@ export declare class ZigbeeShutter extends ZigbeeDevice implements iShutter {
23
23
  get desiredWindowShutterLevel(): number;
24
24
  persist(): void;
25
25
  update(idSplit: string[], state: ioBroker.State, initial?: boolean, pOverride?: boolean): void;
26
- setLevel(pPosition: number, initial?: boolean, skipOpenWarning?: boolean): void;
26
+ setLevel(c: ShutterSetLevelCommand): void;
27
27
  toJSON(): Partial<IoBrokerBaseDevice>;
28
28
  protected moveToPosition(pPosition: number): void;
29
29
  protected getAverageUp(): number;
@@ -32,7 +32,7 @@ class ZigbeeShutter extends zigbeeDevice_1.ZigbeeDevice {
32
32
  (_b = services_1.Utils.dbo) === null || _b === void 0 ? void 0 : _b.getLastDesiredPosition(this).then((val) => {
33
33
  var _a;
34
34
  if (val.desiredPosition >= -1) {
35
- (_a = this._window) === null || _a === void 0 ? void 0 : _a.setDesiredPosition(val.desiredPosition);
35
+ (_a = this._window) === null || _a === void 0 ? void 0 : _a.setDesiredPosition(new models_1.WindowSetDesiredPositionCommand(models_1.CommandSource.Automatic, val.desiredPosition, 'Found persisted last desired position in DB'));
36
36
  }
37
37
  });
38
38
  }
@@ -74,28 +74,30 @@ class ZigbeeShutter extends zigbeeDevice_1.ZigbeeDevice {
74
74
  update(idSplit, state, initial = false, pOverride = false) {
75
75
  super.update(idSplit, state, initial, pOverride);
76
76
  }
77
- setLevel(pPosition, initial = false, skipOpenWarning = false) {
78
- if (!this._firstCommandRecieved && !initial) {
77
+ setLevel(c) {
78
+ this.log(models_1.LogLevel.Debug, c.logMessage);
79
+ let pPosition = c.level;
80
+ if (!this._firstCommandRecieved && !c.isInitial) {
79
81
  this._firstCommandRecieved = true;
80
82
  }
81
- else if (this._firstCommandRecieved && initial) {
83
+ else if (this._firstCommandRecieved && c.isInitial) {
82
84
  this.log(models_1.LogLevel.Debug, `Skipped initial Rollo to ${pPosition} as we recieved a command already`);
83
85
  return;
84
86
  }
85
- if (this.currentLevel === pPosition) {
87
+ if (this.currentLevel === pPosition && !c.isForceAction) {
86
88
  this.log(models_1.LogLevel.Debug, `Skip Rollo command to Position ${pPosition} as this is the current one`, services_1.LogDebugType.SkipUnchangedRolloPosition);
87
89
  return;
88
90
  }
89
91
  if (this._window !== undefined) {
90
92
  if (this._window.griffeInPosition(models_2.WindowPosition.offen) > 0 && pPosition < 100) {
91
- if (!skipOpenWarning) {
93
+ if (!c.skipOpenWarning) {
92
94
  this.log(models_1.LogLevel.Alert, `Not closing the shutter, as the window is open!`);
93
95
  }
94
96
  return;
95
97
  }
96
98
  if (this._window.griffeInPosition(models_2.WindowPosition.kipp) > 0 && pPosition < 50) {
97
99
  pPosition = 50;
98
- if (!skipOpenWarning) {
100
+ if (!c.skipOpenWarning) {
99
101
  this.log(models_1.LogLevel.Alert, `Not closing the shutter, as the window is half open!`);
100
102
  }
101
103
  }
@@ -71,10 +71,10 @@ class ZigbeeBlitzShp extends BaseDevices_1.ZigbeeActuator {
71
71
  }
72
72
  turnOnForExcessEnergy() {
73
73
  this._activatedByExcessEnergy = true;
74
- this.setActuator(true);
74
+ this.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Automatic, true, 'Turn on for excess energy'));
75
75
  }
76
76
  turnOffDueToMissingEnergy() {
77
- this.setActuator(false);
77
+ this.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Automatic, false, 'Turn off due to missing energy'));
78
78
  }
79
79
  wasActivatedByExcessEnergy() {
80
80
  return this._activatedByExcessEnergy;
@@ -99,7 +99,7 @@ class ZigbeeHeimanSmoke extends BaseDevices_1.ZigbeeDevice {
99
99
  });
100
100
  services_1.Utils.guardedNewThread(() => {
101
101
  // Roll all Rollos up, to ensure free sight for firefighters
102
- services_1.RoomService.setAllRolloOfFloor(-1, 100);
102
+ services_1.RoomService.setAllShutterOfFloor(new models_1.FloorSetAllShuttersCommand(models_1.CommandSource.Force, 100, undefined, 'Fire alarm'));
103
103
  });
104
104
  }
105
105
  persistBatteryDevice() {
@@ -5,6 +5,4 @@ export declare class ZigbeeIlluActuator extends ZigbeeActuator {
5
5
  constructor(pInfo: IoBrokerDeviceInfo, deviceType?: DeviceType);
6
6
  get isActuatorOn(): boolean;
7
7
  update(idSplit: string[], state: ioBroker.State, initial?: boolean, handledByChildObject?: boolean): void;
8
- setActuator(pValue: boolean, timeout?: number, force?: boolean): void;
9
- toggleActuator(force?: boolean): boolean;
10
8
  }
@@ -17,11 +17,5 @@ class ZigbeeIlluActuator extends BaseDevices_1.ZigbeeActuator {
17
17
  }
18
18
  super.update(idSplit, state, initial, true);
19
19
  }
20
- setActuator(pValue, timeout = -1, force = false) {
21
- super.setActuator(pValue, timeout, force);
22
- }
23
- toggleActuator(force = false) {
24
- return super.toggleActuator(force);
25
- }
26
20
  }
27
21
  exports.ZigbeeIlluActuator = ZigbeeIlluActuator;
@@ -1,5 +1,5 @@
1
1
  import { ZigbeeIlluActuator } from './zigbeeIlluActuator';
2
- import { TimeOfDay } from '../../../models';
2
+ import { LampSetLightCommand, LampSetTimeBasedCommand, LampToggleLightCommand } from '../../../models';
3
3
  import { iLamp } from '../baseDeviceInterfaces';
4
4
  import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
5
5
  export declare class ZigbeeIlluLampe extends ZigbeeIlluActuator implements iLamp {
@@ -7,8 +7,8 @@ export declare class ZigbeeIlluLampe extends ZigbeeIlluActuator implements iLamp
7
7
  get lightOn(): boolean;
8
8
  update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
9
9
  /** @inheritdoc */
10
- setLight(pValue: boolean, timeout?: number, force?: boolean): void;
11
- toggleLight(time?: TimeOfDay, force?: boolean, calculateTime?: boolean): boolean;
12
- setTimeBased(time: TimeOfDay, timeout?: number, force?: boolean): void;
10
+ setLight(c: LampSetLightCommand): void;
11
+ toggleLight(c: LampToggleLightCommand): boolean;
12
+ setTimeBased(c: LampSetTimeBasedCommand): void;
13
13
  persist(): void;
14
14
  }
@@ -24,19 +24,14 @@ class ZigbeeIlluLampe extends zigbeeIlluActuator_1.ZigbeeIlluActuator {
24
24
  }
25
25
  }
26
26
  /** @inheritdoc */
27
- setLight(pValue, timeout = -1, force = false) {
28
- this.log(models_1.LogLevel.Debug, `Set Light Acutator to "${pValue}"`, services_1.LogDebugType.SetActuator);
29
- if (this.settings.isStromStoss && pValue) {
30
- timeout = 3000;
31
- sharedFunctions_1.LampUtils.stromStossOn(this);
32
- }
33
- super.setActuator(pValue, timeout, force);
27
+ setLight(c) {
28
+ super.setActuator(c);
34
29
  }
35
- toggleLight(time, force = false, calculateTime = false) {
36
- return sharedFunctions_1.LampUtils.toggleLight(this, time, force, calculateTime);
30
+ toggleLight(c) {
31
+ return sharedFunctions_1.LampUtils.toggleLight(this, c);
37
32
  }
38
- setTimeBased(time, timeout = -1, force = false) {
39
- sharedFunctions_1.LampUtils.setTimeBased(this, time, timeout, force);
33
+ setTimeBased(c) {
34
+ sharedFunctions_1.LampUtils.setTimeBased(this, c);
40
35
  }
41
36
  persist() {
42
37
  var _a;
@@ -13,8 +13,4 @@ export declare class ZigbeeInnr142C extends ZigbeeLedRGBCCT {
13
13
  protected readonly _stateNameColorTemp: string;
14
14
  protected readonly _debounceStateDelay: number;
15
15
  constructor(pInfo: IoBrokerDeviceInfo);
16
- /**
17
- * @inheritDoc
18
- */
19
- setLight(pValue: boolean, timeout?: number, force?: boolean, brightness?: number, transitionTime?: number, color?: string, colorTemp?: number): void;
20
16
  }
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ZigbeeInnr142C = void 0;
4
4
  const deviceType_1 = require("../deviceType");
5
5
  const BaseDevices_1 = require("./BaseDevices");
6
- const models_1 = require("../../../models");
7
- const services_1 = require("../../services");
8
6
  class ZigbeeInnr142C extends BaseDevices_1.ZigbeeLedRGBCCT {
9
7
  constructor(pInfo) {
10
8
  super(pInfo, deviceType_1.DeviceType.ZigbeeInnr142C);
@@ -20,36 +18,5 @@ class ZigbeeInnr142C extends BaseDevices_1.ZigbeeLedRGBCCT {
20
18
  this._stateIdState = `${this.info.fullID}.state`;
21
19
  this._stateIdTransitionTime = `${this.info.fullID}.transition_time`;
22
20
  }
23
- /**
24
- * @inheritDoc
25
- */
26
- setLight(pValue, timeout, force, brightness = -1, transitionTime, color = '', colorTemp = -1) {
27
- if (this._stateIdState === '') {
28
- this.log(models_1.LogLevel.Error, `Keine State ID bekannt.`);
29
- return;
30
- }
31
- if (!this.ioConn) {
32
- this.log(models_1.LogLevel.Error, `Keine Connection bekannt.`);
33
- return;
34
- }
35
- if (pValue && brightness === -1 && this.brightness < 10) {
36
- brightness = 10;
37
- }
38
- this.log(models_1.LogLevel.Debug, `LED Schalten An: ${pValue}\tHelligkeit: ${brightness}%\tFarbe: "${color}"\tColorTemperatur: ${colorTemp}\tTransition Time: ${transitionTime}`);
39
- if (this._lightOn !== pValue || this._brightness !== brightness) {
40
- super.setLight(pValue, timeout, force, brightness, transitionTime);
41
- }
42
- const formattedColor = services_1.Utils.formatHex(color);
43
- if (!pValue) {
44
- return;
45
- }
46
- // Farben nur beim Einschalten setzen
47
- if (formattedColor !== null && this.color !== formattedColor) {
48
- this.setState(this._stateIdColor, formattedColor);
49
- }
50
- if (colorTemp > -1 && this.colortemp !== colorTemp) {
51
- this.setState(this._stateIdColorTemp, colorTemp);
52
- }
53
- }
54
21
  }
55
22
  exports.ZigbeeInnr142C = ZigbeeInnr142C;
@@ -8,6 +8,4 @@ export declare class ZigbeeUbisysActuator extends ZigbeeActuator implements iLoa
8
8
  get isActuatorOn(): boolean;
9
9
  get loadPower(): number;
10
10
  update(idSplit: string[], state: ioBroker.State, initial?: boolean, handledByChildObject?: boolean): void;
11
- setActuator(pValue: boolean, timeout?: number, force?: boolean): void;
12
- toggleActuator(force?: boolean): boolean;
13
11
  }
@@ -30,11 +30,5 @@ class ZigbeeUbisysActuator extends BaseDevices_1.ZigbeeActuator {
30
30
  }
31
31
  super.update(idSplit, state, initial, true);
32
32
  }
33
- setActuator(pValue, timeout = -1, force = false) {
34
- super.setActuator(pValue, timeout, force);
35
- }
36
- toggleActuator(force = false) {
37
- return super.toggleActuator(force);
38
- }
39
33
  }
40
34
  exports.ZigbeeUbisysActuator = ZigbeeUbisysActuator;
@@ -1,4 +1,4 @@
1
- import { TimeOfDay } from '../../../models';
1
+ import { LampSetLightCommand, LampSetTimeBasedCommand, LampToggleLightCommand } from '../../../models';
2
2
  import { iLamp } from '../baseDeviceInterfaces';
3
3
  import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
4
4
  import { ZigbeeUbisysActuator } from './zigbeeUbisysActuator';
@@ -7,8 +7,8 @@ export declare class ZigbeeUbisysLampe extends ZigbeeUbisysActuator implements i
7
7
  get lightOn(): boolean;
8
8
  update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
9
9
  /** @inheritdoc */
10
- setLight(pValue: boolean, timeout?: number, force?: boolean): void;
11
- toggleLight(time?: TimeOfDay, force?: boolean, calculateTime?: boolean): boolean;
12
- setTimeBased(time: TimeOfDay, timeout?: number, force?: boolean): void;
10
+ setLight(c: LampSetLightCommand): void;
11
+ toggleLight(c: LampToggleLightCommand): boolean;
12
+ setTimeBased(c: LampSetTimeBasedCommand): void;
13
13
  persist(): void;
14
14
  }
@@ -24,19 +24,14 @@ class ZigbeeUbisysLampe extends zigbeeUbisysActuator_1.ZigbeeUbisysActuator {
24
24
  }
25
25
  }
26
26
  /** @inheritdoc */
27
- setLight(pValue, timeout = -1, force = false) {
28
- this.log(models_1.LogLevel.Debug, `Set Light Acutator to "${pValue}"`, services_1.LogDebugType.SetActuator);
29
- if (this.settings.isStromStoss && pValue) {
30
- timeout = 3000;
31
- sharedFunctions_1.LampUtils.stromStossOn(this);
32
- }
33
- super.setActuator(pValue, timeout, force);
27
+ setLight(c) {
28
+ super.setActuator(c);
34
29
  }
35
- toggleLight(time, force = false, calculateTime = false) {
36
- return sharedFunctions_1.LampUtils.toggleLight(this, time, force, calculateTime);
30
+ toggleLight(c) {
31
+ return sharedFunctions_1.LampUtils.toggleLight(this, c);
37
32
  }
38
- setTimeBased(time, timeout = -1, force = false) {
39
- sharedFunctions_1.LampUtils.setTimeBased(this, time, timeout, force);
33
+ setTimeBased(c) {
34
+ sharedFunctions_1.LampUtils.setTimeBased(this, c);
40
35
  }
41
36
  persist() {
42
37
  var _a;
@@ -1,13 +1,8 @@
1
1
  import { iShutter, Window } from '../devices';
2
+ import { ShutterSetLevelCommand } from '../../models';
2
3
  export declare class ShutterService {
3
4
  static anyRolloDown(rollo: iShutter[]): boolean;
4
5
  static getRolladenPosition(): string;
5
6
  static getAllRollos(): iShutter[];
6
- static down(shutter: iShutter, initial?: boolean): void;
7
- static middle(shutter: iShutter): void;
8
- static up(shutter: iShutter, initial?: boolean): void;
9
- static windowAllDown(f: Window, initial?: boolean): void;
10
- static windowAllMiddle(f: Window, initial?: boolean): void;
11
- static windowAllUp(f: Window, initial?: boolean): void;
12
- static windowAllToPosition(f: Window, position: number, initial?: boolean, skipOpenWarning?: boolean): void;
7
+ static windowAllToPosition(f: Window, c: ShutterSetLevelCommand): void;
13
8
  }
@@ -52,33 +52,9 @@ class ShutterService {
52
52
  }
53
53
  return rollos;
54
54
  }
55
- static down(shutter, initial = false) {
56
- shutter.setLevel(0, initial);
57
- }
58
- static middle(shutter) {
59
- shutter.setLevel(50, false);
60
- }
61
- static up(shutter, initial = false) {
62
- shutter.setLevel(100, initial);
63
- }
64
- static windowAllDown(f, initial = false) {
65
- f.getShutter().forEach((s) => {
66
- s.setLevel(0, initial);
67
- });
68
- }
69
- static windowAllMiddle(f, initial = false) {
70
- f.getShutter().forEach((s) => {
71
- s.setLevel(50, initial);
72
- });
73
- }
74
- static windowAllUp(f, initial = false) {
75
- f.getShutter().forEach((s) => {
76
- s.setLevel(100, initial);
77
- });
78
- }
79
- static windowAllToPosition(f, position, initial = false, skipOpenWarning = false) {
55
+ static windowAllToPosition(f, c) {
80
56
  f.getShutter().forEach((s) => {
81
- s.setLevel(position, initial, skipOpenWarning);
57
+ s.setLevel(c);
82
58
  });
83
59
  }
84
60
  }
@@ -6,6 +6,7 @@ const telegramMessageCalback_1 = require("./telegramMessageCalback");
6
6
  const ShutterService_1 = require("../ShutterService");
7
7
  const telegram_service_1 = require("./telegram-service");
8
8
  const room_service_1 = require("../room-service");
9
+ const models_1 = require("../../../models");
9
10
  class TelegramCommands {
10
11
  static initialize() {
11
12
  telegram_service_1.TelegramService.addMessageCallback(new telegramMessageCalback_1.TelegramMessageCallback('AlarmStop', /\/stop_alarm/, async (m) => {
@@ -81,7 +82,7 @@ class TelegramCommands {
81
82
  telegram_service_1.TelegramService.addMessageCallback(new telegramMessageCalback_1.TelegramMessageCallback('AllRolloDown', /\/all_rollo_down/, async (m) => {
82
83
  if (m.from === undefined)
83
84
  return false;
84
- room_service_1.RoomService.setAllRolloOfFloor(-1, 0);
85
+ room_service_1.RoomService.setAllShutterOfFloor(new models_1.FloorSetAllShuttersCommand(models_1.CommandSource.Manual, 0, undefined, 'Telegram command AllRolloDown'));
85
86
  telegram_service_1.TelegramService.sendMessage([m.chat.id], `Es werden alle Rollos heruntergefahren`);
86
87
  return true;
87
88
  }, `Fährt alle rollos runter`));
@@ -12,7 +12,7 @@ export declare class DaikinService {
12
12
  static getDevice(name: string): DaikinAC | undefined;
13
13
  static initialize(): Promise<void>;
14
14
  static setAll(on: boolean, force?: boolean): void;
15
- static reconnect(name: string, ip: string): Promise<DaikinAC | undefined>;
15
+ static reconnect(name: string, ip: string, mac?: string): Promise<DaikinAC | undefined>;
16
16
  private static reconstructDaikinAc;
17
17
  private static initializeDevice;
18
18
  }
@@ -85,13 +85,18 @@ class DaikinService {
85
85
  }
86
86
  }
87
87
  }
88
- static async reconnect(name, ip) {
88
+ static async reconnect(name, ip, mac) {
89
89
  log_service_1.ServerLogService.writeLog(models_1.LogLevel.Debug, `Reconnecting Daikin AC "${name}"`);
90
90
  const router = network_1.Router.getRouter();
91
91
  if (router === undefined) {
92
92
  return this.reconstructDaikinAc(ip, name);
93
93
  }
94
- await router.reconnectDeviceByIp(ip);
94
+ if (mac !== undefined) {
95
+ await router.reconnectDeviceByMac(mac);
96
+ }
97
+ else {
98
+ await router.reconnectDeviceByIp(ip);
99
+ }
95
100
  await utils_1.Utils.delay(5000);
96
101
  return this.reconstructDaikinAc(ip, name);
97
102
  }
@@ -3,13 +3,14 @@ import { AcDevice } from './ac-device';
3
3
  import { AcMode } from './ac-mode';
4
4
  import { DeviceType } from '../../devices';
5
5
  export declare class OwnDaikinDevice extends AcDevice {
6
+ private _device;
7
+ private _mac;
6
8
  desiredState: boolean;
7
9
  desiredHum: number | 'AUTO';
8
10
  desiredMode: number;
9
11
  deviceType: DeviceType;
10
12
  private _on;
11
- constructor(name: string, roomName: string, ip: string, device: DaikinAC | undefined);
12
- private _device;
13
+ constructor(name: string, roomName: string, ip: string, _device: DaikinAC | undefined, _mac?: string | undefined);
13
14
  get device(): DaikinAC | undefined;
14
15
  get on(): boolean;
15
16
  set device(device: DaikinAC | undefined);
@@ -16,14 +16,15 @@ const acDeviceType_1 = require("./acDeviceType");
16
16
  const devices_1 = require("../../devices");
17
17
  const lodash_1 = __importDefault(require("lodash"));
18
18
  class OwnDaikinDevice extends ac_device_1.AcDevice {
19
- constructor(name, roomName, ip, device) {
19
+ constructor(name, roomName, ip, _device, _mac = undefined) {
20
20
  super(name, roomName, ip, acDeviceType_1.AcDeviceType.Daikin);
21
+ this._device = _device;
22
+ this._mac = _mac;
21
23
  this.desiredState = daikin_controller_1.Power.OFF;
22
24
  this.desiredHum = 'AUTO';
23
25
  this.desiredMode = daikin_controller_1.Mode.COLD;
24
26
  this.deviceType = devices_1.DeviceType.Daikin;
25
27
  this._on = false;
26
- this._device = device;
27
28
  }
28
29
  get device() {
29
30
  return this._device;
@@ -138,7 +139,7 @@ class OwnDaikinDevice extends ac_device_1.AcDevice {
138
139
  }
139
140
  handleDeviceUnreach() {
140
141
  this.log(models_1.LogLevel.Warn, `Detected EHOSTUNREACH for ${this.name}(${this.ip}), will try reconecting`);
141
- daikin_service_1.DaikinService.reconnect(this.name, this.ip)
142
+ daikin_service_1.DaikinService.reconnect(this.name, this.ip, this._mac)
142
143
  .then((device) => {
143
144
  this.device = device;
144
145
  utils_1.Utils.guardedTimeout(() => {
@@ -121,7 +121,7 @@ class API {
121
121
  return new Error(`Device with ID ${deviceId} is no Lamp`);
122
122
  }
123
123
  d.log(models_1.LogLevel.Info, `API Call to set Lamp to ${state} for ${timeout}ms`);
124
- d.setLight(state, timeout, true);
124
+ d.setLight(new models_1.LampSetLightCommand(models_1.CommandSource.API, state, '', timeout));
125
125
  return null;
126
126
  }
127
127
  /**
@@ -140,7 +140,7 @@ class API {
140
140
  return new Error(`Device with ID ${deviceId} is no actuator`);
141
141
  }
142
142
  d.log(models_1.LogLevel.Info, `API Call to set Actuator to ${state} for ${timeout}ms`);
143
- d.setActuator(state, timeout, true);
143
+ d.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.API, state, '', timeout));
144
144
  return null;
145
145
  }
146
146
  /**
@@ -161,7 +161,7 @@ class API {
161
161
  return new Error(`Device with ID ${deviceId} is no dimmablelamp`);
162
162
  }
163
163
  d.log(models_1.LogLevel.Info, `API Call to set Dimmer to ${state} with brightness ${brightness} for ${timeout}ms`);
164
- d.setLight(state, timeout, true, brightness, transitionTime);
164
+ d.setLight(new models_1.DimmerSetLightCommand(models_1.CommandSource.API, state, '', timeout, brightness, transitionTime));
165
165
  return null;
166
166
  }
167
167
  /**
@@ -184,7 +184,7 @@ class API {
184
184
  return new Error(`Device with ID ${deviceId} is no dimmablelamp`);
185
185
  }
186
186
  d.log(models_1.LogLevel.Info, `API Call to set LED to ${state} with brightness ${brightness} and color ${color} for ${timeout}ms`);
187
- d.setLight(state, timeout, true, brightness, transitionTime, color, colorTemp);
187
+ d.setLight(new models_1.LedSetLightCommand(models_1.CommandSource.API, state, '', timeout, brightness, transitionTime, color, colorTemp));
188
188
  return null;
189
189
  }
190
190
  /**
@@ -204,10 +204,10 @@ class API {
204
204
  }
205
205
  if (d.window) {
206
206
  // otherwise it will be overridden shortly after
207
- d.window.setDesiredPosition(level);
207
+ d.window.setDesiredPosition(new models_1.WindowSetDesiredPositionCommand(models_1.CommandSource.API, level));
208
208
  }
209
209
  else {
210
- d.setLevel(level, false);
210
+ d.setLevel(new models_1.ShutterSetLevelCommand(models_1.CommandSource.API, level));
211
211
  }
212
212
  d.log(models_1.LogLevel.Info, `API Call to set Shutter to ${level}`);
213
213
  return null;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
- import { CollisionSolving } from '../../models';
2
+ import { CollisionSolving, RestoreTargetAutomaticValueCommand } from '../../models';
3
3
  export declare class BlockAutomaticHandler {
4
4
  private readonly _restoreAutomatic;
5
- constructor(restoreAutomaticCb: () => void);
5
+ constructor(restoreAutomaticCb: (c: RestoreTargetAutomaticValueCommand) => void);
6
6
  private _automaticBlockedUntil;
7
7
  get automaticBlockedUntil(): Date;
8
8
  private set automaticBlockedUntil(value);
@@ -36,16 +36,18 @@ class BlockAutomaticHandler {
36
36
  (onCollideAction != models_1.CollisionSolving.overrideIfGreater || targetDate < this._automaticBlockedUntil)) {
37
37
  return;
38
38
  }
39
- this._automaticBlockedUntil = targetDate;
39
+ this.automaticBlockedUntil = targetDate;
40
40
  }
41
41
  liftAutomaticBlock() {
42
- this._automaticBlockedUntil = new Date(0);
42
+ this.automaticBlockedUntil = new Date(0);
43
43
  }
44
44
  updateRestoreTimeout() {
45
45
  if (this._restoreAutomaticStateTimeout !== null) {
46
46
  clearTimeout(this._restoreAutomaticStateTimeout);
47
47
  }
48
- this._restoreAutomaticStateTimeout = utils_1.Utils.guardedTimeout(this._restoreAutomatic, this._automaticBlockedUntil.getTime() - utils_1.Utils.nowMS() + 500, this);
48
+ this._restoreAutomaticStateTimeout = utils_1.Utils.guardedTimeout(() => {
49
+ this._restoreAutomatic(new models_1.RestoreTargetAutomaticValueCommand(models_1.CommandSource.Unknown, 'Automatic block restore timeout'));
50
+ }, this._automaticBlockedUntil.getTime() - utils_1.Utils.nowMS() + 500, this);
49
51
  }
50
52
  toJSON() {
51
53
  return utils_1.Utils.jsonFilter(lodash_1.default.omit(this, ['_restoreAutomatic']));
@@ -1,5 +1,5 @@
1
1
  import { DeviceInfo, DeviceType, iTemporaryDisableAutomatic } from '../../devices';
2
- import { LedSettings, LogLevel, RoomBase, TimeOfDay } from '../../../models';
2
+ import { ActuatorSetStateCommand, ActuatorToggleCommand, ActuatorWriteStateToDeviceCommand, LampSetTimeBasedCommand, LampToggleLightCommand, LedSetLightCommand, LedSettings, LogLevel, RestoreTargetAutomaticValueCommand, RoomBase } from '../../../models';
3
3
  import { LogDebugType } from '../log-service';
4
4
  import { DeviceCapability } from '../../devices/DeviceCapability';
5
5
  import { iLedRgbCct } from '../../devices/baseDeviceInterfaces/iLedRgbCct';
@@ -39,16 +39,17 @@ export declare class OwnGoveeDevice implements iLedRgbCct, iTemporaryDisableAuto
39
39
  /**
40
40
  * @inheritDoc
41
41
  */
42
- setTimeBased(time: TimeOfDay, timeout?: number, force?: boolean): void;
42
+ setTimeBased(c: LampSetTimeBasedCommand): void;
43
43
  /**
44
44
  * @inheritDoc
45
45
  */
46
- setLight(pValue: boolean, timeout?: number, force?: boolean, brightness?: number, _transitionTime?: number, color?: string, colorTemp?: number): void;
47
- setActuator(pValue: boolean, timeout?: number, force?: boolean): void;
48
- restoreTargetAutomaticValue(): void;
46
+ setLight(c: LedSetLightCommand): void;
47
+ setActuator(c: ActuatorSetStateCommand): void;
48
+ restoreTargetAutomaticValue(c: RestoreTargetAutomaticValueCommand): void;
49
49
  persist(): void;
50
- toggleActuator(_force: boolean): boolean;
51
- toggleLight(time?: TimeOfDay, _force?: boolean, calculateTime?: boolean): boolean;
50
+ toggleActuator(c: ActuatorToggleCommand): boolean;
51
+ toggleLight(c: LampToggleLightCommand): boolean;
52
+ writeActuatorStateToDevice(c: ActuatorWriteStateToDeviceCommand): void;
52
53
  update(data: GoveeDeviceState & GoveeDeviceStateInfo): void;
53
54
  private setBrightness;
54
55
  private setColor;