hoffmation-base 3.0.0-alpha.3 → 3.0.0-alpha.4
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.
- package/lib/models/command/ShutterSetLevelCommand.js +1 -1
- package/lib/models/command/actuatorSetStateCommand.js +1 -1
- package/lib/models/command/actuatorToggleCommand.js +1 -1
- package/lib/models/command/actuatorWriteStateToDeviceCommand.js +1 -1
- package/lib/models/command/baseCommand.js +4 -10
- package/lib/models/command/lampSetLightCommand.js +1 -1
- package/lib/models/command/lampSetTimeBasedCommand.js +1 -1
- package/lib/models/command/lampToggleLightCommand.js +1 -1
- package/lib/models/command/ledSetLightCommand.js +1 -1
- package/lib/models/command/restoreTargetAutomaticValueCommand.js +1 -1
- package/lib/server/devices/hmIPDevices/hmIpRoll.js +2 -2
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +3 -3
- package/lib/tsconfig.tsbuildinfo +1 -1
- 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}
|
|
14
|
+
return `Shutter setLevel to ${this.level} for reason: ${this.reasonTrace}`;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
exports.ShutterSetLevelCommand = ShutterSetLevelCommand;
|
|
@@ -11,7 +11,7 @@ class ActuatorSetStateCommand extends baseCommand_1.BaseCommand {
|
|
|
11
11
|
this._commandType = commandType_1.CommandType.ShutterSetLevelCommand;
|
|
12
12
|
}
|
|
13
13
|
get logMessage() {
|
|
14
|
-
return `Actuator setState to ${this.on}
|
|
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
|
|
12
|
+
return `Actuator toggle for reason: ${this.reasonTrace}`;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
exports.ActuatorToggleCommand = ActuatorToggleCommand;
|
|
@@ -10,7 +10,7 @@ class ActuatorWriteStateToDeviceCommand extends baseCommand_1.BaseCommand {
|
|
|
10
10
|
this._commandType = commandType_1.CommandType.ActuatorWriteStateToDeviceCommand;
|
|
11
11
|
}
|
|
12
12
|
get logMessage() {
|
|
13
|
-
return `Actuator writeStateToDevice(${this.stateValue})
|
|
13
|
+
return `Actuator writeStateToDevice(${this.stateValue}) for reason: ${this.reasonTrace}`;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
exports.ActuatorWriteStateToDeviceCommand = ActuatorWriteStateToDeviceCommand;
|
|
@@ -21,17 +21,11 @@ class BaseCommand {
|
|
|
21
21
|
return this.source === commandSource_1.CommandSource.Initial;
|
|
22
22
|
}
|
|
23
23
|
get reasonTrace() {
|
|
24
|
-
|
|
25
|
-
if (this.source
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
if (this.reason === '') {
|
|
29
|
-
if (reason === '') {
|
|
30
|
-
return `${this._commandType}`;
|
|
31
|
-
}
|
|
32
|
-
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}`;
|
|
33
27
|
}
|
|
34
|
-
return
|
|
28
|
+
return `CommandType("${commandSource_1.CommandSource[this.source]}") stack => ${ownPart}`;
|
|
35
29
|
}
|
|
36
30
|
}
|
|
37
31
|
exports.BaseCommand = BaseCommand;
|
|
@@ -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}
|
|
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]}
|
|
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
|
|
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}
|
|
26
|
+
return `Led setLight to ${this.on} 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
|
|
12
|
+
return `Actuator restore target automatic value due to reason: ${this.reasonTrace}`;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
exports.RestoreTargetAutomaticValueCommand = RestoreTargetAutomaticValueCommand;
|
|
@@ -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) {
|
|
@@ -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
|
|
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) {
|