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

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.
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActuatorWriteStateToDeviceCommand = void 0;
4
4
  const baseCommand_1 = require("./baseCommand");
5
5
  const commandType_1 = require("./commandType");
6
+ const actuatorSetStateCommand_1 = require("./actuatorSetStateCommand");
6
7
  class ActuatorWriteStateToDeviceCommand extends baseCommand_1.BaseCommand {
7
8
  constructor(source, stateValue, reason = '') {
8
9
  super(source, reason);
@@ -10,6 +11,9 @@ class ActuatorWriteStateToDeviceCommand extends baseCommand_1.BaseCommand {
10
11
  this._commandType = commandType_1.CommandType.ActuatorWriteStateToDeviceCommand;
11
12
  }
12
13
  get logMessage() {
14
+ if (this.source instanceof actuatorSetStateCommand_1.ActuatorSetStateCommand) {
15
+ return `Actuator Write StateToDevice original Log-message: ${this.source.logMessage}`;
16
+ }
13
17
  return `Actuator writeStateToDevice(${this.stateValue}) for reason: ${this.reasonTrace}`;
14
18
  }
15
19
  }
@@ -1,6 +1,6 @@
1
1
  import { BaseGroup } from './base-group';
2
2
  import { iActuator, iLamp } from '../baseDeviceInterfaces';
3
- import { ActuatorSetStateCommand, LampSetLightCommand, LampSetTimeBasedCommand, LedSetLightCommand, LightGroupSwitchTimeConditionalCommand, TimeCallback, TimeOfDay, WledSetLightCommand } from '../../../models';
3
+ import { ActuatorSetStateCommand, LampSetLightCommand, LampSetTimeBasedCommand, LedSetLightCommand, LightGroupSwitchTimeConditionalCommand, TimeCallback, WledSetLightCommand } from '../../../models';
4
4
  import { WledDevice } from '../wledDevice';
5
5
  import { iLedRgbCct } from '../baseDeviceInterfaces/iLedRgbCct';
6
6
  export declare class LightGroup extends BaseGroup {
@@ -20,7 +20,7 @@ export declare class LightGroup extends BaseGroup {
20
20
  setAllLampen(c: LampSetLightCommand): void;
21
21
  setAllLampenTimeBased(c: LampSetTimeBasedCommand): void;
22
22
  setAllOutlets(c: ActuatorSetStateCommand): void;
23
- setAllActuatorsTimeBased(time: TimeOfDay): void;
23
+ setAllActuatorsTimeBased(c: LampSetTimeBasedCommand): void;
24
24
  setAllLED(c: LedSetLightCommand): void;
25
25
  setAllWled(c: WledSetLightCommand): void;
26
26
  initialize(): void;
@@ -70,7 +70,7 @@ class LightGroup extends base_group_1.BaseGroup {
70
70
  switchAll(c) {
71
71
  this.getAllAsActuator().forEach((a) => {
72
72
  if (a.settings.includeInAmbientLight && !c.isForceAction && !c.on && this._ambientLightOn) {
73
- a.log(models_1.LogLevel.Info, `Ambient light mode is active --> Skip non force light off command in ${this.roomName}`);
73
+ a.log(models_1.LogLevel.Info, `Ambient light mode is active --> Skip non force light off command in ${this.roomName}; command: ${c.logMessage}`);
74
74
  return;
75
75
  }
76
76
  a.setActuator(c);
@@ -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(c, c.time, 'LightGroup switchTimeConditional'));
109
+ this.setAllLampenTimeBased(new models_1.LampSetTimeBasedCommand(c, c.time));
110
110
  }
111
111
  else {
112
- this.setAllLampen(new models_1.LampSetLightCommand(c, false, 'LightGroup switchTimeConditional --> off'));
112
+ this.setAllLampen(new models_1.LampSetLightCommand(c, false));
113
113
  }
114
114
  if (resultSteckdosen) {
115
- this.setAllActuatorsTimeBased(c.time);
115
+ this.setAllActuatorsTimeBased(new models_1.LampSetTimeBasedCommand(c, c.time));
116
116
  }
117
117
  else {
118
- this.setAllOutlets(new models_1.ActuatorSetStateCommand(c, false, 'LightGroup switchTimeConditional --> off'));
118
+ this.setAllOutlets(new models_1.ActuatorSetStateCommand(c, false));
119
119
  }
120
120
  }
121
121
  setAllLampen(c) {
@@ -133,12 +133,12 @@ class LightGroup extends base_group_1.BaseGroup {
133
133
  s.setActuator(c);
134
134
  });
135
135
  }
136
- setAllActuatorsTimeBased(time) {
136
+ setAllActuatorsTimeBased(c) {
137
137
  this.getOutlets().forEach((s) => {
138
- if ((time === models_1.TimeOfDay.Night && s.settings.nightOn) ||
139
- (time === models_1.TimeOfDay.BeforeSunrise && s.settings.dawnOn) ||
140
- (time === models_1.TimeOfDay.AfterSunset && s.settings.duskOn)) {
141
- s.setActuator(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Automatic, true, `LightGroup setAllActuatorsTimeBased`));
138
+ if ((c.time === models_1.TimeOfDay.Night && s.settings.nightOn) ||
139
+ (c.time === models_1.TimeOfDay.BeforeSunrise && s.settings.dawnOn) ||
140
+ (c.time === models_1.TimeOfDay.AfterSunset && s.settings.duskOn)) {
141
+ s.setActuator(new models_1.ActuatorSetStateCommand(c, true, `LightGroup setAllActuatorsTimeBased`, c.timeout));
142
142
  }
143
143
  });
144
144
  }
@@ -59,14 +59,14 @@ class ZigbeeLedRGBCCT extends zigbeeDimmer_1.ZigbeeDimmer {
59
59
  if (c.on && c.brightness === -1 && this.brightness < 10) {
60
60
  c.brightness = 10;
61
61
  }
62
+ super.setLight(c);
62
63
  const formattedColor = services_1.Utils.formatHex(c.color);
63
- if (formattedColor !== null && c.on) {
64
+ if (formattedColor !== null && c.on && (c.color !== this.color || c.isForceAction)) {
64
65
  this.setState(this._stateIdColor, formattedColor);
65
66
  }
66
- if (c.colorTemp > -1 && c.on) {
67
+ if (c.colorTemp > -1 && c.on && (c.colorTemp !== this.colortemp || c.isForceAction)) {
67
68
  this.setState(this._stateIdColorTemp, c.colorTemp);
68
69
  }
69
- super.setLight(c);
70
70
  }
71
71
  }
72
72
  exports.ZigbeeLedRGBCCT = ZigbeeLedRGBCCT;
@@ -77,7 +77,7 @@ class OwnGoveeDevice {
77
77
  }
78
78
  log(level, message, debugType = log_service_1.LogDebugType.None) {
79
79
  var _a, _b;
80
- log_service_1.ServerLogService.writeLog(level, `${this.name}: ${message}`, {
80
+ log_service_1.ServerLogService.writeLog(level, message, {
81
81
  debugType: debugType,
82
82
  room: (_b = (_a = this._room) === null || _a === void 0 ? void 0 : _a.roomName) !== null && _b !== void 0 ? _b : '',
83
83
  deviceId: this.name,