@homebridge-plugins/homebridge-resideo 3.0.3-beta.8 → 3.1.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.
Files changed (93) hide show
  1. package/.github/ISSUE_TEMPLATE/config.yml +1 -1
  2. package/.github/copilot-instructions.md +239 -183
  3. package/.github/labeler.yml +3 -14
  4. package/.github/scripts/npm-version-script-esm-auto.js +201 -0
  5. package/.github/scripts/resolve-version-bump-esm.js +118 -0
  6. package/.github/workflows/release.yml +147 -13
  7. package/CHANGELOG.md +10 -30
  8. package/README.md +7 -21
  9. package/config.schema.json +111 -2
  10. package/dist/{platform.d.ts → Platform.HAP.d.ts} +7 -5
  11. package/dist/Platform.HAP.d.ts.map +1 -0
  12. package/dist/{platform.js → Platform.HAP.js} +30 -28
  13. package/dist/Platform.HAP.js.map +1 -0
  14. package/dist/Platform.HAP.test.d.ts +2 -0
  15. package/dist/Platform.HAP.test.d.ts.map +1 -0
  16. package/dist/{platform.test.js → Platform.HAP.test.js} +7 -7
  17. package/dist/Platform.HAP.test.js.map +1 -0
  18. package/dist/Platform.Matter.d.ts +50 -0
  19. package/dist/Platform.Matter.d.ts.map +1 -0
  20. package/dist/Platform.Matter.js +125 -0
  21. package/dist/Platform.Matter.js.map +1 -0
  22. package/dist/devices/device.d.ts +1 -1
  23. package/dist/devices/device.d.ts.map +1 -1
  24. package/dist/devices/device.js +2 -2
  25. package/dist/devices/device.js.map +1 -1
  26. package/dist/devices/leaksensors.d.ts +1 -1
  27. package/dist/devices/leaksensors.d.ts.map +1 -1
  28. package/dist/devices/leaksensors.js +2 -2
  29. package/dist/devices/leaksensors.js.map +1 -1
  30. package/dist/devices/roomsensors.d.ts +1 -1
  31. package/dist/devices/roomsensors.d.ts.map +1 -1
  32. package/dist/devices/roomsensors.js +2 -2
  33. package/dist/devices/roomsensors.js.map +1 -1
  34. package/dist/devices/roomsensorthermostats.d.ts +1 -1
  35. package/dist/devices/roomsensorthermostats.d.ts.map +1 -1
  36. package/dist/devices/roomsensorthermostats.js +14 -14
  37. package/dist/devices/roomsensorthermostats.js.map +1 -1
  38. package/dist/devices/thermostats.d.ts +1 -1
  39. package/dist/devices/thermostats.d.ts.map +1 -1
  40. package/dist/devices/thermostats.js +61 -94
  41. package/dist/devices/thermostats.js.map +1 -1
  42. package/dist/devices/valve.d.ts +1 -1
  43. package/dist/devices/valve.d.ts.map +1 -1
  44. package/dist/devices/valve.js +4 -6
  45. package/dist/devices/valve.js.map +1 -1
  46. package/dist/homebridge-ui/public/index.html +248 -226
  47. package/dist/homebridge-ui/server.d.ts.map +1 -1
  48. package/dist/homebridge-ui/server.js +0 -217
  49. package/dist/homebridge-ui/server.js.map +1 -1
  50. package/dist/http-client.d.ts +30 -0
  51. package/dist/http-client.d.ts.map +1 -0
  52. package/dist/http-client.js +109 -0
  53. package/dist/http-client.js.map +1 -0
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +5 -2
  56. package/dist/index.js.map +1 -1
  57. package/dist/index.test.js +2 -3
  58. package/dist/index.test.js.map +1 -1
  59. package/dist/settings.d.ts +11 -1
  60. package/dist/settings.d.ts.map +1 -1
  61. package/dist/utils.d.ts +12 -0
  62. package/dist/utils.d.ts.map +1 -1
  63. package/dist/utils.js +36 -4
  64. package/dist/utils.js.map +1 -1
  65. package/dist/utils.test.js +74 -3
  66. package/dist/utils.test.js.map +1 -1
  67. package/docs/assets/icons.js +1 -1
  68. package/docs/assets/icons.svg +1 -1
  69. package/docs/assets/main.js +3 -3
  70. package/docs/assets/style.css +3 -3
  71. package/docs/index.html +16 -20
  72. package/docs/variables/default.html +1 -1
  73. package/eslint.config.js +7 -8
  74. package/package.json +20 -22
  75. package/.github/npm-version-script-esm.js +0 -97
  76. package/.github/workflows/beta-release.yml +0 -55
  77. package/.github/workflows/build.yml +0 -18
  78. package/.github/workflows/changerelease.yml +0 -11
  79. package/.github/workflows/labeler.yml +0 -9
  80. package/.github/workflows/release-drafter.yml +0 -14
  81. package/dist/homebridge-ui/public/lib/featureoptions.js +0 -455
  82. package/dist/homebridge-ui/public/lib/featureoptions.js.map +0 -1
  83. package/dist/homebridge-ui/public/lib/webUi-featureoptions.mjs +0 -3765
  84. package/dist/homebridge-ui/public/lib/webUi.mjs +0 -189
  85. package/dist/platform.d.ts.map +0 -1
  86. package/dist/platform.js.map +0 -1
  87. package/dist/platform.test.d.ts +0 -2
  88. package/dist/platform.test.d.ts.map +0 -1
  89. package/dist/platform.test.js.map +0 -1
  90. package/dist/resideo-options.d.ts +0 -24
  91. package/dist/resideo-options.d.ts.map +0 -1
  92. package/dist/resideo-options.js +0 -215
  93. package/dist/resideo-options.js.map +0 -1
