@matterbridge/utils 3.10.8-dev-20260829-e779e7d → 3.10.8-dev-20260831-3e81235
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.
- package/dist/export.d.ts +1 -0
- package/dist/export.js +1 -0
- package/dist/measurementUtils.d.ts +2 -0
- package/dist/measurementUtils.js +12 -0
- package/package.json +2 -2
package/dist/export.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from './githubVersion.js';
|
|
|
12
12
|
export * from './hex.js';
|
|
13
13
|
export * from './inspector.js';
|
|
14
14
|
export * from './loader.js';
|
|
15
|
+
export * from './measurementUtils.js';
|
|
15
16
|
export * from './network.js';
|
|
16
17
|
export * from './npmPrefix.js';
|
|
17
18
|
export * from './npmVersion.js';
|
package/dist/export.js
CHANGED
|
@@ -12,6 +12,7 @@ export * from './githubVersion.js';
|
|
|
12
12
|
export * from './hex.js';
|
|
13
13
|
export * from './inspector.js';
|
|
14
14
|
export * from './loader.js';
|
|
15
|
+
export * from './measurementUtils.js';
|
|
15
16
|
export * from './network.js';
|
|
16
17
|
export * from './npmPrefix.js';
|
|
17
18
|
export * from './npmVersion.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function luxToMatter(lux) {
|
|
2
|
+
if (!Number.isFinite(lux) || lux < 1)
|
|
3
|
+
return 0;
|
|
4
|
+
const encoded = Math.round(10000 * Math.log10(lux) + 1);
|
|
5
|
+
return Math.min(encoded, 0xfffe);
|
|
6
|
+
}
|
|
7
|
+
export function matterToLux(value) {
|
|
8
|
+
if (!Number.isFinite(value) || value <= 0)
|
|
9
|
+
return 0;
|
|
10
|
+
const v = Math.min(value, 0xfffe);
|
|
11
|
+
return Math.round(Math.pow(10, (v - 1) / 10000));
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/utils",
|
|
3
|
-
"version": "3.10.8-dev-
|
|
3
|
+
"version": "3.10.8-dev-20260831-3e81235",
|
|
4
4
|
"description": "Matterbridge utils library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -152,6 +152,6 @@
|
|
|
152
152
|
"skipTsconfig": true
|
|
153
153
|
},
|
|
154
154
|
"dependencies": {
|
|
155
|
-
"node-ansi-logger": "3.3.
|
|
155
|
+
"node-ansi-logger": "3.3.1"
|
|
156
156
|
}
|
|
157
157
|
}
|