hoffmation-base 3.2.1-alpha.1 → 3.2.1-alpha.3
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.
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { CommandSource, CommandType } from '../enums';
|
|
2
2
|
import { iBaseCommand } from './iBaseCommand';
|
|
3
|
-
|
|
3
|
+
import { iJsonOmitKeys } from '../interfaces';
|
|
4
|
+
export declare abstract class BaseCommand implements iBaseCommand, iJsonOmitKeys {
|
|
4
5
|
readonly source: CommandSource | iBaseCommand;
|
|
5
6
|
readonly reason: string;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
jsonOmitKeys: string[];
|
|
6
11
|
/**
|
|
7
12
|
* The timestamp of the command being created
|
|
8
13
|
*/
|
|
@@ -15,6 +15,10 @@ class BaseCommand {
|
|
|
15
15
|
constructor(source = enums_1.CommandSource.Unknown, reason = '') {
|
|
16
16
|
this.source = source;
|
|
17
17
|
this.reason = reason;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
this.jsonOmitKeys = ['source'];
|
|
18
22
|
this.timestamp = new Date();
|
|
19
23
|
}
|
|
20
24
|
get isAutomaticAction() {
|
|
@@ -57,8 +57,6 @@ export declare class Dachs extends RoomBaseDevice implements iBaseDevice, iActua
|
|
|
57
57
|
/** @inheritDoc */
|
|
58
58
|
restoreTargetAutomaticValue(c: RestoreTargetAutomaticValueCommand): void;
|
|
59
59
|
/** @inheritDoc */
|
|
60
|
-
toJSON(): Partial<Dachs>;
|
|
61
|
-
/** @inheritDoc */
|
|
62
60
|
persist(): void;
|
|
63
61
|
private loadData;
|
|
64
62
|
/** @inheritDoc */
|
|
@@ -48,6 +48,17 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
48
48
|
this._dachsOn = false;
|
|
49
49
|
this._tempWarmWater = 0;
|
|
50
50
|
this._tempHeatStorage = 0;
|
|
51
|
+
this.jsonOmitKeys.push(...[
|
|
52
|
+
'client',
|
|
53
|
+
'config',
|
|
54
|
+
'_influxClient',
|
|
55
|
+
'warmWaterSensor',
|
|
56
|
+
'heatStorageTempSensor',
|
|
57
|
+
'warmWaterPump',
|
|
58
|
+
'heatingRod',
|
|
59
|
+
'blockDachsStart',
|
|
60
|
+
'warmWaterDachsAlternativeActuator',
|
|
61
|
+
]);
|
|
51
62
|
devices_1.Devices.alLDevices[allDevicesKey] = this;
|
|
52
63
|
this.deviceCapabilities.push(enums_1.DeviceCapability.actuator);
|
|
53
64
|
if (options.influxDb) {
|
|
@@ -84,21 +95,6 @@ class Dachs extends RoomBaseDevice_1.RoomBaseDevice {
|
|
|
84
95
|
this.setActuator(new command_1.ActuatorSetStateCommand(c, this.targetAutomaticState, 'Restore Target Automatic value'));
|
|
85
96
|
}
|
|
86
97
|
/** @inheritDoc */
|
|
87
|
-
toJSON() {
|
|
88
|
-
return utils_1.Utils.jsonFilter(lodash_1.default.omit(super.toJSON(), [
|
|
89
|
-
'room',
|
|
90
|
-
'client',
|
|
91
|
-
'config',
|
|
92
|
-
'_influxClient',
|
|
93
|
-
'warmWaterSensor',
|
|
94
|
-
'heatStorageTempSensor',
|
|
95
|
-
'warmWaterPump',
|
|
96
|
-
'heatingRod',
|
|
97
|
-
'blockDachsStart',
|
|
98
|
-
'warmWaterDachsAlternativeActuator',
|
|
99
|
-
]));
|
|
100
|
-
}
|
|
101
|
-
/** @inheritDoc */
|
|
102
98
|
persist() {
|
|
103
99
|
var _a;
|
|
104
100
|
(_a = services_1.Persistence.dbo) === null || _a === void 0 ? void 0 : _a.persistActuator(this);
|