@@ -1,4 +1,4 @@
1
- blank_issues_enabled: true
1
+ blank_issues_enabled: false
2
2
  contact_links:
3
3
  - name: Homebridge Discord Channel for Resideo
4
4
  url: https://discord.gg/8fpZA4S
@@ -1,204 +1,260 @@
1
1
  # Homebridge Resideo Plugin
2
2
 
3
- The Homebridge Resideo plugin is a TypeScript-based Homebridge plugin that integrates Resideo/Honeywell Home devices (thermostats, leak sensors, room sensors, valves) with Apple HomeKit. The plugin communicates with Resideo APIs using OAuth2 authentication and includes a web-based configuration UI.
4
-
5
- Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
6
-
7
- ## Branching and Release Strategy
8
-
9
- ### Beta Branch Targeting
10
- **IMPORTANT**: All pull requests must be directed at a branch that starts with "beta-" first, never directly to the main/latest branch.
11
-
12
- #### Branch Creation Rules
13
- - If no appropriate beta branch exists, create one based on the semantic versioning type:
14
- - **patch** (bug fixes): Create `beta-X.Y.Z+1` (e.g., `beta-3.0.3` from current `3.0.2`)
15
- - **minor** (new features): Create `beta-X.Y+1.0` (e.g., `beta-3.1.0` from current `3.0.2`)
16
- - **major** (breaking changes): Create `beta-X+1.0.0` (e.g., `beta-4.0.0` from current `3.0.2`)
17
-
18
- #### Required Labels
19
- Before assigning any issue to Copilot, the following labels **must** be set to determine the change type:
20
- - `patch` - for bug fixes and small improvements (no API changes)
21
- - `minor` - for new features (backward compatible API additions)
22
- - `major` - for breaking changes (incompatible API changes)
23
-
24
- #### Workflow
25
- 1. Check issue has required semantic versioning label (`patch`, `minor`, or `major`)
26
- 2. Identify or create appropriate beta branch based on the label
27
- 3. Target all work to the beta branch, not main/latest
28
- 4. Beta branches will be merged to main/latest after testing and validation
29
-
30
- #### Examples
31
- - Current version: `3.0.2`
32
- - Existing beta branch: `beta-3.0.3` (for patch releases)
33
- - For a **bug fix** with `patch` label: Use existing `beta-3.0.3` or create `beta-3.0.4`
34
- - For a **new feature** with `minor` label: Create `beta-3.1.0`
35
- - For a **breaking change** with `major` label: Create `beta-4.0.0`
36
-
37
- #### Creating Beta Branches
38
- If no appropriate beta branch exists, create one using:
39
- ```bash
40
- git checkout latest # Start from latest stable
41
- git checkout -b beta-X.Y.Z # Create new beta branch
42
- git push -u origin beta-X.Y.Z # Push to remote
43
- ```
3
+ Always reference these instructions first and fall back to search only when the repo contents do not answer the question.
44
4
 
