Skip to content

Commit 974ae19

Browse files
committed
integration with updated homebridge version
1 parent 0bf4157 commit 974ae19

File tree

91 files changed

+3749
-687
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+3749
-687
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ All notable changes to `homebridge-config-ui-x` will be documented in this file.
1414
- change session timeout from seconds to days, hours, minutes
1515
- improve widget state around first data load
1616
- add self-signed certificate generation feature
17+
- integration with updated homebridge version
1718

1819
### Other Changes
1920

package-lock.json

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"@nestjs/platform-socket.io": "11.1.8",
9393
"@nestjs/swagger": "11.2.1",
9494
"@nestjs/websockets": "11.1.8",
95-
"axios": "1.12.2",
95+
"axios": "1.13.1",
9696
"bash-color": "0.0.4",
9797
"bonjour-service": "1.3.0",
9898
"class-transformer": "0.5.1",
@@ -126,7 +126,7 @@
126126
"@prettier/plugin-xml": "^3.4.2",
127127
"@types/fs-extra": "^11.0.4",
128128
"@types/lodash": "^4.17.20",
129-
"@types/node": "^24.9.1",
129+
"@types/node": "^24.9.2",
130130
"@types/node-forge": "^1.3.11",
131131
"@types/node-schedule": "^2.1.8",
132132
"@types/passport-jwt": "^4.0.1",
@@ -149,7 +149,7 @@
149149
},
150150
"overrides": {
151151
"@homebridge/hap-client": {
152-
"axios": "1.12.2"
152+
"axios": "1.13.1"
153153
}
154154
},
155155
"maintainers": [

scripts/extract-plugin-alias.js

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
const process = require('node:process')
88
const EventEmitter = require('node:events').EventEmitter
9+
const { readFileSync } = require('node:fs')
910
const path = require('node:path')
1011

1112
let pluginAlias
@@ -36,6 +37,26 @@ const HomebridgeApiMock = {
3637
serverVersion: '1.2.3',
3738
on: () => { /** mock */ },
3839
emit: () => { /** mock */ },
40+
// Mock Matter API
41+
isMatterAvailable() {
42+
return true
43+
},
44+
isMatterEnabled() {
45+
return true
46+
},
47+
matterDeviceTypes: new Proxy({}, {
48+
get() {
49+
return {} // Return empty object for any device type
50+
},
51+
}),
52+
matterClusters: new Proxy({}, {
53+
get() {
54+
return {} // Return empty object for any cluster
55+
},
56+
}),
57+
registerMatterAccessory: () => { /** mock */ },
58+
unregisterMatterAccessory: () => { /** mock */ },
59+
updateMatterAccessoryState: () => { /** mock */ },
3960
hap: {
4061
Characteristic: new class Characteristic extends EventEmitter {
4162
constructor() {
@@ -99,11 +120,41 @@ const HomebridgeApiMock = {
99120
},
100121
}
101122

102-
function main() {
123+
async function main() {
103124
try {
104125
let pluginInitializer
105126
const pluginPath = process.env.UIX_EXTRACT_PLUGIN_PATH
106-
const pluginModules = require(pluginPath)
127+
128+
// Read package.json to get the proper entry point
129+
let actualEntryPoint = pluginPath
130+
try {
131+
const packageJsonPath = path.join(pluginPath, 'package.json')
132+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'))
133+
134+
if (packageJson.main) {
135+
actualEntryPoint = path.join(pluginPath, packageJson.main)
136+
}
137+
} catch (err) {
138+
console.error('[extract-plugin-alias] Could not read package.json, using directory path')
139+
}
140+
141+
let pluginModules
142+
143+
// Try to load as CommonJS first
144+
try {
145+
pluginModules = require(actualEntryPoint)
146+
} catch (requireError) {
147+
// If require fails, try dynamic import for ESM modules
148+
try {
149+
// For ESM, we need to use file:// URL on some platforms
150+
const importPath = actualEntryPoint.startsWith('/') || actualEntryPoint.startsWith('file://')
151+
? actualEntryPoint
152+
: path.resolve(actualEntryPoint)
153+
pluginModules = await import(importPath)
154+
} catch (importError) {
155+
throw requireError // Throw the original error
156+
}
157+
}
107158

108159
if (typeof pluginModules === 'function') {
109160
pluginInitializer = pluginModules

src/core/config/config.interfaces.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ interface PluginChildBridge {
2525
DEBUG?: string
2626
NODE_OPTIONS?: string
2727
}
28+
matter?: {
29+
port?: number
30+
}
2831
}
2932

3033
export interface PlatformConfig {
@@ -52,6 +55,9 @@ export interface HomebridgeConfig {
5255
manufacturer?: string
5356
model?: string
5457
firmwareRevision?: string
58+
matter?: {
59+
port?: number
60+
}
5561
}
5662
mdns?: {
5763
interface?: string | string[]
@@ -67,6 +73,13 @@ export interface HomebridgeConfig {
6773
disabledPlugins?: string[]
6874
}
6975

76+
/**
77+
* Matter configuration interface
78+
*/
79+
export interface MatterConfig {
80+
port?: number
81+
}
82+
7083
export interface HomebridgeUiConfig {
7184
name: string
7285
port: number
@@ -102,6 +115,7 @@ export interface HomebridgeUiConfig {
102115
}
103116
plugins?: {
104117
hideUpdatesFor?: string[]
118+
hidePairingAlerts?: string[]
105119
alwaysShowBetas?: boolean
106120
}
107121
temp?: string

src/core/config/config.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ export class ConfigService {
223223
},
224224
plugins: {
225225
hideUpdatesFor: this.ui.plugins?.hideUpdatesFor || [],
226+
hidePairingAlerts: this.ui.plugins?.hidePairingAlerts || [],
226227
alwaysShowBetas: Boolean(this.ui.plugins?.alwaysShowBetas),
227228
},
228229
linux: {

src/core/feature-flags/feature-flags.registry.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ export const FEATURE_FLAGS: FeatureFlagDefinition[] = [
2727
{
2828
key: 'childBridgeDebugMode',
2929
description: 'Enables debug mode configuration for child bridges',
30-
range: '>=2.0.0-beta.0',
30+
range: '>=2.0.0-alpha.0',
31+
},
32+
{
33+
key: 'matterSupport',
34+
description: 'Enables support for Matter bridges',
35+
range: '>=2.0.0-alpha.0 <2.0.0-beta.0 || >=2.0.0-beta.31',
3136
},
3237
]

src/modules/child-bridges/child-bridges.interfaces.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
*
44
* These types define the interfaces for child bridge communication
55
* between the UI and homebridge core.
6+
*
7+
* Child bridges can have both HAP and optional Matter functionality.
68
*/
79

810
export type BridgeStatus = 'pending' | 'ok' | 'down'
911

1012
/**
11-
* Child bridge metadata
13+
* Child bridge metadata (unified HAP + optional Matter)
14+
*
15+
* This represents a child bridge that always runs HAP, and optionally
16+
* can also expose devices via Matter when matterConfig is present.
1217
*/
1318
export interface ChildBridgeMetadata {
1419
/** Operational status */
@@ -43,4 +48,27 @@ export interface ChildBridgeMetadata {
4348

4449
/** Manually stopped flag */
4550
manuallyStopped: boolean
51+
52+
/** Matter configuration */
53+
matterConfig?: {
54+
port?: number
55+
}
56+
57+
/** Matter identifier (filesystem storage key) */
58+
matterIdentifier?: string
59+
60+
/** Matter setup URI (QR code payload) */
61+
matterSetupUri?: string
62+
63+
/** Matter manual pairing code */
64+
matterPin?: string
65+
66+
/** Matter serial number */
67+
matterSerialNumber?: string
68+
69+
/** Whether Matter is commissioned */
70+
matterCommissioned?: boolean
71+
72+
/** Number of Matter devices */
73+
matterDeviceCount?: number
4674
}

0 commit comments

Comments
 (0)