homebridge-nuheat2 1.2.6 → 1.2.7

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
@@ -1,9 +1,23 @@
1
- # Changelog
2
-
3
- All notable changes to this project should be documented in this file
4
-
1
+ # Changelog
2
+
3
+ All notable changes to this project should be documented in this file
4
+
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.2.7] - 2026-04-15
8
+
9
+ ### Added
10
+
11
+ - TypeScript build and typecheck scaffolding for incremental migration
12
+ - TypeScript tests for the Swagger-normalization helpers, schedule switch, and thermostat behavior
13
+ - GitHub Actions workflows for CI validation and automated npm publishing
14
+
15
+ ### Changed
16
+
17
+ - Move the platform entrypoint, API client, accessory classes, logger, settings, models, and test helpers to TypeScript source under `src/`
18
+ - Keep the published CommonJS runtime layout stable by compiling TypeScript back into `index.js`, `lib/`, and `test/`
19
+ - Switch package repository metadata to the canonical GitHub URL for npm trusted publishing and provenance
20
+
7
21
  ## [1.2.6] - 2026-04-11
8
22
 
9
23
  ### Added
@@ -29,93 +43,93 @@ All notable changes to this project should be documented in this file
29
43
  - Correct setpoint debug log spacing in thermostat updates
30
44
 
31
45
  ## [1.2.4] - 2026-04-11