45
- #### Issue Assignment Requirements
46
- **Before assigning any issue to Copilot:**
47
- 1. Verify the issue has one of the required semantic versioning labels (`patch`, `minor`, `major`)
48
- 2. If missing, add the appropriate label based on the change type
49
- 3. Confirm the target beta branch exists or needs to be created
50
- 4. Only then assign the issue to Copilot for implementation
5
+ This is a Homebridge platform plugin for Resideo and Honeywell Home devices. The plugin is written in TypeScript, talks to the Resideo cloud API over OAuth, and exposes supported devices to HomeKit through Homebridge.
51
6
 
52
- ## Working Effectively
7
+ Current focus: keep the HAP integration stable, keep the Homebridge UI account-linking flow working, and preserve existing thermostat, room sensor, leak sensor, and shutoff valve behavior.
53
8
 
54
- ### Environment Setup
55
- - Ensure Node.js 20+ or 22+ is installed (current requirement from package.json engines field)
56
- - Use npm 10+ for package management
9
+ ## Device Support
57
10
 
58
- ### Bootstrap and Build Process
59
- - `npm install` -- installs all dependencies. Takes ~30 seconds. Some deprecation warnings are expected and safe to ignore.
60
- - `npm run build` -- full build process. Takes ~5 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
61
- - Runs `npm run clean && tsc && npm run plugin-ui`
62
- - Cleans dist directory, compiles TypeScript, copies UI files
63
- - `npm run clean` -- removes dist directory. Takes <1 second.
11
+ ### Currently Supported Devices
12
+ - Thermostats with HomeKit exposure through the main accessory flow
13
+ - T9 and T10 room sensors exposed as separate accessories when enabled
14
+ - T9 and T10 room-priority virtual thermostat accessories when configured
15
+ - Leak detectors
16
+ - Shutoff valves
64
17
 
65
- ### Testing and Validation
66
- - `npm test` -- runs linting only (not unit tests). Takes ~3 seconds.
67
- - `npm run lint` -- runs ESLint on TypeScript files. Takes ~3 seconds.
68
- - `npm run lint:fix` -- auto-fixes ESLint issues where possible.
69
- - `npx vitest run` -- runs actual unit tests. Takes ~1 second. **NOTE**: Some tests currently fail due to pre-existing mocking issues in platform.test.ts and a rounding issue in utils.test.ts. These failures are unrelated to code changes and should be ignored.
18
+ ### Device Classes Seen In Code
19
+ - `Thermostat`
20
+ - `LeakDetector`
21
+ - `ShutoffValve`
70
22
 
71
- ### Documentation Generation
72
- - `npm run docs` -- generates TypeDoc documentation. Takes ~6 seconds. Creates ./docs directory.
73
- - `npm run lint-docs` -- validates documentation for errors.
23
+ ### Important Notes
24
+ - This repository is currently HAP-only. There is no Matter platform implementation in this codebase.
25
+ - Room sensors are discovered from thermostat group data, not as top-level standalone devices.
26
+ - Unsupported devices are logged from `src/platform.ts` and should be added through the platform discovery switch plus a dedicated device class.
74
27
 
75
- ### Development Workflow
76
- - `npm run watch` -- development mode with nodemon for auto-rebuilding during development.
77
- - Build output is in `dist/` directory and mirrors `src/` structure.
78
- - The main plugin entry point is `dist/index.js` which exports the platform registration function.
79
- - **Always work on beta branches**: PRs should target beta branches, never main/latest directly.
80
- - **Use semantic versioning**: Ensure the target beta branch matches the change type (patch/minor/major).
28
+ ## Homebridge and API Integration
81
29
 
82
- ## Validation Scenarios
30
+ ### Platform Model
31
+ - The plugin registers a single dynamic platform through `ResideoPlatform` in `src/platform.ts`.
32
+ - `src/index.ts` only registers the platform and contains no business logic.
33
+ - Device discovery happens after `didFinishLaunching`, once an access token is refreshed.
83
34
 
