hoffmation-base 3.0.0-alpha.29 → 3.0.0-alpha.30
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.
|
@@ -10,6 +10,7 @@ export declare abstract class ZigbeeActuator extends ZigbeeDevice implements iAc
|
|
|
10
10
|
readonly blockAutomationHandler: BlockAutomaticHandler;
|
|
11
11
|
/** @inheritDoc */
|
|
12
12
|
targetAutomaticState: boolean;
|
|
13
|
+
protected _lastPersist: number;
|
|
13
14
|
/** @inheritDoc */
|
|
14
15
|
settings: ActuatorSettings;
|
|
15
16
|
protected abstract readonly _stateIdState: string;
|
|
@@ -17,6 +17,7 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
17
17
|
this._actuatorOn = false;
|
|
18
18
|
/** @inheritDoc */
|
|
19
19
|
this.targetAutomaticState = false;
|
|
20
|
+
this._lastPersist = 0;
|
|
20
21
|
/** @inheritDoc */
|
|
21
22
|
this.settings = new models_1.ActuatorSettings();
|
|
22
23
|
/** @inheritDoc */
|
|
@@ -57,7 +58,12 @@ class ZigbeeActuator extends zigbeeDevice_1.ZigbeeDevice {
|
|
|
57
58
|
/** @inheritDoc */
|
|
58
59
|
persist() {
|
|
59
60
|
var _a;
|
|
61
|
+
const now = services_1.Utils.nowMS();
|
|
62
|
+
if (this._lastPersist + 1000 > now) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
60
65
|
(_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.persistActuator(this);
|
|
66
|
+
this._lastPersist = now;
|
|
61
67
|
}
|
|
62
68
|
/** @inheritDoc */
|
|
63
69
|
toggleActuator(command) {
|