@rygine/omnilogic-local-sdk 0.0.1 → 0.0.2

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,11 @@
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.2
7
+
8
+ - Removed rounding to whole seconds in `cacheTTL` calculation
9
+ - Minimum Node.js version changed to 22
10
+
6
11
  ## 0.0.1
7
12
 
8
13
  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
@@ -492,8 +492,8 @@ export declare const parseConfig: (xml: string) => {
492
492
  operations: Operation[];
493
493
  })[];
494
494
  name: string;
495
- systemId: number;
496
495
  serviceModeTimeout: number;
496
+ systemId: number;
497
497
  };
498
498
  devices: Device$1[];
499
499
  favorites: Favorite[];
@@ -5722,7 +5722,7 @@ export declare const ColorLogicPowerState: {
5722
5722
  readonly COOLDOWN: 7;
5723
5723
  };
5724
5724
  export declare const powerStateName: (code: number | undefined) => string;
5725
- export declare const isLightLit: (state: number) => state is 6 | 3 | 4;
5725
+ export declare const isLightLit: (state: number) => state is 3 | 6 | 4;
5726
5726
  type LightShowInfo = {
5727
5727
  value: number;
5728
5728
  name: string;
package/dist/index.js CHANGED
@@ -8487,12 +8487,12 @@ var OmniLogic = class {
8487
8487
  async refresh(options = {}) {
8488
8488
  const { ifDirty = true, ifOlderThan = this.#cacheTTL, refetch = false, force = false } = options;
8489
8489
  const now = Date.now() / 1e3;
8490
- const age = Math.max(0, Math.round(now - this.#telemetryLastUpdated));
8491
- const isStale = age > ifOlderThan;
8490
+ const age = now - this.#telemetryLastUpdated;
8491
+ const isStale = age >= ifOlderThan;
8492
8492
  const dirty = ifDirty && this.#telemetryDirty;
8493
8493
  if (!(refetch || dirty || isStale)) {
8494
8494
  omnilogicLog.trace("refresh skipped (not dirty, not stale)", {
8495
- ageSeconds: age,
8495
+ ageSeconds: Math.round(age),
8496
8496
  ttlSeconds: ifOlderThan
8497
8497
  });
8498
8498
  return;
@@ -8501,7 +8501,7 @@ var OmniLogic = class {
8501
8501
  refetch,
8502
8502
  dirty,
8503
8503
  stale: isStale,
8504
- ageSeconds: age
8504
+ ageSeconds: Math.round(age)
8505
8505
  });
8506
8506
  const started = Date.now();
8507
8507
  const seq = ++this.#refreshStarted;