84
- After making changes to the codebase, always perform these validation steps:
35
+ ### OAuth Flow
36
+ - The Homebridge UI custom server in `src/homebridge-ui/server.ts` starts a temporary local HTTP server on port `8585`.
37
+ - The UI redirects the user to the Resideo authorize endpoint, receives the authorization code, and exchanges it for tokens.
38
+ - The platform refreshes the access token at runtime and writes back a new refresh token into Homebridge `config.json` when it changes.
85
39
 
86
- ### Build Validation
87
- - Run `npm run build` to ensure TypeScript compilation succeeds.
88
- - Verify that `dist/index.js` exists and can be loaded with: `node -e "const plugin = require('./dist/index.js'); console.log('Plugin loaded:', typeof plugin.default === 'function');"`
40
+ ### Authoritative References
41
+ - Resideo developer setup in `README.md`
42
+ - OAuth and API endpoints in `src/settings.ts`
43
+ - Homebridge schema and UI behavior in `config.schema.json` and `src/homebridge-ui/server.ts`
89
44
 
90
- ### Code Quality Validation
91
- - ALWAYS run `npm run lint` before committing changes or the CI will fail.
92
- - Run `npm run lint:fix` to automatically fix style issues.
93
- - Optionally run `npx vitest run` but ignore pre-existing test failures in platform.test.ts and utils.test.ts.
45
+ ## Changelog Format Requirements
94
46
 
95
- ### Manual Testing Scenarios
96
- Since this is a Homebridge plugin that requires real Resideo devices and API credentials:
97
- - **Cannot fully test device functionality** without valid Resideo developer account and actual devices.
98
- - **Cannot test OAuth flow** without proper Resideo API credentials.
99
- - **Can test**: Plugin loading, configuration schema validation, and basic TypeScript compilation.
100
- - **Plugin Architecture Validation**: The built plugin should export a default function that accepts an API parameter for Homebridge platform registration.
47
+ When generating a changelog entry for this repository, always use the homebridge-resideo compare URLs, not another plugin's URLs.
101
48
 
102
- ## Codebase Navigation
49
+ Use this release header format:
103
50
 
104
- ### Key Directories and Files
51
+ ```md
52
+ ## [X.Y.Z](https://github.com/homebridge-plugins/homebridge-resideo/compare/vX.Y.(Z-1)...vX.Y.Z) (YYYY-MM-DD)
105
53
  ```
106
- /src/
107
- ├── index.ts # Main plugin entry point - registers platform with Homebridge
108
- ├── platform.ts # ResideoPlatform class - core plugin logic, API communication
109
- ├── settings.ts # Configuration interfaces, constants, and type definitions
110
- ├── utils.ts # Utility functions (temperature conversion, etc.)
111
- ├── devices/ # Device-specific implementations
112
- │ ├── device.ts # Base device class with common functionality
113
- │ ├── thermostats.ts # Thermostat device implementation
114
- │ ├── leaksensors.ts # Leak sensor device implementation
115
- │ ├── roomsensors.ts # Room sensor device implementation
116
- │ ├── roomsensorthermostats.ts # Room sensor thermostat combo
117
- │ └── valve.ts # Valve device implementation
118
- └── homebridge-ui/ # Web UI for plugin configuration
119
- ├── server.ts # UI server for OAuth setup
120
- └── public/index.html # UI frontend
54
+
55
+ Use standard sections as needed, such as `### Bug Fixes`, `### Enhancements`, or `### Documentation`.
56
+
57
+ End each release entry with:
58
+
59
+ ```md
60
+ **Full Changelog**: https://github.com/homebridge-plugins/homebridge-resideo/compare/vX.Y.(Z-1)...vX.Y.Z
121
61
  ```
122
62
 
