homebridge-nuheat2 1.4.0 → 1.5.0

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
@@ -2,7 +2,11 @@
2
2
 
3
3
  All notable changes to this project should be documented in this file
4
4
 
5
- ## [Unreleased]
5
+ ## [1.5.0] - 2026-11-17
6
+
7
+ ### Fixed
8
+
9
+ - Stop silently coercing an explicit Hold Length of `0` to the 1440-minute default: `0` is now refused with a logged warning (and the config UI now enforces a minimum of 1 minute), so a manual setpoint change no longer lands as a permanent Nuheat hold when a zero was configured
6
10
 
7
11
  ## [1.4.0] - 2026-10-17
8
12
 
@@ -105,7 +105,7 @@
105
105
  "title": "Hold Length (minutes)",
106
106
  "type": "integer",
107
107
  "default": 1440,
108
- "minimum": 0,
108
+ "minimum": 1,
109
109
  "maximum": 1440,
110
110
  "description": "Duration for HomeKit setpoint changes. Use 0 to hold until the next scheduled event, 1-1439 for a timed hold, or 1440 for a permanent hold."
111
111
  },
package/index.js CHANGED
@@ -50,7 +50,19 @@ class NuHeatPlatform {
50
50
  }
51
51
  this.config = config;
52
52
  this.config.email = this.config.Email || this.config.email;
53
- this.config.holdLength = Math.min(1440, Math.max(0, this.config.holdLength || 1440));
53
+ if (this.config.holdLength === undefined) {
54
+ this.config.holdLength = 1440;
55
+ }
56
+ else if (!(this.config.holdLength > 0)) {
57
+ // A hold length of 0 (or less) expires immediately, which the Nuheat
58
+ // API treats as a permanent hold. Refuse it and fall back to the
59
+ // default instead of silently converting it to 1440.
60
+ log.warn("Ignoring Hold Length " +
61
+ this.config.holdLength +
62
+ ": it must be at least 1 minute. Using the default of 1440.");
63
+ this.config.holdLength = 1440;
64
+ }
65
+ this.config.holdLength = Math.min(1440, this.config.holdLength);
54
66
  this.config.refresh = Math.max(30, this.config.refresh || 60);
55
67
  this.api = api;
56
68
  this.log = new logger_1.Logger(log, this.config.debug || false);
@@ -192,7 +204,11 @@ class NuHeatPlatform {
192
204
  entry = { uuid };
193
205
  this.accessories.push(entry);
194
206
  }
195
- entry.accessory = new NuHeatThermostat(this.log, deviceData, this.config.holdLength || 1440, getPlatformAccessory(deviceAccessory), this.NuHeatAPI, Homebridge, this.account?.temperatureScale, this.config.enableThermostatModeControl === true);
207
+ entry.accessory = new NuHeatThermostat(this.log, deviceData,
208
+ // `holdLength` was normalized in the constructor; never re-apply a
209
+ // fallback here or an explicit 0 would silently become 1440 (a
210
+ // permanent hold).
211
+ this.config.holdLength, getPlatformAccessory(deviceAccessory), this.NuHeatAPI, Homebridge, this.account?.temperatureScale, this.config.enableThermostatModeControl === true);
196
212
  entry.existsInConfig = true;
197
213
  this.log.info("Loaded thermostat " +
198
214
  deviceData.serialNumber +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-nuheat2",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Homebridge Platform for NuHeat Signature Thermostats",
5
5
  "main": "index.js",
6
6
  "scripts": {