Skip to content

Commit 5d0ec91

Browse files
committed
matter logs
1 parent 01c189c commit 5d0ec91

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/devices/device.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,23 @@ export abstract class deviceBase {
465465
// Type assertion for Matter API (will be properly typed in Homebridge 2.0)
466466
const matterAPI = (this.api as any).matter
467467

468+
// Debug: Log Matter API structure (first device only to avoid spam)
469+
if (!this.constructor.prototype._matterAPILogged) {
470+
this.infoLog(`[Matter Debug] API available: ${!!matterAPI}`)
471+
if (matterAPI) {
472+
this.infoLog(`[Matter Debug] API keys: ${Object.keys(matterAPI).join(', ')}`)
473+
this.infoLog(`[Matter Debug] uuid type: ${typeof matterAPI.uuid} = ${matterAPI.uuid ? 'exists' : 'missing'}`)
474+
this.infoLog(`[Matter Debug] deviceTypes type: ${typeof matterAPI.deviceTypes} = ${matterAPI.deviceTypes ? 'exists' : 'missing'}`)
475+
this.infoLog(`[Matter Debug] registerAccessory type: ${typeof matterAPI.registerAccessory}`)
476+
477+
if (matterAPI.deviceTypes) {
478+
const deviceTypeKeys = Object.keys(matterAPI.deviceTypes)
479+
this.infoLog(`[Matter Debug] Available deviceTypes (${deviceTypeKeys.length}): ${deviceTypeKeys.slice(0, 10).join(', ')}${deviceTypeKeys.length > 10 ? '...' : ''}`)
480+
}
481+
}
482+
this.constructor.prototype._matterAPILogged = true
483+
}
484+
468485
// Validate Matter API is available
469486
if (!matterAPI || !matterAPI.uuid) {
470487
throw new Error('Matter API not available or incomplete')

src/devices/dishwasher.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,9 @@ export class SmartHQDishWasher extends deviceBase {
6060
return
6161
}
6262

63-
// Debug: Log what's actually in the Matter API
64-
this.infoLog(`Matter API available. Keys: ${Object.keys(matterAPI).join(', ')}`)
65-
this.infoLog(`Matter API.uuid: ${typeof matterAPI.uuid} = ${matterAPI.uuid ? 'exists' : 'missing'}`)
66-
this.infoLog(`Matter API.deviceTypes: ${typeof matterAPI.deviceTypes} = ${matterAPI.deviceTypes ? 'exists' : 'missing'}`)
67-
this.infoLog(`Matter API.registerAccessory: ${typeof matterAPI.registerAccessory}`)
68-
69-
if (matterAPI.deviceTypes) {
70-
this.infoLog(`Available deviceTypes: ${Object.keys(matterAPI.deviceTypes).join(', ')}`)
71-
}
72-
7363
// Verify all required Matter API methods exist
7464
if (!matterAPI.uuid || !matterAPI.deviceTypes || typeof matterAPI.registerAccessory !== 'function') {
7565
this.errorLog('Matter API is incomplete (missing required methods) - falling back to HAP')
76-
this.errorLog(`Available Matter API keys: ${Object.keys(matterAPI).join(', ')}`)
7766
this.initializeHAP()
7867
return
7968
}

0 commit comments

Comments
 (0)