hoffmation-base 3.0.0-alpha.4 → 3.0.0-alpha.5

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.
@@ -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,7 +4,7 @@ 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;
@@ -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} 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) {
@@ -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;
@@ -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
  }
@@ -72,7 +72,7 @@ class LampUtils {
72
72
  return;
73
73
  }
74
74
  device.queuedValue = c.on;
75
- device.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c.on, c));
75
+ device.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c, c.on));
76
76
  if (device.settings.isStromStoss && c.on) {
77
77
  c.timeout = 3000;
78
78
  LampUtils.stromStossOn(device);
@@ -65,7 +65,7 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
65
65
  }
66
66
  services_1.ServerLogService.writeLog(models_1.LogLevel.Debug, `WLED Schalten: "${this.info.customName}" An: ${c.on}\tHelligkeit: ${c.brightness}%`);
67
67
  this.queuedValue = c.on;
68
- this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c.on, c, 'WLED Schalten'));
68
+ this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c, c.on, 'WLED Schalten'));
69
69
  if (c.preset !== undefined) {
70
70
  this.setState(this._presetID, c.preset, undefined, (err) => {
71
71
  services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `WLED schalten ergab Fehler: ${err}`);
@@ -82,23 +82,23 @@ 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);
95
+ this.log(models_1.LogLevel.Debug, c.logMessage);
96
96
  if (c.timeout > -1 && !dontBlock) {
97
97
  this.blockAutomationHandler.disableAutomatic(c.timeout, models_1.CollisionSolving.overrideIfGreater);
98
98
  }
99
99
  if (((_a = services_1.SettingsService.settings.ioBroker) === null || _a === void 0 ? void 0 : _a.useZigbee2mqtt) && !c.on) {
100
100
  // 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'));
101
+ this.writeActuatorStateToDevice(new models_1.ActuatorWriteStateToDeviceCommand(c, c.on, 'Set dimmer due to set ActuactorCommand'));
102
102
  this.queuedValue = c.on;
103
103
  return;
104
104
  }
@@ -56,7 +56,6 @@ class ZigbeeLedRGBCCT extends zigbeeDimmer_1.ZigbeeDimmer {
56
56
  if (c.on && c.brightness === -1 && this.brightness < 10) {
57
57
  c.brightness = 10;
58
58
  }
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
59
  const formattedColor = services_1.Utils.formatHex(c.color);
61
60
  if (formattedColor !== null && c.on) {
62
61
  this.setState(this._stateIdColor, formattedColor);