hoffmation-base 3.0.0-alpha.1 → 3.0.0-alpha.10

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 (27) hide show
  1. package/lib/models/command/ShutterSetLevelCommand.js +1 -1
  2. package/lib/models/command/actuatorSetStateCommand.js +2 -2
  3. package/lib/models/command/actuatorToggleCommand.js +1 -1
  4. package/lib/models/command/actuatorWriteStateToDeviceCommand.d.ts +1 -1
  5. package/lib/models/command/actuatorWriteStateToDeviceCommand.js +2 -2
  6. package/lib/models/command/baseCommand.js +4 -7
  7. package/lib/models/command/dimmerSetLightCommand.js +1 -1
  8. package/lib/models/command/lampSetLightCommand.js +1 -1
  9. package/lib/models/command/lampSetTimeBasedCommand.js +1 -1
  10. package/lib/models/command/lampToggleLightCommand.js +1 -1
  11. package/lib/models/command/ledSetLightCommand.js +1 -1
  12. package/lib/models/command/restoreTargetAutomaticValueCommand.js +1 -1
  13. package/lib/models/rooms/RoomBase.js +2 -2
  14. package/lib/server/devices/groups/lightGroup.js +3 -3
  15. package/lib/server/devices/hmIPDevices/hmIpLampe.js +1 -2
  16. package/lib/server/devices/hmIPDevices/hmIpRoll.js +2 -2
  17. package/lib/server/devices/sharedFunctions/lampUtils.js +4 -6
  18. package/lib/server/devices/wledDevice.js +2 -3
  19. package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.js +1 -2
  20. package/lib/server/devices/zigbee/BaseDevices/zigbeeDevice.js +8 -6
  21. package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +7 -7
  22. package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.d.ts +2 -1
  23. package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.js +3 -1
  24. package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +3 -3
  25. package/lib/server/services/govee/own-govee-device.js +2 -5
  26. package/lib/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +1 -1
@@ -11,7 +11,7 @@ class ShutterSetLevelCommand extends baseCommand_1.BaseCommand {
11
11
  this._commandType = commandType_1.CommandType.ShutterSetLevelCommand;
12
12
  }
13
13
  get logMessage() {
14
- return `Shutter setLevel to ${this.level} from ${this.source} for reason: ${this.reasonTrace}`;
14
+ return `Shutter setLevel to ${this.level} for reason: ${this.reasonTrace}`;
15
15
  }
16
16
  }
17
17
  exports.ShutterSetLevelCommand = ShutterSetLevelCommand;
@@ -8,10 +8,10 @@ class ActuatorSetStateCommand extends baseCommand_1.BaseCommand {
8
8
  super(source, reason);
9
9
  this.on = on;
10
10
  this.timeout = timeout;
11
- this._commandType = commandType_1.CommandType.ShutterSetLevelCommand;
11
+ this._commandType = commandType_1.CommandType.ActuatorSetStateCommand;
12
12
  }
13
13
  get logMessage() {
14
- return `Actuator setState to ${this.on} from ${this.source} for reason: ${this.reasonTrace}`;
14
+ return `Actuator setState to ${this.on} for reason: ${this.reasonTrace}`;
15
15
  }
16
16
  static byActuatorAndToggleCommand(device, c) {
17
17
  const newVal = device.queuedValue !== null ? !device.queuedValue : !device.actuatorOn;
@@ -9,7 +9,7 @@ class ActuatorToggleCommand extends baseCommand_1.BaseCommand {
9
9
  this._commandType = commandType_1.CommandType.ActuatorToggleCommand;
10
10
  }
11
11
  get logMessage() {
12
- return `Actuator toggle due to ${this.source} for reason: ${this.reasonTrace}`;
12
+ return `Actuator toggle for reason: ${this.reasonTrace}`;
13
13
  }
14
14
  }
15
15
  exports.ActuatorToggleCommand = ActuatorToggleCommand;