123
- ### Configuration and Build Files
124
- - `package.json` -- dependencies, scripts, and plugin metadata
125
- - `tsconfig.json` -- TypeScript compilation settings
126
- - `eslint.config.js` -- ESLint configuration using @antfu/eslint-config
127
- - `config.schema.json` -- Homebridge configuration UI schema
128
- - `.github/workflows/build.yml` -- CI/CD pipeline
129
-
130
- ### Key Code Patterns
131
- - **Platform Registration**: `src/index.ts` exports default function that calls `api.registerPlatform()`
132
- - **Device Discovery**: `platform.ts` contains `discoverlocations()` and device creation methods
133
- - **API Communication**: Uses axios with interceptors for OAuth2 authentication to Resideo APIs
134
- - **Device Classes**: All inherit from base `device.ts` class with common logging and status methods
135
- - **Configuration**: TypeScript interfaces in `settings.ts` define all config structure
136
-
137
- ## Common Tasks
138
-
139
- ### Beta Branch Workflow
140
- 1. **Check for Semantic Labels**: Verify issue has `patch`, `minor`, or `major` label
141
- 2. **Identify Target Branch**: Find or create appropriate beta branch (e.g., `beta-3.0.3`, `beta-3.1.0`, `beta-4.0.0`)
142
- 3. **Create Feature Branch**: Create your feature branch from the target beta branch
143
- 4. **Submit PR**: Target your PR to the beta branch, not main/latest
144
- 5. **Merge to Main**: Beta branches are later merged to main/latest by maintainers
145
-
146
- ### Adding New Device Types
147
- 1. Create new device class in `src/devices/` extending base Device class
148
- 2. Add device-specific interfaces to `settings.ts`
149
- 3. Update `platform.ts` device discovery logic
150
- 4. Add device creation method in platform.ts
151
- 5. Update configuration schema in `config.schema.json`
152
-
153
- ### Modifying API Communication
154
- - API endpoints and authentication logic are in `platform.ts`
155
- - OAuth2 configuration and token management handled in platform constructor
156
- - Resideo API URLs defined as constants in `settings.ts`
157
-
158
- ### Configuration Changes
159
- - Update interfaces in `settings.ts` for new config options
160
- - Modify `config.schema.json` for UI schema changes
161
- - Update platform config validation in `platform.ts` `verifyConfig()` method
162
-
163
- ### Debugging and Logging
164
- - All device classes inherit logging methods from base Device class
165
- - Platform logging controlled by config options
166
- - Use `this.debugLog()`, `this.infoLog()`, `this.warnLog()`, `this.errorLog()` in device classes
167
- - Platform-level logging available via platform instance methods
168
-
169
- ## Troubleshooting
170
-
171
- ### Build Issues
172
- - **TypeScript errors**: Check `tsconfig.json` settings and ensure all imports use `.js` extensions for ES modules
173
- - **Missing dist files**: Run `npm run clean && npm run build` to regenerate
174
- - **Plugin UI missing**: Ensure `npm run plugin-ui` completes successfully
175
-
176
- ### Test Failures
177
- - **Platform tests failing**: Known issue with axios mocking in platform.test.ts - ignore these failures
178
- - **Utils test failures**: Known rounding issue in temperature conversion - ignore this failure
179
- - **New test failures**: Only address test failures directly related to your changes
180
-
181
- ### Runtime Issues
182
- - **Plugin not loading**: Verify `dist/index.js` exists and exports default function
183
- - **API authentication**: Check that OAuth2 credentials are properly configured
184
- - **Device discovery**: Ensure Resideo API endpoints in `settings.ts` are correct
185
-
186
- ### Common npm Commands Reference
187
- ```bash
188
- npm install # Install dependencies (~30 seconds)
189
- npm run build # Full build (~5 seconds, timeout 60+ seconds)
190
- npm run clean # Clean dist directory (<1 second)
191
- npm test # Run linting (~3 seconds)
192
- npm run lint # ESLint only (~3 seconds)
193
- npm run lint:fix # Auto-fix ESLint issues
194
- npm run docs # Generate documentation (~6 seconds)
195
- npx vitest run # Run unit tests (~1 second, has known failures)
196
- npm run watch # Development mode with auto-rebuild
63
+ If the previous version is not known, inspect `CHANGELOG.md` before drafting the entry.
64
+
65
+ ## Working Effectively
66
+
67
+ ### Bootstrap and Build
68
+ - Install dependencies: `npm install`
69
+ - Build the project: `npm run build`
70
+ - Clean build artifacts: `npm run clean`
71
+ - Copy the Homebridge UI file into `dist`: `npm run plugin-ui`
72
+ - Full publish pipeline: `npm run prepublishOnly`
73
+
74
+ ### Testing and Quality Assurance
75
+ - Lint code: `npm run lint`
76
+ - Fix lint issues: `npm run lint:fix`
77
+ - Package `test` currently aliases lint: `npm run test` runs `npm run lint`
78
+ - Vitest is installed and test files exist under `src/`, but there is no dedicated `package.json` script for them right now
79
+ - Generate docs: `npm run docs`
80
+ - Validate docs: `npm run lint-docs`
81
+
82
+ ### Development Workflow
83
+ - Development mode: `npm run watch`
84
+ - `npm run watch` builds, copies the UI file, links the plugin locally, and starts `nodemon`
85
+ - The Homebridge UI is backed by a single static file at `src/homebridge-ui/public/index.html`
86
+ - Always run `npm run build` after source changes
87
+ - Always run `npm run lint` before finishing a code change
88
+
89
+ ## Validation
90
+
91
+ After making code changes, validate with:
92
+ 1. `npm run build`
93
+ 2. `npm run lint`
94
+ 3. `npm run test`
95
+
96
+ If you changed generated-doc comments or documentation-sensitive types, also run:
97
+ 4. `npm run docs`
98
+ 5. `npm run lint-docs`
99
+
100
+ If you changed the UI login flow, also validate the Homebridge UI account-linking path.
101
+
102
+ ## Important Directories and Files
103
+
104
+ ### Source Code Structure
105
+ - `src/index.ts` - Homebridge entry point
106
+ - `src/platform.ts` - Main platform, OAuth refresh, discovery, accessory registration, retry and logging behavior
107
+ - `src/settings.ts` - Plugin constants, config types, API URLs, and device-related TypeScript interfaces
108
+ - `src/utils.ts` - Utility helpers such as temperature conversion
109
+ - `src/devices/thermostats.ts` - Thermostat accessory implementation
110
+ - `src/devices/roomsensors.ts` - Room sensor accessory implementation
111
+ - `src/devices/roomsensorthermostats.ts` - Virtual thermostat accessory for room-priority flows
112
+ - `src/devices/leaksensors.ts` - Leak sensor accessory implementation
113
+ - `src/devices/valve.ts` - Shutoff valve accessory implementation
114
+ - `src/homebridge-ui/server.ts` - Custom Homebridge UI backend server for OAuth login
115
+ - `src/homebridge-ui/public/index.html` - Custom Homebridge UI frontend
116
+
117
+ ### Tests
118
+ - `src/index.test.ts`
119
+ - `src/platform.test.ts`
120
+ - `src/settings.test.ts`
121
+ - `src/utils.test.ts`
122
+
123
+ ### Configuration and Build
124
+ - `package.json`
125
+ - `config.schema.json`
126
+ - `eslint.config.js`
127
+ - `tsconfig.json`
128
+ - `typedoc.json`
129
+ - `nodemon.json`
130
+ - `.github/copilot-instructions.md`
131
+
132
+ ### Generated Output
133
+ - `dist/`
134
+ - `docs/`
135
+
136
+ ## Dependencies and Requirements
137
+
138
+ ### Runtime Requirements
139
+ - Node.js `^20 || ^22`
140
+ - Homebridge `^1.9.0 || ^2.0.0 || ^2.0.0-beta.26 || ^2.0.0-alpha.37`
141
+
142
+ ### Key Runtime Dependencies
143
+ - `axios` for Resideo API requests
144
+ - `rxjs` for reactive flows used by device code
145
+ - `@homebridge/plugin-ui-utils` for the Homebridge settings UI server
146
+
147
+ ### Key Development Dependencies
148
+ - `typescript`
149
+ - `eslint`
150
+ - `@antfu/eslint-config`
151
+ - `typedoc`
152
+ - `vitest`
153
+ - `nodemon`
154
+
155
+ ## Common Development Tasks
156
+
157
+ ### Adding New Device Support
158
+ 1. Add the device class handling in the discovery switch in `src/platform.ts`.
159
+ 2. Create a new implementation under `src/devices/` following the existing accessory classes.
160
+ 3. Update `config.schema.json` if the new device requires user-configurable options.
161
+ 4. Add or update TypeScript types in `src/settings.ts`.
162
+ 5. Make sure cached accessories use a stable UUID pattern.
163
+ 6. Validate with `npm run build`, `npm run lint`, and `npm run test`.
164
+
165
+ ### Changing Thermostat or Sensor Behavior
166
+ 1. Start in `src/platform.ts` to find the controlling discovery and refresh path.
167
+ 2. Move into the owning class in `src/devices/thermostats.ts`, `src/devices/roomsensors.ts`, or `src/devices/roomsensorthermostats.ts`.
168
+ 3. Keep room sensor logic aligned with the thermostat group APIs used by `getCurrentSensorData()`.
169
+ 4. Preserve per-device config overrides from `options.devices`.
170
+
171
+ ### Changing the OAuth or UI Flow
172
+ 1. Update the frontend in `src/homebridge-ui/public/index.html`.
173
+ 2. Update the backend server in `src/homebridge-ui/server.ts`.
174
+ 3. Keep the callback path and port handling aligned with the README and schema.
175
+ 4. Rebuild so the UI file is copied to `dist`.
176
+
177
+ ## Common Issues and Solutions
178
+
179
+ ### Build Failures
180
+ - Verify dependencies are installed with `npm install`.
181
+ - Rebuild from clean state with `npm run clean && npm run build`.
182
+ - Remember this project is ESM and local imports use `.js` extensions.
183
+
184
+ ### Test Confusion
185
+ - `npm run test` is not a separate unit-test command in this repo; it currently runs lint.
186
+ - If you need to execute Vitest directly, use the local toolchain already present in the repo rather than inventing a new workflow.
187
+
188
+ ### OAuth and Login Failures
189
+ - Re-check the Resideo developer app callback URL and credentials.
190
+ - Confirm the temporary local server can bind to port `8585`.
191
+ - If token refresh fails, inspect the stored credentials in Homebridge config and the refresh-token update path in `src/platform.ts`.
192
+
193
+ ### Device Discovery Gaps
194
+ - Discovery is location-based through the Resideo API.
195
+ - Room sensors depend on thermostat groups and will not appear unless the thermostat and group data support them.
196
+ - Unsupported `deviceClass` values require new platform handling and a dedicated accessory implementation.
197
+
198
+ Never describe this repository as a Lutron plugin, never mention Matter support as if it exists today, and never reference files such as `Platform.Matter.ts`, `WallDimmer.ts`, `PicoRemote.ts`, or other artifacts that are not present in this workspace.
199
+
200
+ ## Matter and HomeKit Integration
201
+
202
+ ### Matter Implementation
203
+ The plugin implements dual-mode device registration:
204
+ - **HAP mode** (HomeKit Accessory Protocol): Base implementation via `LutronCasetaLeap` class
205
+ - **Matter mode**: Extended via `LutronCasetaLeapMatterPlatform` class that overrides `processDevice()`
206
+
207
+ When Homebridge's Matter API is available, `LutronCasetaLeapMatterPlatform.processDevice()` registers accessories with both HAP and Matter simultaneously. If Matter API is not available, the plugin transparently falls back to HAP-only mode.
208
+
209
+ ### Matter Device Type Mapping
210
+ All Matter device types use `api.matter.deviceTypes.*` objects from the homebridge-matter API:
211
+
212
+ | Device Type | HAP Service | Matter DeviceType | Matter Clusters |
213
+ |---|---|---|---|
214
+ | WallDimmer | Lightbulb | `DimmableLight` | onOff, levelControl |
215
+ | WallSwitch | Switch | `OnOffLight` | onOff |
216
+ | SerenaTiltOnlyWoodBlind | WindowCovering | `WindowCovering` | windowCovering |
217
+ | RPSOccupancySensor | OccupancySensor | `OccupancySensor` | occupancySensing |
218
+ | Pico Remotes | StatelessProgrammableSwitch | `GenericSwitch` | switch |
219
+
220
+ ### Authoritative Matter References
221
+
222
+ 1. https://matter-js.github.io/docs/index.html
223
+ 2. https://github.com/homebridge-plugins/homebridge-matter: Official Homebridge Matter plugin repository with extensive documentation and examples
224
+ - For all Matter cluster, attribute, and device type specifications, use the official homebridge-matter wiki:
225
+ - [Introduction](https://github.com/homebridge-plugins/homebridge-matter/wiki/Introduction)
226
+ - [Core Concepts](https://github.com/homebridge-plugins/homebridge-matter/wiki/Core-Concepts)
227
+ - [Getting Started](https://github.com/homebridge-plugins/homebridge-matter/wiki/Getting-Started)
228
+ - [State Management](https://github.com/homebridge-plugins/homebridge-matter/wiki/State-Management)
229
+ - [Monitoring External Changes](https://github.com/homebridge-plugins/homebridge-matter/wiki/Monitoring-External-Changes)
230
+ - [Best Practices](https://github.com/homebridge-plugins/homebridge-matter/wiki/Best-Practices)
231
+ - [Advanced Patterns](https://github.com/homebridge-plugins/homebridge-matter/wiki/Advanced-Patterns)
232
+ - [API Reference](https://github.com/homebridge-plugins/homebridge-matter/wiki/API-Reference)
233
+ - [Matter Types](https://github.com/homebridge-plugins/homebridge-matter/wiki/Matter-Types)
234
+ - [Value Conversions](https://github.com/homebridge-plugins/homebridge-matter/wiki/Value-Conversions)
235
+
236
+ - **Device References:**
237
+ - [Lighting Devices (§4)](https://github.com/homebridge-plugins/homebridge-matter/wiki/Section-4-Lighting) — DimmableLight, OnOffLight
238
+ - [Switches (§6)](https://github.com/homebridge-plugins/homebridge-matter/wiki/Section-6-Switches) — OnOffSwitch
239
+ - [Sensors (§7)](https://github.com/homebridge-plugins/homebridge-matter/wiki/Section-7-Sensors) — OccupancySensor
240
+ - [Closure Devices (§8)](https://github.com/homebridge-plugins/homebridge-matter/wiki/Section-8-Closure) — WindowCovering
241
+
242
+ ## Changelog Format Requirements
243
+
244
+ When generating a changelog release entry, always use this exact structure:
245
+
246
+ 1. Release header with compare URL using `compare/tag/vX.Y.Z`:
247
+
248
+ ```md
249
+ ## [X.Y.Z](https://github.com/homebridge-plugins/homebridge-updater/compare/tag/vX.Y.Z) (YYYY-MM-DD)
250
+ ```
251
+
252
+ 2. Standard sections as needed (`### Bug Fixes`, `### Enhancements`, `### Documentation`, etc.).
253
+
254
+ 3. End each release entry with a full changelog comparison URL to the previous version:
255
+
256
+ ```md
257
+ **Full Changelog**: https://github.com/homebridge-plugins/homebridge-updater/compare/vX.Y.(Z-1)...vX.Y.Z
197
258
  ```
