homebridge 2.0.3-beta.42 → 2.0.3-beta.44
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logFormatter.d.ts","sourceRoot":"","sources":["../../src/matter/logFormatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,IAAI,CAAC,UAAU,EAAE,OAAO,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"logFormatter.d.ts","sourceRoot":"","sources":["../../src/matter/logFormatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,IAAI,CAAC,UAAU,EAAE,OAAO,KAAK,MAAM,CA2E9E"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Formats Matter.js library logs to match the homebridge log format and color scheme.
|
|
5
5
|
* This ensures consistent logging output across Homebridge and Matter.js.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { LogFormat } from '@matter/general';
|
|
8
8
|
import chalk from 'chalk';
|
|
9
9
|
import { Logger } from '../logger.js';
|
|
10
10
|
/**
|
|
@@ -34,8 +34,12 @@ export function createHomebridgeLogFormatter() {
|
|
|
34
34
|
}
|
|
35
35
|
// Format facility as [Matter:FacilityName] in cyan color
|
|
36
36
|
const facility = formatCyan(`[Matter/${msg.facility}]`);
|
|
37
|
-
// Extract the message text from values
|
|
38
|
-
|
|
37
|
+
// Extract the message text from values.
|
|
38
|
+
// Delegate value rendering to Matter.js's own formatter so that Diagnostic
|
|
39
|
+
// presentations (dictionaries, lists, byte arrays, error stacks, lifecycle
|
|
40
|
+
// icons) render correctly. We use the `plain` format (no ANSI) because we
|
|
41
|
+
// apply a single Homebridge level colour to the whole line below.
|
|
42
|
+
let messageText = LogFormat.formats.plain(msg.values);
|
|
39
43
|
// Trim excessively long messages from verbose facilities like MessageChannel
|
|
40
44
|
if (msg.facility === 'MessageChannel' && messageText.length > 200) {
|
|
41
45
|
messageText = `${messageText.substring(0, 200)} [trimmed...]`;
|
|
@@ -98,61 +102,4 @@ function formatHomebridgeTimestamp(date) {
|
|
|
98
102
|
function formatCyan(text) {
|
|
99
103
|
return chalk.cyan(text);
|
|
100
104
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Format the message values array into a readable string
|
|
103
|
-
*/
|
|
104
|
-
function formatMessageValues(values) {
|
|
105
|
-
if (!Array.isArray(values)) {
|
|
106
|
-
return String(values);
|
|
107
|
-
}
|
|
108
|
-
return values
|
|
109
|
-
.map((value) => {
|
|
110
|
-
if (value === null) {
|
|
111
|
-
return 'null';
|
|
112
|
-
}
|
|
113
|
-
if (value === undefined) {
|
|
114
|
-
return 'undefined';
|
|
115
|
-
}
|
|
116
|
-
// Matter.js uses lazy logging - call functions to get the actual message
|
|
117
|
-
if (typeof value === 'function') {
|
|
118
|
-
try {
|
|
119
|
-
return String(value());
|
|
120
|
-
}
|
|
121
|
-
catch {
|
|
122
|
-
return String(value);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (typeof value === 'object') {
|
|
126
|
-
// Check if this is a Matter.js Diagnostic object
|
|
127
|
-
// These objects store their actual value in a symbol property
|
|
128
|
-
const diagnosticValue = Diagnostic.valueOf(value);
|
|
129
|
-
if (diagnosticValue !== undefined && diagnosticValue !== value) {
|
|
130
|
-
// If diagnosticValue is an array, format each element individually
|
|
131
|
-
if (Array.isArray(diagnosticValue)) {
|
|
132
|
-
return formatMessageValues(diagnosticValue);
|
|
133
|
-
}
|
|
134
|
-
// Otherwise, recursively format the single value
|
|
135
|
-
return formatMessageValues([diagnosticValue]);
|
|
136
|
-
}
|
|
137
|
-
// Special handling for error objects
|
|
138
|
-
if (value instanceof Error) {
|
|
139
|
-
const errorDetails = {
|
|
140
|
-
...value, // include any custom properties first
|
|
141
|
-
name: value.name,
|
|
142
|
-
message: value.message,
|
|
143
|
-
stack: value.stack,
|
|
144
|
-
};
|
|
145
|
-
return JSON.stringify(errorDetails, null, 2);
|
|
146
|
-
}
|
|
147
|
-
try {
|
|
148
|
-
return JSON.stringify(value);
|
|
149
|
-
}
|
|
150
|
-
catch {
|
|
151
|
-
return String(value);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return String(value).trim();
|
|
155
|
-
})
|
|
156
|
-
.join(' ');
|
|
157
|
-
}
|
|
158
105
|
//# sourceMappingURL=logFormatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logFormatter.js","sourceRoot":"","sources":["../../src/matter/logFormatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"logFormatter.js","sourceRoot":"","sources":["../../src/matter/logFormatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,4BAA4B;IAC1C,2DAA2D;IAC3D,MAAM,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAA;IAEpD,OAAO,CAAC,UAAmB,EAAU,EAAE;QACrC,2CAA2C;QAC3C,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YAC1D,MAAM,GAAG,GAAG,UAAiB,CAAA;YAE7B,oDAAoD;YACpD,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;gBAC1C,6EAA6E;gBAC7E,6EAA6E;gBAC7E,IAAI,GAAG,CAAC,QAAQ,KAAK,mBAAmB,IAAI,GAAG,CAAC,QAAQ,KAAK,eAAe,EAAE,CAAC;oBAC7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AAiE;gBACjE,IAAI,gBAAgB,EAAE,CAAC;oBACrB,8EAA8E;oBAC9E,MAAM,SAAS,GAAG,yBAAyB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;oBACpD,OAAO,GAAG,SAAS,IAAI,QAAQ,IAAI,cAAc,EAAE,CAAA;gBACrD,CAAC;qBAAM,CAAC;oBACN,eAAe;oBACf,OAAO,GAAG,QAAQ,IAAI,cAAc,EAAE,CAAA;gBACxC,CAAC;YACH,CAAC;QACH,CAAC;QAED,uCAAuC;QACvC,OAAO,MAAM,CAAC,UAAU,CAAC,CAAA;IAC3B,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,yBAAyB,CAAC,IAAU;IAC3C,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,EAAE,GAAG,CAAA;IAC9C,OAAO,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;AAC/B,CAAC;AAED;;GAEG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.3-beta.
|
|
4
|
+
"version": "2.0.3-beta.44",
|
|
5
5
|
"description": "HomeKit support for the impatient",
|
|
6
6
|
"author": "Nick Farina",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@homebridge/hap-nodejs": "2.1.7",
|
|
53
|
-
"@matter/main": "0.17.
|
|
53
|
+
"@matter/main": "0.17.1",
|
|
54
54
|
"chalk": "5.6.2",
|
|
55
55
|
"commander": "15.0.0",
|
|
56
56
|
"fs-extra": "11.3.5",
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
"@types/node": "^25.9.1",
|
|
67
67
|
"@types/semver": "^7.7.1",
|
|
68
68
|
"@types/source-map-support": "^0.5.10",
|
|
69
|
-
"@vitest/coverage-v8": "^4.1.
|
|
69
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
70
70
|
"eslint-plugin-format": "^2.0.1",
|
|
71
71
|
"nodemon": "^3.1.14",
|
|
72
72
|
"rimraf": "^6.1.3",
|
|
73
73
|
"ts-node": "^10.9.2",
|
|
74
74
|
"typedoc": "^0.28.19",
|
|
75
75
|
"typescript": "^6.0.3",
|
|
76
|
-
"vitest": "^4.1.
|
|
76
|
+
"vitest": "^4.1.8"
|
|
77
77
|
}
|
|
78
78
|
}
|