@@ -4,6 +4,6 @@ import { CommandSource } from './commandSource';
4
4
  export declare class ActuatorWriteStateToDeviceCommand extends BaseCommand {
5
5
  readonly stateValue: boolean;
6
6
  _commandType: CommandType;
7
- constructor(stateValue: boolean, source: CommandSource | BaseCommand, reason?: string);
7
+ constructor(source: CommandSource | BaseCommand, stateValue: boolean, reason?: string);
8
8
  get logMessage(): string;
9
9
  }
@@ -4,13 +4,13 @@ exports.ActuatorWriteStateToDeviceCommand = void 0;
4
4
  const baseCommand_1 = require("./baseCommand");
5
5
  const commandType_1 = require("./commandType");
6
6
  class ActuatorWriteStateToDeviceCommand extends baseCommand_1.BaseCommand {
7
- constructor(stateValue, source, reason = '') {
7
+ constructor(source, stateValue, reason = '') {
8
8
  super(source, reason);
9
9
  this.stateValue = stateValue;
10
10
  this._commandType = commandType_1.CommandType.ActuatorWriteStateToDeviceCommand;
11
11
  }
12
12
  get logMessage() {
13
- return `Actuator writeStateToDevice(${this.stateValue}) due to ${this.source} for reason: ${this.reasonTrace}`;
13
+ return `Actuator writeStateToDevice(${this.stateValue}) for reason: ${this.reasonTrace}`;
14
14
  }
15
15
  }
16
16
  exports.ActuatorWriteStateToDeviceCommand = ActuatorWriteStateToDeviceCommand;
@@ -21,14 +21,11 @@ class BaseCommand {
21
21
  return this.source === commandSource_1.CommandSource.Initial;
22
22
  }
23
23
  get reasonTrace() {
24
- let reason = '';
25
- if (this.source instanceof BaseCommand) {
26
- reason = this.source.reasonTrace;
27
- }
28
- if (this.reason === '') {
29
- return `${reason} -> ${this._commandType}`;
24
+ const ownPart = this.reason !== '' ? `${this._commandType}("${this.reason}")` : `${this._commandType}`;
25
+ if (typeof this.source === 'object') {
26
+ return `${this.source.reasonTrace} -> ${ownPart}`;
30
27
  }
31
- return `${reason} -> ${this._commandType}(${this.reason})`;
28
+ return `CommandType("${commandSource_1.CommandSource[this.source]}") stack => ${ownPart}`;
32
29
  }
33
30
  }
34
31
  exports.BaseCommand = BaseCommand;
@@ -20,7 +20,7 @@ class DimmerSetLightCommand extends lampSetLightCommand_1.LampSetLightCommand {
20
20
  this._commandType = commandType_1.CommandType.DimmerSetLightCommand;
21
21
  }
22
22
  get logMessage() {
23
- return `Dimmer setLight to ${this.on} from ${this.source} for reason: ${this.reasonTrace}`;
23
+ return `Dimmer setLight to ${this.on} for reason: ${this.reasonTrace}`;
24
24
  }
25
25
  static byTimeBased(s, c) {
26
26
  switch (c.time) {
@@ -9,7 +9,7 @@ class LampSetLightCommand extends actuatorSetStateCommand_1.ActuatorSetStateComm
9
9
  this._commandType = commandType_1.CommandType.LampSetLightCommand;
10
10
  }
11
11
  get logMessage() {
12
- return `Lamp setLight to ${this.on} from ${this.source} for reason: ${this.reasonTrace}`;
12
+ return `Lamp setLight to ${this.on} for reason: ${this.reasonTrace}`;
13
13
  }
14
14
  }
15
15
  exports.LampSetLightCommand = LampSetLightCommand;
@@ -19,7 +19,7 @@ class LampSetTimeBasedCommand extends baseCommand_1.BaseCommand {
19
19
  this._commandType = commandType_1.CommandType.LampSetTimeBasedCommand;
20
20
  }
21
21
  get logMessage() {
22
- return `Lamp setTimeBased to ${timeCallback_1.TimeOfDay[this.time]} from ${this.source}`;
22
+ return `Lamp setTimeBased to ${timeCallback_1.TimeOfDay[this.time]} for reason: ${this.reasonTrace}`;
23
23
  }
24
24
  }
