@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 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
@@ -28,7 +28,7 @@ internet or cloud login required.
28
28
 
29
29
  ## Requirements
30
30
 
31
- - Node.js >= 24
31
+ - Node.js >= 22
32
32
  - Network access to the OmniLogic controller on port 10444
33
33
 
34
34
  ## Installation
package/dist/index.d.ts CHANGED
@@ -5137,6 +5137,7 @@ declare class Pump extends Device {
5137
5137
  get countdownReason(): number;
5138
5138
  get speed(): number;
5139
5139
  get isOn(): boolean;
5140
+ get isRunning(): boolean;
5140
5141
  get lastSpeed(): number;
5141
5142
  get status(): string;
5142
5143
  get whyOn(): string;
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 = Math.max(0, Math.round(now - this.#telemetryLastUpdated));
8491
- const isStale = age > ifOlderThan;
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;