@rygine/omnilogic-local-sdk 0.0.1 → 0.0.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.
- package/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project are recorded here, and versions follow
|
|
4
4
|
[Semantic Versioning](https://semver.org/).
|
|
5
5
|
|
|
6
|
+
## 0.0.3
|
|
7
|
+
|
|
8
|
+
- Added `isRunning` to pumps
|
|
9
|
+
|
|
10
|
+
## 0.0.2
|
|
11
|
+
|
|
12
|
+
- Removed rounding to whole seconds in `cacheTTL` calculation
|
|
13
|
+
- Changed minimum Node.js version 22
|
|
14
|
+
|
|
6
15
|
## 0.0.1
|
|
7
16
|
|
|
8
17
|
Initial release.
|
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6444,6 +6444,9 @@ var Pump = class extends Device {
|
|
|
6444
6444
|
get isOn() {
|
|
6445
6445
|
return this.reported && this.#reading.position !== 0;
|
|
6446
6446
|
}
|
|
6447
|
+
get isRunning() {
|
|
6448
|
+
return this.speed > 0;
|
|
6449
|
+
}
|
|
6447
6450
|
get lastSpeed() {
|
|
6448
6451
|
return this.#rows.find((r) => r.systemId === this.equipmentId)?.lastSpeed ?? 0;
|
|
6449
6452
|
}
|
|
@@ -8487,12 +8490,12 @@ var OmniLogic = class {
|
|
|
8487
8490
|
async refresh(options = {}) {
|
|
8488
8491
|
const { ifDirty = true, ifOlderThan = this.#cacheTTL, refetch = false, force = false } = options;
|
|
8489
8492
|
const now = Date.now() / 1e3;
|
|
8490
|
-
const age =
|
|
8491
|
-
const isStale = age
|
|
8493
|
+
const age = now - this.#telemetryLastUpdated;
|
|
8494
|
+
const isStale = age >= ifOlderThan;
|
|
8492
8495
|
const dirty = ifDirty && this.#telemetryDirty;
|
|
8493
8496
|
if (!(refetch || dirty || isStale)) {
|
|
8494
8497
|
omnilogicLog.trace("refresh skipped (not dirty, not stale)", {
|
|
8495
|
-
ageSeconds: age,
|
|
8498
|
+
ageSeconds: Math.round(age),
|
|
8496
8499
|
ttlSeconds: ifOlderThan
|
|
8497
8500
|
});
|
|
8498
8501
|
return;
|
|
@@ -8501,7 +8504,7 @@ var OmniLogic = class {
|
|
|
8501
8504
|
refetch,
|
|
8502
8505
|
dirty,
|
|
8503
8506
|
stale: isStale,
|
|
8504
|
-
ageSeconds: age
|
|
8507
|
+
ageSeconds: Math.round(age)
|
|
8505
8508
|
});
|
|
8506
8509
|
const started = Date.now();
|
|
8507
8510
|
const seq = ++this.#refreshStarted;
|