25
25
  exports.LampSetTimeBasedCommand = LampSetTimeBasedCommand;
@@ -18,7 +18,7 @@ class LampToggleLightCommand extends actuatorToggleCommand_1.ActuatorToggleComma
18
18
  this._commandType = commandType_1.CommandType.LampToggleLightCommand;
19
19
  }
20
20
  get logMessage() {
21
- return `Lamp toggleLight from ${this.source} for reason: ${this.reasonTrace}`;
21
+ return `Lamp toggleLight for reason: ${this.reasonTrace}`;
22
22
  }
23
23
  }
24
24
  exports.LampToggleLightCommand = LampToggleLightCommand;
@@ -23,7 +23,7 @@ class LedSetLightCommand extends dimmerSetLightCommand_1.DimmerSetLightCommand {
23
23
  this._commandType = commandType_1.CommandType.LedSetLightCommand;
24
24
  }
25
25
  get logMessage() {
26
- return `Led setLight to ${this.on} from ${this.source} for reason: ${this.reasonTrace}`;
26
+ return `Led setLight to state: ${this.on}, timeout: ${this.timeout}, brightness: ${this.brightness}, color: ${this.color}, colorTemp: ${this.colorTemp} for reason: ${this.reasonTrace}`;
27
27
  }
28
28
  static byTimeBased(settings, c) {
29
29
  switch (c.time) {
@@ -9,7 +9,7 @@ class RestoreTargetAutomaticValueCommand extends baseCommand_1.BaseCommand {
9
9
  this._commandType = commandType_1.CommandType.ActuatorRestoreTargetAutomaticValueCommand;
10
10
  }
11
11
  get logMessage() {
12
- return `Actuator restore target automatic value from ${this.source} for reason: ${this.reasonTrace}`;
12
+ return `Actuator restore target automatic value due to reason: ${this.reasonTrace}`;
13
13
  }
14
14
  }
15
15
  exports.RestoreTargetAutomaticValueCommand = RestoreTargetAutomaticValueCommand;
@@ -115,7 +115,7 @@ class RoomBase {
115
115
  }
116
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(new command_1.ActuatorSetStateCommand(c, false, 'Room.setLightTimeBased but no one is present'));
118
+ this.LightGroup.switchAll(new command_1.ActuatorSetStateCommand(c, false, 'No one is present --> Turn off lights.'));
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(new command_1.LightGroupSwitchTimeConditionalCommand(c, timeOfDay, 'Roombase.setLightTimeBased'));
135
+ this.LightGroup.switchTimeConditional(new command_1.LightGroupSwitchTimeConditionalCommand(c, timeOfDay));
136
136
  }
137
137
  isNowLightTime() {
138
138
  var _a;
@@ -106,16 +106,16 @@ class LightGroup extends base_group_1.BaseGroup {
106
106
  resultLampen = darkOutside;
107
107
  }
108
108
  if (resultLampen) {
109
- this.setAllLampenTimeBased(new models_1.LampSetTimeBasedCommand(models_1.CommandSource.Automatic, c.time, 'LightGroup switchTimeConditional'));
109
+ this.setAllLampenTimeBased(new models_1.LampSetTimeBasedCommand(c, c.time, 'LightGroup switchTimeConditional'));
110
110
  }
111
111
  else {
112
- this.setAllLampen(new models_1.LampSetLightCommand(models_1.CommandSource.Automatic, false, 'LightGroup switchTimeConditional --> off'));
112
+ this.setAllLampen(new models_1.LampSetLightCommand(c, false, 'LightGroup switchTimeConditional --> off'));
113
113
  }
114
114
  if (resultSteckdosen) {
115
115
  this.setAllActuatorsTimeBased(c.time);
116
116
  }
117
117
  else {
118
- this.setAllOutlets(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Automatic, false, 'LightGroup switchTimeConditional --> off'));
118
+ this.setAllOutlets(new models_1.ActuatorSetStateCommand(c, false, 'LightGroup switchTimeConditional --> off'));
119
119
  }
