homebridge-carrier-infinity 1.8.0 → 1.8.1

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.
@@ -0,0 +1,211 @@
1
+ # Devcontainer Development Environment
2
+
3
+ This directory contains configuration for a complete Homebridge development environment that runs in GitHub Codespaces or VS Code devcontainers.
4
+
5
+ ## What Happens Automatically
6
+
7
+ ### On Container Creation (First Time)
8
+ The setup script ([setup-homebridge.sh](setup-homebridge.sh)) automatically:
9
+ - Installs Homebridge, Homebridge Config UI X, and pm2 globally
10
+ - Creates `~/.homebridge/` directory structure
11
+ - Copies [config.json.example](config.json.example) to `~/.homebridge/config.json`
12
+ - Installs project dependencies
13
+ - Builds the plugin
14
+ - Symlinks the plugin to `~/.homebridge/node_modules/`
15
+
16
+ ### On Every Container Start
17
+ The startup script ([start-homebridge.sh](start-homebridge.sh)) automatically:
18
+ - Starts Homebridge and Config UI via `hb-service` managed by `pm2`
19
+ - pm2 keeps the process running persistently (auto-restart on crashes)
20
+ - Verifies the UI is accessible on port 8581
21
+ - Displays status information
22
+
23
+ **Result**: When you open the codespace, Homebridge is already running under pm2 and will persist!
24
+
25
+ ## Quick Start
26
+
27
+ ### 1. Configure Credentials
28
+ Edit your Carrier Infinity credentials:
29
+
30
+ **Option A** - Via Config UI (easiest):
31
+ - Open http://localhost:8581 (credentials: admin/admin)
32
+ - Navigate to the CarrierInfinity platform settings
33
+ - Update username and password
34
+
35
+ **Option B** - Via command line:
36
+ ```bash
37
+ nano ~/.homebridge/config.json
38
+ ```
39
+
40
+ ### 2. Development Workflow
41
+
42
+ **Automatic rebuild** (recommended):
43
+ ```bash
44
+ npm run watch
45
+ ```
46
+ This watches for file changes and rebuilds automatically.
47
+
48
+ **After making changes**:
49
+ ```bash
50
+ # Restart Homebridge to pick up plugin changes
51
+ pm2 restart homebridge
52
+ ```
53
+
54
+ ## Configuration Files
55
+
56
+ | File | Purpose |
57
+ |------|---------|
58
+ | **devcontainer.json** | Main devcontainer configuration |
59
+ | **setup-homebridge.sh** | One-time setup script (runs on container creation) |
60
+ | **start-homebridge.sh** | Startup script (runs on every container start) |
61
+ | **stop-homebridge.sh** | Stop Homebridge (pm2 delete) |
62
+ | **config.json.example** | Template Homebridge configuration |
63
+
64
+ ### devcontainer.json Features
65
+ - Base image: Node.js 22 (TypeScript)
66
+ - Auto-installs VS Code extensions (Claude Code, ESLint, Copilot, Jest, etc.)
67
+ - Forwards port 8581 (Homebridge Config UI)
68
+ - Runs setup on creation, starts Homebridge on every startup
69
+
70
+ ## Useful Commands
71
+
72
+ ### Homebridge Management
73
+ ```bash
74
+ # Check Homebridge status (managed by pm2)
75
+ pm2 status
76
+
77
+ # View live logs
78
+ pm2 logs homebridge
79
+
80
+ # View Homebridge log file
81
+ tail -f ~/.homebridge/homebridge.log
82
+
83
+ # Restart Homebridge
84
+ pm2 restart homebridge
85
+
86
+ # Stop Homebridge (will auto-start on next codespace start)
87
+ pm2 stop homebridge
88
+ # Or permanently remove:
89
+ .devcontainer/stop-homebridge.sh
90
+
91
+ # Start Homebridge manually (if stopped)
92
+ .devcontainer/start-homebridge.sh
93
+
94
+ # View pm2 process info
95
+ pm2 info homebridge
96
+ ```
97
+
98
+ ### Plugin Development
99
+ ```bash
100
+ # Build plugin
101
+ npm run build
102
+
103
+ # Auto-rebuild on changes (recommended)
104
+ npm run watch
105
+
106
+ # Relink plugin manually (if needed)
107
+ npm run relink
108
+ # or
109
+ ln -sf $(pwd) ~/.homebridge/node_modules/homebridge-carrier-infinity
110
+
111
+ # Run tests
112
+ npm test
113
+
114
+ # Lint code
115
+ npm run lint
116
+ ```
117
+
118
+ ### Accessing Homebridge Config UI
119
+ - **URL**: http://localhost:8581 (auto-forwarded in VS Code)
120
+ - **Default credentials**: admin/admin
121
+ - Click the "Ports" tab in VS Code to open directly
122
+
123
+ ## Debugging Tips
124
+
125
+ 1. **Check plugin is loaded**: Look for "Loaded plugin: homebridge-carrier-infinity" in logs
126
+ 2. **Check platform is registered**: Look for "Loading platform: CarrierInfinity"
127
+ 3. **API errors**: Check `~/.homebridge/homebridge.log` for debug output
128
+ 4. **Config issues**: Homebridge will log validation errors on startup
129
+
130
+ ### Common Issues
131
+
132
+ **Plugin not loading**:
133
+ ```bash
134
+ # Verify plugin is linked
135
+ ls -la ~/.homebridge/node_modules/homebridge-carrier-infinity
136
+
137
+ # Rebuild and relink
138
+ npm run build && npm run relink
139
+ ```
140
+
141
+ **Homebridge not starting**:
142
+ ```bash
143
+ # Check pm2 status
144
+ pm2 status
145
+
146
+ # Check logs for errors
147
+ pm2 logs homebridge --lines 50
148
+
149
+ # Or check Homebridge log file
150
+ tail -n 50 ~/.homebridge/homebridge.log
151
+
152
+ # Restart via pm2
153
+ pm2 restart homebridge
154
+
155
+ # Or restart via script (stops and starts fresh)
156
+ pm2 delete homebridge
157
+ .devcontainer/start-homebridge.sh
158
+ ```
159
+
160
+ ## Environment Details
161
+
162
+ - **Homebridge config**: `~/.homebridge/config.json`
163
+ - **Homebridge storage**: `~/.homebridge/`
164
+ - **Plugin source**: `/workspaces/homebridge-carrier-infinity`
165
+ - **Node version**: 22.x
166
+ - **Homebridge version**: Latest
167
+ - **Config UI version**: Latest
168
+
169
+ ## Persistence
170
+
171
+ The following persists across codespace rebuilds:
172
+ - `~/.homebridge/config.json` (your configuration)
173
+ - `~/.homebridge/` directory (accessories, cache, persist data)
174
+
175
+ The plugin code is always from your working directory, so changes are reflected immediately after rebuild + restart.
176
+
177
+ ## VS Code Extensions
178
+
179
+ The following extensions are automatically installed:
180
+ - **Claude Code**: AI coding assistant
181
+ - **ESLint**: Linting and formatting
182
+ - **GitHub Copilot**: AI code completion
183
+ - **Jest**: Test runner integration
184
+ - **GitHub Actions**: Workflow management
185
+
186
+ ## Advanced Usage
187
+
188
+ ### Running Multiple Instances
189
+
190
+ To test different configurations:
191
+ ```bash
192
+ # Stop pm2-managed instance
193
+ pm2 stop homebridge
194
+
195
+ # Run with custom config
196
+ homebridge -D -U /path/to/custom/homebridge/directory
197
+ ```
198
+
199
+ ### Debugging with Breakpoints
200
+
201
+ 1. Stop the pm2-managed Homebridge: `pm2 stop homebridge`
202
+ 2. Use VS Code's debugger to start Homebridge
203
+ 3. Set breakpoints in your plugin code
204
+
205
+ ### Manual Testing
206
+
207
+ ```bash
208
+ # Test specific API endpoints
209
+ npm run build
210
+ node -e "require('./dist/api/rest_client.js')"
211
+ ```
@@ -0,0 +1,27 @@
1
+ {
2
+ "bridge": {
3
+ "name": "Homebridge Dev",
4
+ "username": "CC:22:3D:E3:CE:30",
5
+ "port": 51826,
6
+ "pin": "031-45-154"
7
+ },
8
+ "accessories": [],
9
+ "platforms": [
10
+ {
11
+ "name": "Config",
12
+ "port": 8581,
13
+ "platform": "config"
14
+ },
15
+ {
16
+ "platform": "CarrierInfinity",
17
+ "name": "Carrier Infinity",
18
+ "username": "YOUR_CARRIER_USERNAME",
19
+ "password": "YOUR_CARRIER_PASSWORD",
20
+ "holdBehavior": "forever",
21
+ "showOutdoorTemperatureSensor": false,
22
+ "showFanControl": false,
23
+ "showIndoorHumiditySensors": false,
24
+ "showZoneComfortActivityControls": false
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "Homebridge Carrier Infinity Dev",
3
+ "image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
4
+
5
+ "features": {
6
+ "ghcr.io/devcontainers/features/github-cli:1": {},
7
+ "ghcr.io/devcontainers/features/git:1": {}
8
+ },
9
+
10
+ "customizations": {
11
+ "vscode": {
12
+ "extensions": [
13
+ "anthropic.claude-code",
14
+ "dbaeumer.vscode-eslint",
15
+ "github.copilot",
16
+ "github.copilot-chat",
17
+ "github.github-vscode-theme",
18
+ "github.vscode-github-actions",
19
+ "github.vscode-pull-request-github",
20
+ "ms-vscode.vscode-typescript-next",
21
+ "orta.vscode-jest"
22
+ ],
23
+ "settings": {
24
+ "editor.formatOnSave": true,
25
+ "editor.defaultFormatter": "dbaeumer.vscode-eslint",
26
+ "editor.codeActionsOnSave": {
27
+ "source.fixAll.eslint": "explicit"
28
+ },
29
+ "eslint.validate": [
30
+ "typescript"
31
+ ],
32
+ "typescript.tsdk": "node_modules/typescript/lib"
33
+ }
34
+ }
35
+ },
36
+
37
+ "postCreateCommand": "chmod +x .devcontainer/setup-homebridge.sh && .devcontainer/setup-homebridge.sh",
38
+
39
+ "postStartCommand": "chmod +x .devcontainer/start-homebridge.sh && .devcontainer/start-homebridge.sh",
40
+
41
+ "forwardPorts": [8581],
42
+
43
+ "portsAttributes": {
44
+ "8581": {
45
+ "label": "Homebridge UI",
46
+ "onAutoForward": "notify"
47
+ }
48
+ },
49
+
50
+ "remoteUser": "node",
51
+
52
+ "mounts": [
53
+ "source=${localEnv:HOME}${localEnv:USERPROFILE}/.gitconfig,target=/home/node/.gitconfig,type=bind,consistency=cached"
54
+ ]
55
+ }
@@ -0,0 +1,45 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "Setting up Homebridge development environment..."
5
+
6
+ # Install Homebridge and pm2 globally
7
+ echo "Installing Homebridge and pm2..."
8
+ sudo npm install -g --unsafe-perm homebridge homebridge-config-ui-x pm2
9
+
10
+ # Create Homebridge directory structure
11
+ echo "Creating Homebridge directory structure..."
12
+ mkdir -p ~/.homebridge
13
+
14
+ # Create default config if it doesn't exist
15
+ if [ ! -f ~/.homebridge/config.json ]; then
16
+ echo "Creating Homebridge config from example..."
17
+ cp .devcontainer/config.json.example ~/.homebridge/config.json
18
+ fi
19
+
20
+ # Install project dependencies
21
+ echo "Installing project dependencies..."
22
+ npm install
23
+
24
+ # Build the plugin
25
+ echo "Building plugin..."
26
+ npm run build
27
+
28
+ # Link the plugin to Homebridge
29
+ echo "Linking plugin to Homebridge..."
30
+ PLUGIN_PATH="$(pwd)"
31
+ HOMEBRIDGE_PATH="$HOME/.homebridge/node_modules"
32
+ PLUGIN_NAME="homebridge-carrier-infinity"
33
+
34
+ mkdir -p "$HOMEBRIDGE_PATH"
35
+ ln -sf "$PLUGIN_PATH" "$HOMEBRIDGE_PATH/$PLUGIN_NAME"
36
+
37
+ echo ""
38
+ echo "✅ Homebridge development environment setup complete!"
39
+ echo ""
40
+ echo "Quick start:"
41
+ echo " 1. Edit ~/.homebridge/config.json to add your Carrier credentials"
42
+ echo " 2. Homebridge will start automatically on codespace startup"
43
+ echo " - Access Config UI at http://localhost:8581 (credentials: admin/admin)"
44
+ echo " 3. Run 'npm run watch' for auto-rebuild on code changes"
45
+ echo ""
@@ -0,0 +1,29 @@
1
+ #!/bin/bash
2
+ # Start Homebridge and Config UI automatically using pm2
3
+ # This script is run by the devcontainer postStartCommand
4
+
5
+ echo "Starting Homebridge and Config UI with pm2..."
6
+
7
+ # Stop any existing instance (in case of restart)
8
+ pm2 delete homebridge 2>/dev/null || true
9
+
10
+ # Start hb-service using pm2
11
+ pm2 start hb-service --name homebridge -- run -U ~/.homebridge
12
+
13
+ # Save pm2 process list
14
+ pm2 save
15
+
16
+ # Wait a moment for startup
17
+ sleep 3
18
+
19
+ # Check if it's running
20
+ if curl -s http://localhost:8581 > /dev/null 2>&1; then
21
+ echo "✅ Homebridge and Config UI started successfully!"
22
+ echo " - Homebridge UI: http://localhost:8581"
23
+ echo " - Default credentials: admin/admin"
24
+ echo " - Logs: pm2 logs homebridge"
25
+ echo " - Status: pm2 status"
26
+ else
27
+ echo "⚠️ Homebridge may still be starting..."
28
+ echo " Check logs: pm2 logs homebridge"
29
+ fi
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ # Stop Homebridge managed by pm2
3
+
4
+ echo "Stopping Homebridge..."
5
+ pm2 delete homebridge
6
+
7
+ echo "✅ Homebridge stopped"
package/CLAUDE.md ADDED
@@ -0,0 +1,179 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ This is a Homebridge plugin for Carrier Infinity / Bryant Evolution / ICP Brands Ion thermostats. It communicates directly with the Carrier/Bryant cloud API (not requiring Infinitude/Infinitive) and exposes thermostat controls, sensors, and activities to HomeKit.
8
+
9
+ ## Development Commands
10
+
11
+ ```bash
12
+ # Build the plugin
13
+ npm run build
14
+
15
+ # Lint code (must have 0 warnings)
16
+ npm run lint
17
+
18
+ # Run tests
19
+ npm test
20
+
21
+ # Watch mode (auto-rebuild and relink to local Homebridge)
22
+ npm run watch
23
+
24
+ # Relink plugin to local Homebridge instance
25
+ npm run relink
26
+
27
+ # Generate TypeScript interfaces from XML test data
28
+ npm run xml2ts
29
+ ```
30
+
31
+ ## Codespace/Devcontainer Development Environment
32
+
33
+ This repository includes a complete devcontainer configuration that automatically sets up a Homebridge development environment.
34
+
35
+ ### Automatic Setup
36
+
37
+ When the codespace is created, the setup script (`.devcontainer/setup-homebridge.sh`) automatically:
38
+ - Installs Homebridge, Homebridge Config UI X, and pm2 globally
39
+ - Creates `~/.homebridge/` directory structure
40
+ - Copies `.devcontainer/config.json.example` to `~/.homebridge/config.json`
41
+ - Installs project dependencies
42
+ - Builds the plugin
43
+ - Symlinks the plugin to `~/.homebridge/node_modules/`
44
+
45
+ ### Getting Started in Codespace
46
+
47
+ 1. **Homebridge starts automatically**: On codespace startup, Homebridge and Config UI start automatically via `hb-service` managed by `pm2`
48
+ - pm2 keeps the service running persistently (auto-restart on crashes)
49
+ - Access Config UI at http://localhost:8581 (port auto-forwarded)
50
+ - Default credentials: admin/admin
51
+ - Logs: `pm2 logs homebridge` or `~/.homebridge/homebridge.log`
52
+
53
+ 2. **Configure credentials**: Edit `~/.homebridge/config.json` with your Carrier Infinity username/password
54
+ - Config is pre-created from `.devcontainer/config.json.example` - just update credentials
55
+ - Can also edit via Config UI at http://localhost:8581
56
+
57
+ 3. **Development workflow**:
58
+ - Run `npm run watch` (auto-rebuild on changes)
59
+ - Restart Homebridge to pick up plugin changes: `pm2 restart homebridge`
60
+
61
+ For complete development environment documentation, commands, and debugging tips, see [.devcontainer/README.md](.devcontainer/README.md).
62
+
63
+ ### TypeScript Configuration
64
+ - Target: ES2018 (Node 10+)
65
+ - Output: `dist/` directory
66
+ - Uses experimental decorators (required for memoization and retry decorators)
67
+ - `noImplicitAny: false` is set in tsconfig
68
+
69
+ ## Architecture Overview
70
+
71
+ ### Plugin Entry Point
72
+ The plugin registers itself in [src/index.ts](src/index.ts) and implements the Homebridge `DynamicPlatformPlugin` interface via `CarrierInfinityHomebridgePlatform` in [src/platform.ts](src/platform.ts).
73
+
74
+ ### Core Components
75
+
76
+ #### 1. Platform ([src/platform.ts](src/platform.ts))
77
+ - Entry point that discovers systems and zones after Homebridge launches
78
+ - Maintains `infinity_client` (REST API client) and `systems` (indexed by serial number)
79
+ - Periodically activates the API every 30 minutes to maintain connection
80
+ - Creates accessories based on config options (outdoor temp sensor, humidity sensors, etc.)
81
+
82
+ #### 2. API Layer ([src/api/](src/api/))
83
+ - **InfinityRestClient** ([src/api/rest_client.ts](src/api/rest_client.ts)): OAuth-authenticated Axios client
84
+ - Handles authentication with username/password
85
+ - Automatic OAuth header injection via interceptor
86
+ - Token refresh with 24hr memoization
87
+ - Activation endpoint called every minute (with memoization)
88
+
89
+ - **Models** ([src/api/models.ts](src/api/models.ts)): BaseModel and specific models (LocationsModel, SystemModel, etc.)
90
+ - `BaseModel` provides fetch/push pattern with mutex locking to prevent race conditions
91
+ - Hash-based change detection (only pushes if data actually changed)
92
+ - 10-second memoization on fetch operations
93
+ - XML parsing via xml2js
94
+ - Models include: `LocationsModel`, `SystemModel` with nested `ConfigModel`, `ProfileModel`, `StatusModel`
95
+
96
+ - **Interface Files**: TypeScript interfaces auto-generated from XML samples in `testdata/` using the `xml2ts` script
97
+ - [src/api/interface_config.ts](src/api/interface_config.ts)
98
+ - [src/api/interface_profile.ts](src/api/interface_profile.ts)
99
+ - [src/api/interface_status.ts](src/api/interface_status.ts)
100
+ - [src/api/interface_locations.ts](src/api/interface_locations.ts)
101
+
102
+ #### 3. Accessories ([src/accessory_*.ts](src/))
103
+ All accessories extend `BaseAccessory` ([src/accessory_base.ts](src/accessory_base.ts)):
104
+ - Handles UUID generation and caching
105
+ - Uses `useService()` helper to find or create HAP services
106
+ - Each accessory type:
107
+ - **ThermostatAccessory**: Main thermostat control
108
+ - **OutdoorTemperatureAccessory**: Outdoor temp sensor (optional)
109
+ - **EnvSensorAccessory**: Indoor humidity sensor (optional)
110
+ - **ComfortActivityAccessory**: Touch-n-Go activity switches (optional)
111
+
112
+ #### 4. Characteristics ([src/characteristics_*.ts](src/))
113
+ The plugin uses a wrapper pattern to bind HomeKit characteristics to API data:
114
+ - **CharacteristicWrapper** ([src/characteristics_base.ts](src/characteristics_base.ts)): Abstract base class
115
+ - Each wrapper handles one characteristic (or multiple via `MultiWrapper`)
116
+ - Defines `get` and `set` async handlers
117
+ - `wrap()` method attaches handlers to HAP Service
118
+ - Automatic debouncing/batching of set operations
119
+ - Subscription-based push updates when API data changes
120
+
121
+ - Specific wrappers:
122
+ - `characteristics_ac.ts`: Heating/cooling characteristics
123
+ - `characteristics_fan.ts`: Fan mode and state
124
+ - `characteristics_humidity.ts`: Humidity sensing
125
+ - `characteristics_filter.ts`: Filter status
126
+
127
+ ### Key Patterns
128
+
129
+ #### OAuth Authentication
130
+ The API uses OAuth 1.0 with custom headers. See [src/api/oauth.ts](src/api/oauth.ts) for signature generation and [src/settings.ts](src/settings.ts) for consumer key/secret.
131
+
132
+ #### Memoization & Retry Decorators
133
+ - `@MemoizeExpiring(milliseconds)`: Caches method results for specified duration
134
+ - `@Retryable()`: Automatic retry with exponential backoff for network failures
135
+ - Both decorators from `typescript-memoize` and `typescript-retry-decorator` packages
136
+
137
+ #### Mutex Locking
138
+ API models use `async-mutex` to prevent concurrent fetch/push operations that could cause race conditions. The pattern:
139
+ ```typescript
140
+ await tryAcquire(this.write_lock).runExclusive(async () => {
141
+ // critical section
142
+ });
143
+ ```
144
+
145
+ #### Data Flow
146
+ 1. **Read**: Characteristic getter → Model.fetch() → API GET → XML parse → return value
147
+ 2. **Write**: Characteristic setter → batch changes → Model.push() → XML build → API PUT
148
+ 3. **Updates**: Periodic polling + hash comparison triggers characteristic updates via subscription pattern
149
+
150
+ #### Hold Behavior
151
+ The plugin supports multiple thermostat hold modes (forever, until next activity, for X hours, until time X) configured via `holdBehavior` and `holdArgument` in config.
152
+
153
+ ## Testing
154
+
155
+ - Test framework: Jest with ts-jest preset
156
+ - Test data: XML samples in `testdata/` directory
157
+ - Current tests: `src/helpers.spec.ts`
158
+ - Run: `npm test`
159
+
160
+ ## Code Style (ESLint)
161
+
162
+ - Single quotes, 2-space indent
163
+ - Max line length: 140 characters
164
+ - Spellcheck plugin with custom dictionary for domain terms (carrier, bryant, oauth, etc.)
165
+ - See [.eslintrc](.eslintrc) for full rules
166
+ - Must pass with 0 warnings for builds
167
+
168
+ ## Semantic Release
169
+
170
+ - Uses conventional commits (commitizen configured)
171
+ - Branches: `master` (next channel), `beta` (prerelease)
172
+ - Automated via GitHub Actions
173
+
174
+ ## Important Notes
175
+
176
+ - The API expects `activate()` calls regularly (~1 min), though more frequent doesn't help
177
+ - Changes from HomeKit can take 1-2 minutes to reach the physical thermostat due to polling architecture
178
+ - Node version requirement: >= 18
179
+ - Homebridge version: >= 1.2 or ^2.0.0-beta.0
@@ -0,0 +1,25 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb
3
+ MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
4
+ GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj
5
+ YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL
6
+ MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
7
+ BwwHU2FsZm9yZDEaMBg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A3raAVGI/6ugLOpyypEBMs1OUIJqsi
23
+ l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3
24
+ smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
25
+ -----END CERTIFICATE-----
@@ -1 +1 @@
1
- {"version":3,"file":"rest_client.d.ts","sourceRoot":"","sources":["../../src/api/rest_client.ts"],"names":[],"mappings":"AAIA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIpC,qBAAa,kBAAkB;IAKlB,QAAQ,EAAE,MAAM;IACvB,OAAO,CAAC,QAAQ;aACA,GAAG,EAAE,MAAM;IAN/B,OAAO,CAAC,YAAY,CAAM;IACnB,KAAK,EAAE,aAAa,CAAC;gBAGjB,QAAQ,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EACR,GAAG,EAAE,MAAM;IAsCzB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAWzB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAa9B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB7B,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CA6BzC"}
1
+ {"version":3,"file":"rest_client.d.ts","sourceRoot":"","sources":["../../src/api/rest_client.ts"],"names":[],"mappings":"AAIA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAQpC,qBAAa,kBAAkB;IAKlB,QAAQ,EAAE,MAAM;IACvB,OAAO,CAAC,QAAQ;aACA,GAAG,EAAE,MAAM;IAN/B,OAAO,CAAC,YAAY,CAAM;IACnB,KAAK,EAAE,aAAa,CAAC;gBAGjB,QAAQ,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EACR,GAAG,EAAE,MAAM;IAuDzB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAWzB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAa9B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB7B,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CA6BzC"}
@@ -16,18 +16,33 @@ const xml2js_1 = __importDefault(require("xml2js"));
16
16
  const axios_1 = __importDefault(require("axios"));
17
17
  const typescript_memoize_1 = require("typescript-memoize");
18
18
  const typescript_retry_decorator_1 = require("typescript-retry-decorator");
19
+ const https_1 = __importDefault(require("https"));
20
+ const tls_1 = __importDefault(require("tls"));
21
+ const fs_1 = __importDefault(require("fs"));
22
+ const path_1 = __importDefault(require("path"));
19
23
  class InfinityRestClient {
20
24
  constructor(username, password, log) {
21
25
  this.username = username;
22
26
  this.password = password;
23
27
  this.log = log;
24
28
  this.access_token = '';
29
+ // Load Comodo AAA root certificate for Node.js 22+ compatibility
30
+ // Node.js 22.20+ removed this root CA, but Carrier's API still uses it
31
+ const comodoRootCert = fs_1.default.readFileSync(path_1.default.join(__dirname, 'comodo-aaa-root.pem'), 'utf8');
32
+ // Add Comodo cert to the default CA bundle (not replacing it)
33
+ // This ensures we trust both the default CAs and the Comodo root
34
+ const ca = [...tls_1.default.rootCertificates, comodoRootCert];
35
+ // Create HTTPS agent with augmented CA bundle
36
+ const httpsAgent = new https_1.default.Agent({
37
+ ca: ca,
38
+ });
25
39
  this.axios = axios_1.default.create({
26
40
  baseURL: settings_1.INFINITY_API_BASE_URL,
27
41
  headers: {
28
42
  featureset: 'CONSUMER_PORTAL',
29
43
  Accept: 'application/xml',
30
44
  },
45
+ httpsAgent: httpsAgent,
31
46
  });
32
47
  // Axios debug logging and error handling
33
48
  this.axios.interceptors.response.use(
@@ -1 +1 @@
1
- {"version":3,"file":"rest_client.js","sourceRoot":"","sources":["../../src/api/rest_client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAoD;AACpD,mCAAuC;AAEvC,oDAA4B;AAC5B,kDAA6C;AAE7C,2DAAqD;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Q,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CACpC,sBAAsB,EACtB,IAAI,EACJ;YACE,OAAO,EAAE;gBACP,cAAc,EAAE,mCAAmC;gBACnD,MAAM,EAAE,kBAAkB;aAC3B;SACF,CACF,CAAC;QAEF,IAAI,MAAA,QAAQ,CAAC,IAAI,CAAC,MAAM,0CAAE,WAAW,EAAE,CAAC;YACtC,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACvD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AArID,gDAqIC;AAvEO;IADL,IAAA,oCAAe,EAAC,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;kDAU9B;AAeK;IADL,IAAA,oCAAe,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,eAAe;sDAWpD;AAQK;IANL,IAAA,sCAAS,EAAC;QACT,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,0CAAa,CAAC,wBAAwB;QACrD,OAAO,EAAE,IAAI;QACb,iBAAiB,EAAE,EAAE,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE;KACjE,CAAC;2DA6BD"}
@@ -0,0 +1,81 @@
1
+ import js from '@eslint/js';
2
+ import tseslint from 'typescript-eslint';
3
+ import spellcheck from 'eslint-plugin-spellcheck';
4
+
5
+ export default tseslint.config(
6
+ {
7
+ ignores: ['dist/**', 'node_modules/**'],
8
+ },
9
+ js.configs.recommended,
10
+ ...tseslint.configs.recommended,
11
+ {
12
+ files: ['src/**/*.ts'],
13
+ plugins: {
14
+ spellcheck,
15
+ },
16
+ languageOptions: {
17
+ parser: tseslint.parser,
18
+ parserOptions: {
19
+ ecmaVersion: 2018,
20
+ sourceType: 'module',
21
+ },
22
+ },
23
+ rules: {
24
+ 'quotes': ['warn', 'single'],
25
+ 'indent': ['warn', 2, { 'SwitchCase': 1 }],
26
+ 'semi': ['off'],
27
+ 'spellcheck/spell-checker': [
28
+ 'warn',
29
+ {
30
+ 'strings': false,
31
+ 'skipWords': [
32
+ 'axios',
33
+ 'bryant',
34
+ 'cdata',
35
+ 'cfgem',
36
+ 'clsp',
37
+ 'cmode',
38
+ 'ctype',
39
+ 'damperposition',
40
+ 'deadband',
41
+ 'Fanv',
42
+ 'filtrlvl',
43
+ 'featureset',
44
+ 'Homebridge',
45
+ 'htsp',
46
+ 'mutex',
47
+ 'rh',
48
+ 'Retryable',
49
+ 'setpoint',
50
+ 'setpoints',
51
+ 'sig',
52
+ 'svalue',
53
+ 'oauth',
54
+ 'unregister',
55
+ 'vacmaxt',
56
+ 'vacmint',
57
+ 'vacfan',
58
+ 'xml',
59
+ 'xml2js',
60
+ 'zoneconditioning',
61
+ ],
62
+ },
63
+ ],
64
+ 'comma-dangle': ['warn', 'always-multiline'],
65
+ 'dot-notation': 'off',
66
+ 'eqeqeq': 'warn',
67
+ 'curly': ['warn', 'all'],
68
+ 'brace-style': ['warn'],
69
+ 'prefer-arrow-callback': ['warn'],
70
+ 'max-len': ['warn', 140],
71
+ 'no-console': ['warn'],
72
+ 'comma-spacing': ['error'],
73
+ 'no-multi-spaces': ['warn', { 'ignoreEOLComments': true }],
74
+ 'no-trailing-spaces': ['warn'],
75
+ 'lines-between-class-members': ['warn', 'always', { 'exceptAfterSingleLine': true }],
76
+ '@typescript-eslint/explicit-function-return-type': 'off',
77
+ '@typescript-eslint/no-non-null-assertion': 'off',
78
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
79
+ },
80
+ },
81
+ );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Homebridge Carrier Infinity",
3
3
  "name": "homebridge-carrier-infinity",
4
- "version": "1.8.0",
4
+ "version": "1.8.1",
5
5
  "description": "Standalone homebridge plugin for Carrier Infinity / Bryant Evolution / ICP Brands Ion thermostats.",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -19,9 +19,8 @@
19
19
  "scripts": {
20
20
  "commit": "git-cz",
21
21
  "lint": "eslint src/**.ts --max-warnings=0",
22
- "relink": "sudo rsync -rl --chown homebridge:homebridge ../homebridge-carrier-infinity /var/lib/homebridge/node_modules/ && sudo hb-service restart",
23
- "watch": "npm run build && nodemon",
24
- "build": "rimraf ./dist && tsc",
22
+ "watch": "npm run build && npm link && nodemon",
23
+ "build": "rimraf ./dist && tsc && cp src/api/comodo-aaa-root.pem dist/api/",
25
24
  "prepublishOnly": "npm run lint && npm run build",
26
25
  "test": "jest",
27
26
  "xml2ts": "find testdata/*.xml -exec sh -c 'node scripts/xml2ts.ts {} src/api/interface_$(basename {} .xml).ts' \\;"
@@ -31,7 +30,7 @@
31
30
  "src"
32
31
  ],
33
32
  "ext": "ts",
34
- "exec": "tsc && npm run relink",
33
+ "exec": "tsc && pm2 restart homebridge",
35
34
  "delay": 5000,
36
35
  "env": {
37
36
  "NODE_OPTIONS": "--trace-warnings"
@@ -49,37 +48,39 @@
49
48
  "infinitive"
50
49
  ],
51
50
  "dependencies": {
52
- "async-mutex": "^0.4.1",
53
- "axios": "^1.7.9",
51
+ "async-mutex": "^0.5.0",
52
+ "axios": "^1.13.4",
54
53
  "oauth-sign": "^0.9.0",
55
54
  "object-hash": "^3.0.0",
56
55
  "typescript-memoize": "^1.1.1",
57
- "typescript-retry-decorator": "^2.4.2",
56
+ "typescript-retry-decorator": "^2.5.3",
58
57
  "xml2js": "^0.6.2"
59
58
  },
60
59
  "devDependencies": {
61
- "@commitlint/cli": "^18.6.1",
62
- "@commitlint/config-conventional": "^18.6.3",
63
- "@commitlint/cz-commitlint": "^18.6.1",
60
+ "@commitlint/cli": "^20.3.1",
61
+ "@commitlint/config-conventional": "^20.3.1",
62
+ "@commitlint/cz-commitlint": "^20.3.1",
63
+ "@eslint/js": "^9.39.2",
64
64
  "@semantic-release/git": "^10.0.1",
65
- "@types/jest": "^29.5.14",
66
- "@types/node": "^20.17.11",
65
+ "@types/jest": "^30.0.0",
66
+ "@types/node": "^22.10.5",
67
67
  "@types/object-hash": "^3.0.6",
68
68
  "@types/xml2js": "^0.4.14",
69
- "@typescript-eslint/eslint-plugin": "^6.21.0",
70
- "@typescript-eslint/parser": "^6.21.0",
69
+ "@typescript-eslint/eslint-plugin": "^8.54.0",
70
+ "@typescript-eslint/parser": "^8.54.0",
71
71
  "commitizen": "^4.3.1",
72
- "eslint": "^8.57.1",
72
+ "eslint": "^9.39.2",
73
73
  "eslint-plugin-spellcheck": "^0.0.20",
74
- "homebridge": "^1.8.5",
75
- "jest": "^29.7.0",
76
- "json-to-ts": "^1.7.0",
77
- "nodemon": "^3.1.9",
78
- "rimraf": "^5.0.10",
79
- "semantic-release": "^24.2.1",
80
- "ts-jest": "^29.2.5",
74
+ "homebridge": "^1.11.1",
75
+ "jest": "^30.2.0",
76
+ "json-to-ts": "^2.1.0",
77
+ "nodemon": "^3.1.11",
78
+ "rimraf": "^6.1.2",
79
+ "semantic-release": "^25.0.2",
80
+ "ts-jest": "^29.4.6",
81
81
  "ts-node": "^10.9.2",
82
- "typescript": "^5.7.2"
82
+ "typescript": "^5.9.3",
83
+ "typescript-eslint": "^8.54.0"
83
84
  },
84
85
  "config": {
85
86
  "commitizen": {