32
-
33
- ### Added
34
-
35
- - Swagger-aligned internal model helpers for account, thermostat, schedule, group, and energy responses
36
- - Optional per-thermostat schedule switches that can resume schedule mode from HomeKit
37
- - Account, schedule, and energy log API helpers for future UI and automation features
38
-
39
- ### Changed
40
-
41
- - Delay platform startup until Homebridge finishes restoring cached accessories
42
- - Allow overriding Nuheat OAuth client settings through config or environment variables
43
- - Improve SignalR reconnection handling and token refresh behavior
44
- - Add regression tests and modernize package metadata for current Homebridge releases
45
- - Publish the maintained fork under the npm package identity `homebridge-nuheat2`
46
- - Simplify thermostat operating-mode handling to match the documented Nuheat Swagger model
47
- - Refresh thermostats when Nuheat sends schedule notifications
48
-
49
- ### Fixed
50
-
51
- - Correct manual-mode thermostat mapping so HomeKit no longer snaps back to off
52
- - Fix thermostat online-state handling so status updates no longer rely on an assignment bug
53
- - Pin transitive websocket and cookie dependencies away from known vulnerable versions
54
-
55
- ## [1.2.3] - 2024-11-04
56
-
57
- ### Fixed
58
-
59
- - Bug when using away mode switches
60
- - Variable handling in some debug logging
61
-
62
- ## [1.2.2] - 2023-06-13
63
-
64
- ### Fixed
65
-
66
- - variable typo
67
-
68
- ## [1.2.1] - 2023-06-01
69
-
70
- ### Fixed
71
-
72
- - hold length bug
73
-
74
- ## [1.2.0] - 2023-05-26
75
-
76
- ### Changed
77
-
78
- - client secret for api auth
79
-
80
- ### Fixed
81
-
82
- - async updates from the api to reduce cookie creation
83
-
84
- ## [1.1.4] - 2023-05-12
85
-
86
- ### Changed
87
-
88
- - error handling when unable to get access token, as to not crash homebridge
89
-
90
- ## [1.1.3] - 2023-04-17
91
-
92
- ### Fixed
93
-
94
- - typo in away mode
95
-
96
- ## [1.1.2] - 2022-12-24
97
-
98
- ### Fixed
99
-
100
- - some unhandled api auth error
101
-
102
- ### Changed
103
-
104
- - some debug logging code
105
-
106
- ## [1.1.1] - 2022-11-17
107
-
108
- ### Fixed
109
-
110
- - changed the 'homebridge-nuheat' name to be lower case so HOOBS handles properly
111
-
112
- ## [1.1.0] - 2022-11-15
113
-
114
- ### Added
115
-
116
- - Added `homebridge-ui` support with auto detection
117
- - Added Away Mode switches for groups
118
-
119
- ### Changed
120
-
121
- - Changed the underlying API to use nuheats new api system
46
+
47
+ ### Added
48
+
49
+ - Swagger-aligned internal model helpers for account, thermostat, schedule, group, and energy responses
50
+ - Optional per-thermostat schedule switches that can resume schedule mode from HomeKit
51
+ - Account, schedule, and energy log API helpers for future UI and automation features
52
+
53
+ ### Changed
54
+
55
+ - Delay platform startup until Homebridge finishes restoring cached accessories
56
+ - Allow overriding Nuheat OAuth client settings through config or environment variables
57
+ - Improve SignalR reconnection handling and token refresh behavior
58
+ - Add regression tests and modernize package metadata for current Homebridge releases
59
+ - Publish the maintained fork under the npm package identity `homebridge-nuheat2`
60
+ - Simplify thermostat operating-mode handling to match the documented Nuheat Swagger model
61
+ - Refresh thermostats when Nuheat sends schedule notifications
62
+
63
+ ### Fixed
64
+
65
+ - Correct manual-mode thermostat mapping so HomeKit no longer snaps back to off
66
+ - Fix thermostat online-state handling so status updates no longer rely on an assignment bug
67
+ - Pin transitive websocket and cookie dependencies away from known vulnerable versions
68
+
69
+ ## [1.2.3] - 2024-11-04
70
+
71
+ ### Fixed
72
+
73
+ - Bug when using away mode switches
74
+ - Variable handling in some debug logging
75
+
76
+ ## [1.2.2] - 2023-06-13
77
+
78
+ ### Fixed
79
+
80
+ - variable typo
81
+
82
+ ## [1.2.1] - 2023-06-01
83
+
84
+ ### Fixed
85
+
86
+ - hold length bug
87
+
88
+ ## [1.2.0] - 2023-05-26
89
+
90
+ ### Changed
91
+
92
+ - client secret for api auth
93
+
94
+ ### Fixed
95
+
96
+ - async updates from the api to reduce cookie creation
97
+
98
+ ## [1.1.4] - 2023-05-12
99
+
100
+ ### Changed
101
+
102
+ - error handling when unable to get access token, as to not crash homebridge
103
+
104
+ ## [1.1.3] - 2023-04-17
105
+
106
+ ### Fixed
107
+
108
+ - typo in away mode
109
+
110
+ ## [1.1.2] - 2022-12-24
111
+
112
+ ### Fixed
113
+
114
+ - some unhandled api auth error
115
+
116
+ ### Changed
117
+
118
+ - some debug logging code
119
+
120
+ ## [1.1.1] - 2022-11-17
121
+
122
+ ### Fixed
123
+
124
+ - changed the 'homebridge-nuheat' name to be lower case so HOOBS handles properly
125
+
126
+ ## [1.1.0] - 2022-11-15
127
+
128
+ ### Added
129
+
130
+ - Added `homebridge-ui` support with auto detection
131
+ - Added Away Mode switches for groups
132
+
133
+ ### Changed
134
+
135
+ - Changed the underlying API to use nuheats new api system
package/README.md CHANGED
@@ -1,129 +1,163 @@
1
- # homebridge-nuheat2
2
-
3
- [![npm version](https://img.shields.io/npm/v/homebridge-nuheat2.svg)](https://www.npmjs.com/package/homebridge-nuheat2)
4
- [![npm downloads](https://img.shields.io/npm/dm/homebridge-nuheat2.svg)](https://www.npmjs.com/package/homebridge-nuheat2)
5
-
1
+ # homebridge-nuheat2
2
+
3
+ [![npm version](https://img.shields.io/npm/v/homebridge-nuheat2.svg)](https://www.npmjs.com/package/homebridge-nuheat2)
4
+ [![npm downloads](https://img.shields.io/npm/dm/homebridge-nuheat2.svg)](https://www.npmjs.com/package/homebridge-nuheat2)
5
+
6
6
  Homebridge platform plugin for Nuheat Signature floor-heating thermostats.
7
7
 
8
8
  This fork focuses on modernizing the plugin for current Homebridge releases, improving runtime stability, and preparing for Homebridge 2.0 while keeping the existing `NuHeat` platform configuration intact.
9
9
 
10
10
  This project builds on the original [`senorshaun/homebridge-nuheat`](https://github.com/senorshaun/homebridge-nuheat) plugin and retains attribution for Shaun's original work.
11
-
12
- ## Highlights
13
-
14
- - Automatically discovers thermostats on the authenticated Nuheat account
15
- - Optionally creates HomeKit switches for Nuheat group away mode
16
- - Supports permanent, scheduled, and timed holds
17
- - Uses Nuheat's OAuth-based API instead of legacy site scraping
18
- - Includes compatibility improvements for Homebridge 1.8+ and 2.0 betas
19
- - Can optionally expose a schedule switch for each thermostat
20
- - Allows advanced OAuth overrides for long-term API stability
21
-
22
- ## Compatibility
23
-
24
- - Homebridge: `^1.8.0 || ^2.0.0-beta.0`
25
- - Node.js: `^18.20.4 || ^20.18.0 || ^22 || ^24`
26
-
27
- For current Homebridge 2.0 betas, use Node 22 or 24.
28
-
29
- ## Installation
30
-
31
- Install Homebridge first:
32
-
33
- ```bash
34
- npm install -g homebridge
35
- ```
36
-
37
- Then install the plugin:
38
-
39
- ```bash
40
- npm install -g homebridge-nuheat2
41
- ```
42
-
43
- The published package name for this maintained fork is `homebridge-nuheat2`. The Homebridge platform name in config remains `NuHeat`.
44
-
45
- ## Configuration
46
-
47
- Most users should configure the plugin through Homebridge Config UI X, but the equivalent JSON looks like this:
48
-
49
- ```json
50
- {
51
- "platform": "NuHeat",
52
- "name": "NuHeat",
53
- "email": "email@address.com",
54
- "password": "password123",
55
- "devices": [{ "serialNumber": "1111111" }, { "serialNumber": "2222222" }],
56
- "autoPopulateAwayModeSwitches": true,
57
- "exposeScheduleSwitches": false,
58
- "holdLength": 1440,
59
- "refresh": 60
60
- }
61
- ```
62
-
63
- ### Options
64
-
65
- - `platform`: Must be `NuHeat`
66
- - `name`: Display name used in Homebridge logs
67
- - `email`: MyNuheat account email address
68
- - `Email`: Legacy alias still accepted for backward compatibility, but `email` is the preferred documented field
69
- - `password`: MyNuheat account password
70
- - `devices`: Optional list of thermostats to expose. If omitted or empty, every thermostat on the account will be discovered automatically
71
- - `serialNumber`: Thermostat serial number from MyNuheat
72
- - `autoPopulateAwayModeSwitches`: Automatically expose away-mode switches for all groups on the account
73
- - `exposeScheduleSwitches`: Optionally expose a switch per thermostat that reflects whether the thermostat is following its schedule and can be turned on to resume the schedule
74
- - `groups`: Optional allow-list of groups to expose as away-mode switches. This only affects group/away-mode accessories
75
- - `groupName`: Group name as shown in MyNuheat
76
- - `holdLength`: Hold duration in minutes
77
- - `refresh`: Poll interval in seconds, default `60`
78
- - `debug`: Enables verbose logging
79
- - `clientId`: Optional advanced override for the Nuheat OAuth client ID. This is recommended once you have official Nuheat API credentials
80
- - `clientSecret`: Optional advanced override for the Nuheat OAuth client secret
81
- - `redirectUri`: Optional advanced override for the Nuheat OAuth redirect URI, default `http://localhost`
82
-
83
- ### Hold Length Behavior
84
-
85
- - `0`: hold until the next scheduled event
86
- - `1-1439`: timed hold for the configured number of minutes
87
- - `1440`: permanent hold
88
-
89
- ### Device Discovery
90
-
91
- If `devices` is omitted or empty, the plugin will automatically expose every thermostat on the authenticated account.
92
-
93
- If `groups` is omitted and `autoPopulateAwayModeSwitches` is enabled, the plugin will automatically expose away-mode switches for all groups on the account.
94
-
95
- If `exposeScheduleSwitches` is enabled, the plugin will also create one switch per thermostat that turns on when the thermostat is following its Nuheat schedule and can be used to resume that schedule from HomeKit.
96
-
97
- ## Nuheat API Access
98
-
99
- Nuheat's public OpenAPI documentation indicates that third-party developers should request their own API credentials:
100
-
101
- - [Nuheat OpenAPI docs](https://api.mynuheat.com/)
102
- - [Nuheat API access request page](https://www.nuheat.com/openapi)
103
-
104
- This fork still supports the legacy built-in OAuth client settings as a fallback, but using your own `clientId` and `clientSecret` is the recommended long-term path once Nuheat issues them for your integration.
105
-
106
- ## What's New In This Fork
107
-
108
- - Fixed the manual-mode thermostat issue where HomeKit could immediately snap back to `Off`
109
- - Hardened online-state parsing and general accessory refresh behavior
110
- - Delayed platform startup until Homebridge finishes restoring cached accessories
111
- - Improved SignalR reconnect handling
112
- - Added regression tests for the key thermostat behavior fixes
113
- - Updated package metadata and dependency overrides for a cleaner modern release
114
- - Published under the maintainer-owned package identity `homebridge-nuheat2`
115
- - Added Swagger-aligned account, schedule, and energy API helpers for future enhancements
116
-
117
- ## Development
118
-
119
- Run the test suite with:
120
-
121
- ```bash
122
- npm test
123
- ```
124
-
125
- ## Future Work
126
-
127
- - Validate the plugin against the official Nuheat API credentials requested for this integration.
128
- - Verify group and away-mode behavior against current live API responses.
129
- - Evaluate whether SignalR notifications can reduce polling further in real-world deployments.
11
+
12
+ ## Highlights
13
+
14
+ - Automatically discovers thermostats on the authenticated Nuheat account
15
+ - Optionally creates HomeKit switches for Nuheat group away mode
16
+ - Supports permanent, scheduled, and timed holds
17
+ - Uses Nuheat's OAuth-based API instead of legacy site scraping
18
+ - Includes compatibility improvements for Homebridge 1.8+ and 2.0 betas
19
+ - Can optionally expose a schedule switch for each thermostat
20
+ - Allows advanced OAuth overrides for long-term API stability
21
+
22
+ ## Compatibility
23
+
24
+ - Homebridge: `^1.8.0 || ^2.0.0-beta.0`
25
+ - Node.js: `^18.20.4 || ^20.18.0 || ^22 || ^24`
26
+
27
+ For current Homebridge 2.0 betas, use Node 22 or 24.
28
+
29
+ ## Installation
30
+
31
+ Install Homebridge first:
32
+
33
+ ```bash
34
+ npm install -g homebridge
35
+ ```
36
+
37
+ Then install the plugin:
38
+
39
+ ```bash
40
+ npm install -g homebridge-nuheat2
41
+ ```
42
+
43
+ The published package name for this maintained fork is `homebridge-nuheat2`. The Homebridge platform name in config remains `NuHeat`.
44
+
45
+ ## Configuration
46
+
47
+ Most users should configure the plugin through Homebridge Config UI X, but the equivalent JSON looks like this:
48
+
49
+ ```json
50
+ {
51
+ "platform": "NuHeat",
52
+ "name": "NuHeat",
53
+ "email": "email@address.com",
54
+ "password": "password123",
55
+ "devices": [{ "serialNumber": "1111111" }, { "serialNumber": "2222222" }],
56
+ "autoPopulateAwayModeSwitches": true,
57
+ "exposeScheduleSwitches": false,
58
+ "holdLength": 1440,
59
+ "refresh": 60
60
+ }
61
+ ```
62
+
63
+ ### Options
64
+
65
+ - `platform`: Must be `NuHeat`
66
+ - `name`: Display name used in Homebridge logs
67
+ - `email`: MyNuheat account email address
68
+ - `Email`: Legacy alias still accepted for backward compatibility, but `email` is the preferred documented field
69
+ - `password`: MyNuheat account password
70
+ - `devices`: Optional list of thermostats to expose. If omitted or empty, every thermostat on the account will be discovered automatically
71
+ - `serialNumber`: Thermostat serial number from MyNuheat
72
+ - `autoPopulateAwayModeSwitches`: Automatically expose away-mode switches for all groups on the account
73
+ - `exposeScheduleSwitches`: Optionally expose a switch per thermostat that reflects whether the thermostat is following its schedule and can be turned on to resume the schedule
74
+ - `groups`: Optional allow-list of groups to expose as away-mode switches. This only affects group/away-mode accessories
75
+ - `groupName`: Group name as shown in MyNuheat
76
+ - `holdLength`: Hold duration in minutes
77
+ - `refresh`: Poll interval in seconds, default `60`
78
+ - `debug`: Enables verbose logging
79
+ - `clientId`: Optional advanced override for the Nuheat OAuth client ID. This is recommended once you have official Nuheat API credentials
80
+ - `clientSecret`: Optional advanced override for the Nuheat OAuth client secret
81
+ - `redirectUri`: Optional advanced override for the Nuheat OAuth redirect URI, default `http://localhost`
82
+
83
+ ### Hold Length Behavior
84
+
85
+ - `0`: hold until the next scheduled event
86
+ - `1-1439`: timed hold for the configured number of minutes
87
+ - `1440`: permanent hold
88
+
89
+ ### Device Discovery
90
+
91
+ If `devices` is omitted or empty, the plugin will automatically expose every thermostat on the authenticated account.
92
+
93
+ If `groups` is omitted and `autoPopulateAwayModeSwitches` is enabled, the plugin will automatically expose away-mode switches for all groups on the account.
94
+
95
+ If `exposeScheduleSwitches` is enabled, the plugin will also create one switch per thermostat that turns on when the thermostat is following its Nuheat schedule and can be used to resume that schedule from HomeKit.
96
+
97
+ ## Nuheat API Access
98
+
99
+ Nuheat's public OpenAPI documentation indicates that third-party developers should request their own API credentials:
100
+
101
+ - [Nuheat OpenAPI docs](https://api.mynuheat.com/)
102
+ - [Nuheat API access request page](https://www.nuheat.com/openapi)
103
+
104
+ This fork still supports the legacy built-in OAuth client settings as a fallback, but using your own `clientId` and `clientSecret` is the recommended long-term path once Nuheat issues them for your integration.
105
+
106
+ ## What's New In This Fork
107
+
108
+ - Fixed the manual-mode thermostat issue where HomeKit could immediately snap back to `Off`
109
+ - Hardened online-state parsing and general accessory refresh behavior
110
+ - Delayed platform startup until Homebridge finishes restoring cached accessories
111
+ - Improved SignalR reconnect handling
112
+ - Added regression tests for the key thermostat behavior fixes
113
+ - Updated package metadata and dependency overrides for a cleaner modern release
114
+ - Published under the maintainer-owned package identity `homebridge-nuheat2`
115
+ - Added Swagger-aligned account, schedule, and energy API helpers for future enhancements
116
+
117
+ ## Development
118
+
119
+ The TypeScript migration is now underway for the core runtime. The source of truth for the platform, API client, accessories, internal models, and tests lives under `src/`, and `npm run build` compiles that back into the existing CommonJS layout used by Homebridge (`index.js`, `lib/`, and `test/`).
120
+
121
+ This keeps the published plugin layout stable while we migrate incrementally instead of doing a risky one-shot rewrite.
122
+
123
+ Common development commands:
124
+
125
+ ```bash
126
+ npm run build
127
+ npm run typecheck
128
+ ```
129
+
130
+ Run the test suite with:
131
+
132
+ ```bash
133
+ npm test
134
+ ```
135
+
136
+ ## Release Automation
137
+
138
+ GitHub Actions now handles two jobs for this repository:
139
+
140
+ - `.github/workflows/ci.yml` runs `npm ci`, `npm run typecheck`, and `npm test` on pushes and pull requests across Node 20, 22, and 24
141
+ - `.github/workflows/publish.yml` runs on pushes to `master` when `package.json` changes, re-runs the checks on Node 24, and publishes to npm only when the `package.json` version is not already on the registry
142
+
143
+ The publish workflow also maps prerelease versions to npm dist-tags automatically. For example, `1.2.7-beta.1` publishes with the `beta` tag, while stable versions publish to `latest`.
144
+
145
+ ### Recommended npm Setup
146
+
147
+ Use npm trusted publishing rather than a long-lived automation token.
148
+
149
+ 1. Open the `homebridge-nuheat2` package settings on npm.
150
+ 2. Add a trusted publisher for GitHub Actions.
151
+ 3. Configure:
152
+ - Organization or user: `applemanj`
153
+ - Repository: `homebridge-nuheat2`
154
+ - Workflow filename: `publish.yml`
155
+ 4. Keep the workflow on GitHub-hosted runners.
156
+
157
+ After that, bump the version in `package.json`, push to `master`, and GitHub Actions will publish the new version automatically once the checks pass.
158
+
159
+ ## Future Work
160
+
161
+ - Validate the plugin against the official Nuheat API credentials requested for this integration.
162
+ - Verify group and away-mode behavior against current live API responses.
163
+ - Evaluate whether SignalR notifications can reduce polling further in real-world deployments.