120
120
  }
121
121
  setAllLampen(c) {
@@ -25,8 +25,7 @@ class HmIpLampe extends hmIpDevice_1.HmIPDevice {
25
25
  return this.lightOn;
26
26
  }
27
27
  restoreTargetAutomaticValue(c) {
28
- this.log(models_1.LogLevel.Debug, c.logMessage);
29
- this.setLight(new models_1.LampSetLightCommand(c, this.targetAutomaticState, 'Lampen RestoreTargetAutomaticValue'));
28
+ this.setLight(new models_1.LampSetLightCommand(c, this.targetAutomaticState));
30
29
  }
31
30
  update(idSplit, state, initial = false) {
32
31
  this.log(models_1.LogLevel.DeepTrace, `Lampen Update : ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
@@ -77,7 +77,6 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
77
77
  }
78
78
  }
79
79
  setLevel(command) {
80
- this.log(models_2.LogLevel.Debug, command.logMessage);
81
80
  let targetLevel = command.level;
82
81
  if (!this._firstCommandRecieved && !command.isInitial) {
83
82
  this._firstCommandRecieved = true;
@@ -87,7 +86,7 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
87
86
  return;
88
87
  }
89
88
  if (this.currentLevel === targetLevel && !command.isForceAction) {
90
- this.log(models_2.LogLevel.Debug, `Skip Rollo command to Position ${targetLevel} as this is the current one`, services_1.LogDebugType.SkipUnchangedRolloPosition);
89
+ this.log(models_2.LogLevel.Debug, `Skip Rollo command to Position ${targetLevel} as this is the current one, commandLog: ${command.logMessage}`, services_1.LogDebugType.SkipUnchangedRolloPosition);
91
90
  return;
92
91
  }
93
92
  if (this._setLevelSwitchID === '') {
@@ -97,6 +96,7 @@ class HmIpRoll extends hmIpDevice_1.HmIPDevice {
97
96
  if (!this.checkIoConnection(true)) {
98
97
  return;
99
98
  }
99
+ this.log(models_2.LogLevel.Debug, command.logMessage);
100
100
  if (this._window !== undefined) {
101
101
  if (this._window.griffeInPosition(models_1.WindowPosition.offen) > 0 && command.level < 100) {
102
102
  if (!command.skipOpenWarning) {
@@ -50,7 +50,7 @@ class LampUtils {
50
50
  }
51
51
  static checkBlockActive(device, c) {
52
52
  if (!c.isForceAction && device.blockAutomationHandler.automaticBlockActive) {
53
- device.log(models_1.LogLevel.Debug, `Skip automatic command to ${c.on} as it is locked until ${new Date(device.blockAutomationHandler.automaticBlockedUntil).toLocaleTimeString()}`);
53
+ device.log(models_1.LogLevel.Debug, `Skip command to ${c.on} as it is locked until ${new Date(device.blockAutomationHandler.automaticBlockedUntil).toLocaleTimeString()}; command Log: ${c.logMessage}`);
54
54
  device.targetAutomaticState = c.on;
55
55
  return true;
56
56
  }
@@ -64,6 +64,7 @@ class LampUtils {
64
64
  return false;
65
65
  }
66
66
  static setActuator(device, c) {
67
+ const dontBlock = LampUtils.checkUnBlock(device, c);
67
68
  if (LampUtils.checkBlockActive(device, c)) {
68
69
  return;
69
70
  }
@@ -71,15 +72,12 @@ class LampUtils {
71
72
  return;
72
73
  }
73
74
  device.queuedValue = c.on;
74
- device.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c.on, c));
75
+ device.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c, c.on));
75
76
  if (device.settings.isStromStoss && c.on) {
76
77
  c.timeout = 3000;
77
78
  LampUtils.stromStossOn(device);
78
79
  }
79
- if (c.timeout < 0 || !c.on) {
80
- return;
81
- }
82
- if (c.timeout > -1 && device.blockAutomationHandler !== undefined) {
80
+ if (c.timeout > -1 && !dontBlock) {
83
81
  device.blockAutomationHandler.disableAutomatic(c.timeout, models_1.CollisionSolving.overrideIfGreater);
84
82
  }
85
83
  }
@@ -28,8 +28,7 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
28
28
  return this.on;
29
29
  }
30
30
  restoreTargetAutomaticValue(c) {
31
- this.log(models_1.LogLevel.Debug, c.logMessage);
32
- this.setLight(new models_1.WledSetLightCommand(c, this.targetAutomaticState, 'Lampen RestoreTargetAutomaticValue'));
31
+ this.setLight(new models_1.WledSetLightCommand(c, this.targetAutomaticState));
33
32
  }
34
33
  update(idSplit, state, initial = false, _pOverride = false) {
35
34
  this.queuedValue = null;
@@ -65,7 +64,7 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
65
64
  }
66
65
  services_1.ServerLogService.writeLog(models_1.LogLevel.Debug, `WLED Schalten: "${this.info.customName}" An: ${c.on}\tHelligkeit: ${c.brightness}%`);
67
66
  this.queuedValue = c.on;
68
- this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c.on, c, 'WLED Schalten'));
67
+ this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c, c.on, 'WLED Schalten'));
69
68
  if (c.preset !== undefined) {
70
69
  this.setState(this._presetID, c.preset, undefined, (err) => {
71
70
  services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `WLED schalten ergab Fehler: ${err}`);
@@ -23,8 +23,7 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
23
23
  this.blockAutomationHandler = new blockAutomaticHandler_1.BlockAutomaticHandler(this.restoreTargetAutomaticValue.bind(this));
24
24
  }
25
25
  restoreTargetAutomaticValue(c) {
26
- this.log(models_1.LogLevel.Debug, `Restore Target Automatic value`);
27
- this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState, 'Restore Target Automatic value'));
26
+ this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState));
28
27
  }
29
28
  update(idSplit, state, initial = false, handledByChildObject = false) {
30
29
  if (!handledByChildObject) {
@@ -40,16 +40,18 @@ class ZigbeeDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
40
40
  }
41
41
  switch (idSplit[3]) {
42
42
  case 'available':
43
- this._available = state.val;
44
- if (!this._available) {
45
- this.log(models_1.LogLevel.Debug, `Das Zigbee Gerät ist nicht erreichbar.`);
43
+ const newAvailability = state.val;
44
+ if (this._available && !newAvailability) {
45
+ this.log(models_1.LogLevel.Debug, `Device became unavailable.`);
46
46
  }
47
+ this._available = newAvailability;
47
48
  break;
48
49
  case 'link_quality':
49
- this._linkQuality = state.val;
50
- if (this._linkQuality < 5) {
51
- this.log(models_1.LogLevel.Debug, `Das Zigbee Gerät hat eine schlechte Verbindung (${this._linkQuality}).`);
50
+ const newValue = state.val;
51
+ if (this._linkQuality > 5 && newValue <= 5) {
52
+ this.log(models_1.LogLevel.Debug, `The link-quality dropped to a critical level: ${newValue}`);
52
53
  }
54
+ this._linkQuality = state.val;
53
55
  break;
54
56
  }
55
57
  this.stateMap.set(idSplit[3], state);
@@ -35,7 +35,7 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
35
35
  return this.lightOn;
36
36
  }
37
37
  restoreTargetAutomaticValue(c) {
38
- this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState, 'Restore targetAutomaticState due to BlockAutomaticHandler'));
38
+ this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState));
39
39
  }
40
40
  update(idSplit, state, initial = false) {
41
41
  this.queuedValue = null;
@@ -62,7 +62,7 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
62
62
  this.setLight(models_1.DimmerSetLightCommand.byTimeBased(this.settings, c));
63
63
  }
64
64
  setActuator(c) {
65
- this.setLight(new models_1.DimmerSetLightCommand(c, c.on, 'Set dimmer due to set ActuactorCommand', c.timeout));
65
+ this.setLight(new models_1.DimmerSetLightCommand(c, c.on, '', c.timeout));
66
66
  }
67
67
  toggleActuator(c) {
68
68
  const setActuatorCommand = models_1.ActuatorSetStateCommand.byActuatorAndToggleCommand(this, c);
@@ -82,26 +82,26 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
82
82
  this.log(models_1.LogLevel.Error, `Keine Connection bekannt.`);
83
83
  return;
84
84
  }
85
- if (c.transitionTime > -1) {
86
- this.setState(this._stateIdTransitionTime, c.transitionTime);
87
- }
88
85
  const dontBlock = sharedFunctions_1.LampUtils.checkUnBlock(this, c);
89
86
  if (sharedFunctions_1.LampUtils.checkBlockActive(this, c)) {
90
87
  return;
91
88
  }
89
+ if (c.transitionTime > -1) {
90
+ this.setState(this._stateIdTransitionTime, c.transitionTime);
91
+ }
92
92
  if (c.on && c.brightness <= 0 && this.brightness < 10) {
93
93
  c.brightness = 10;
94
94
  }
95
- this.log(models_1.LogLevel.Debug, `Set Light Acutator to "${c.on}" with brightness ${c.brightness}`, services_1.LogDebugType.SetActuator);
96
95
  if (c.timeout > -1 && !dontBlock) {
97
96
  this.blockAutomationHandler.disableAutomatic(c.timeout, models_1.CollisionSolving.overrideIfGreater);
98
97
  }
99
98
  if (((_a = services_1.SettingsService.settings.ioBroker) === null || _a === void 0 ? void 0 : _a.useZigbee2mqtt) && !c.on) {
100
99
  // With zigbee2mqtt to turn on only setting brighness>0 is needed, so we need state only for turning off
101
- this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c.on, c, 'Set dimmer due to set ActuactorCommand'));
100
+ this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c, c.on));
102
101
  this.queuedValue = c.on;
103
102
  return;
104
103
  }
104
+ this.log(models_1.LogLevel.Debug, c.logMessage, services_1.LogDebugType.SetActuator);
105
105
  if (c.brightness >= this.settings.turnOnThreshhold) {
106
106
  this.setBrightnessState(c.brightness);
107
107
  return;
@@ -1,5 +1,5 @@
1
1
  import { DeviceType } from '../../deviceType';
2
- import { LampSetTimeBasedCommand, LedSetLightCommand, LedSettings } from '../../../../models';
2
+ import { ActuatorSetStateCommand, LampSetTimeBasedCommand, LedSetLightCommand, LedSettings } from '../../../../models';
3
3
  import { IoBrokerDeviceInfo } from '../../IoBrokerDeviceInfo';
4
4
  import { iLedRgbCct } from '../../baseDeviceInterfaces/iLedRgbCct';
5
5
  import { ZigbeeDimmer } from './zigbeeDimmer';
@@ -20,6 +20,7 @@ export declare abstract class ZigbeeLedRGBCCT extends ZigbeeDimmer implements iL
20
20
  * @inheritDoc
21
21
  */
22
22
  setTimeBased(c: LampSetTimeBasedCommand): void;
23
+ setActuator(c: ActuatorSetStateCommand): void;
23
24
  /**
24
25
  * @inheritDoc
25
26
  */
@@ -41,6 +41,9 @@ class ZigbeeLedRGBCCT extends zigbeeDimmer_1.ZigbeeDimmer {
41
41
  setTimeBased(c) {
42
42
  this.setLight(models_1.LedSetLightCommand.byTimeBased(this.settings, c));
43
43
  }
44
+ setActuator(c) {
45
+ this.setLight(new models_1.LedSetLightCommand(c, c.on, '', c.timeout));
46
+ }
44
47
  /**
45
48
  * @inheritDoc
46
49
  */
@@ -56,7 +59,6 @@ class ZigbeeLedRGBCCT extends zigbeeDimmer_1.ZigbeeDimmer {
56
59
  if (c.on && c.brightness === -1 && this.brightness < 10) {
57
60
  c.brightness = 10;
58
61
  }
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
62
  const formattedColor = services_1.Utils.formatHex(c.color);
61
63
  if (formattedColor !== null && c.on) {
62
64
  this.setState(this._stateIdColor, formattedColor);
@@ -75,19 +75,19 @@ class ZigbeeShutter extends zigbeeDevice_1.ZigbeeDevice {
75
75
  super.update(idSplit, state, initial, pOverride);
76
76
  }
77
77
  setLevel(c) {
78
- this.log(models_1.LogLevel.Debug, c.logMessage);
79
78
  let pPosition = c.level;
80
79
  if (!this._firstCommandRecieved && !c.isInitial) {
81
80
  this._firstCommandRecieved = true;
82
81
  }
83
82
  else if (this._firstCommandRecieved && c.isInitial) {
84
- this.log(models_1.LogLevel.Debug, `Skipped initial Rollo to ${pPosition} as we recieved a command already`);
83
+ this.log(models_1.LogLevel.Debug, `Skipped initial Rollo to ${pPosition} as we recieved a command already`);
85
84
  return;
86
85
  }
87
86
  if (this.currentLevel === pPosition && !c.isForceAction) {
88
- this.log(models_1.LogLevel.Debug, `Skip Rollo command to Position ${pPosition} as this is the current one`, services_1.LogDebugType.SkipUnchangedRolloPosition);
87
+ this.log(models_1.LogLevel.Debug, `Skip Rollo command to Position ${pPosition} as this is the current one, commandLog: ${c.logMessage}`, services_1.LogDebugType.SkipUnchangedRolloPosition);
89
88
  return;
90
89
  }
90
+ this.log(models_1.LogLevel.Debug, c.logMessage);
91
91
  if (this._window !== undefined) {
92
92
  if (this._window.griffeInPosition(models_2.WindowPosition.offen) > 0 && pPosition < 100) {
93
93
  if (!c.skipOpenWarning) {
@@ -109,7 +109,7 @@ class OwnGoveeDevice {
109
109
  if (c.on && c.brightness === -1 && this.brightness < 10) {
110
110
  c.brightness = 10;
111
111
  }
112
- this.log(models_1.LogLevel.Debug, c.logMessage);
112
+ this.log(models_1.LogLevel.Debug, c.logMessage, log_service_1.LogDebugType.SetActuator);
113
113
  const formattedColor = utils_1.Utils.formatHex(c.color);
114
114
  if (formattedColor !== null) {
115
115
  this.setColor(c.color);
@@ -118,10 +118,8 @@ class OwnGoveeDevice {
118
118
  if (devices_1.LampUtils.checkBlockActive(this, c)) {
119
119
  return;
120
120
  }
121
- this.log(models_1.LogLevel.Debug, `Set Light Acutator to "${c.on}" with brightness ${c.brightness}`, log_service_1.LogDebugType.SetActuator);
122
121
  if (c.brightness > -1 && c.on) {
123
122
  this.setBrightness(c.brightness, () => {
124
- this.log(models_1.LogLevel.Debug, `Brightness set to ${c.brightness}`);
125
123
  this.turnOn();
126
124
  });
127
125
  }
@@ -139,8 +137,7 @@ class OwnGoveeDevice {
139
137
  this.setLight(new models_1.LedSetLightCommand(c, c.on, c.reason));
140
138
  }
141
139
  restoreTargetAutomaticValue(c) {
142
- this.log(models_1.LogLevel.Debug, `Restore Target Automatic value`);
143
- this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState, 'Restore Target Automatic value'));
140
+ this.setActuator(new models_1.ActuatorSetStateCommand(c, this.targetAutomaticState));
144
141
  }
145
142
  persist() {
146
143
  var _a;