198
259
 
199
- ## Critical Reminders
200
- - **NEVER CANCEL** any build commands - let them complete fully
201
- - **ALWAYS** run `npm run lint` before pushing changes to avoid CI failures
202
- - **DO NOT** attempt to fix pre-existing test failures unrelated to your changes
203
- - **VALIDATE** that your changes can be built and the plugin can be loaded
204
- - Use `.js` extensions in TypeScript imports for ES module compatibility
260
+ Do not omit either URL line when creating a new release entry.
@@ -20,9 +20,9 @@ dependencies:
20
20
  - any-glob-to-any-file: 'package.json'
21
21
  - any-glob-to-any-file: 'package-lock.json'
22
22
 
23
- # Add 'beta' label to any PR that is opened against a beta branch (beta-X.Y.Z format)
23
+ # Add 'beta' label to any PR that is opened against the `beta` branch
24
24
  beta:
25
- - base-branch: 'beta-*'
25
+ - base-branch: 'beta*'
26
26
 
27
27
  # Add 'alpha' label to any PR that is opened against the `alpha` branch
28
28
  alpha:
@@ -35,15 +35,4 @@ latest:
35
35
  # Add 'workflow' to any changes within 'workflow' folder or any subfolders
36
36
  workflow:
37
37
  - changed-files:
38
- - any-glob-to-any-file: .github/**
39
-
40
- # Semantic versioning labels for automated release management
41
- # These labels should be manually applied before assigning issues to Copilot
42
- patch:
43
- - any: [] # Manual assignment only
44
-
45
- minor:
46
- - any: [] # Manual assignment only
47
-
48
- major:
49
- - any: [] # Manual assignment only
38
+ - any-glob-to-any-file: .github/**