matterbridge 2.2.6-dev.2 → 2.2.6-dev.4
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/CHANGELOG.md +1 -1
- package/dist/frontend.js +10 -0
- package/dist/matterbridge.js +25 -0
- package/dist/shelly.js +40 -4
- package/frontend/build/asset-manifest.json +3 -3
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/js/{main.a45801ac.js → main.f00179ca.js} +3 -3
- package/frontend/build/static/js/{main.a45801ac.js.map → main.f00179ca.js.map} +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- /package/frontend/build/static/js/{main.a45801ac.js.LICENSE.txt → main.f00179ca.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
package/dist/frontend.js
CHANGED
|
@@ -1170,6 +1170,16 @@ export class Frontend {
|
|
|
1170
1170
|
triggerShellyChangeNet(this.matterbridge, data.params);
|
|
1171
1171
|
return;
|
|
1172
1172
|
}
|
|
1173
|
+
else if (data.method === '/api/softreset') {
|
|
1174
|
+
const { triggerShellySoftReset } = await import('./shelly.js');
|
|
1175
|
+
triggerShellySoftReset(this.matterbridge);
|
|
1176
|
+
return;
|
|
1177
|
+
}
|
|
1178
|
+
else if (data.method === '/api/hardreset') {
|
|
1179
|
+
const { triggerShellyHardReset } = await import('./shelly.js');
|
|
1180
|
+
triggerShellyHardReset(this.matterbridge);
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1173
1183
|
else if (data.method === '/api/reboot') {
|
|
1174
1184
|
const { triggerShellyReboot } = await import('./shelly.js');
|
|
1175
1185
|
triggerShellyReboot(this.matterbridge);
|
package/dist/matterbridge.js
CHANGED
|
@@ -46,6 +46,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
46
46
|
rootDirectory: '',
|
|
47
47
|
matterbridgeDirectory: '',
|
|
48
48
|
matterbridgePluginDirectory: '',
|
|
49
|
+
matterbridgeCertDirectory: '',
|
|
49
50
|
globalModulesDirectory: '',
|
|
50
51
|
matterbridgeVersion: '',
|
|
51
52
|
matterbridgeLatestVersion: '',
|
|
@@ -79,6 +80,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
79
80
|
rootDirectory = '';
|
|
80
81
|
matterbridgeDirectory = '';
|
|
81
82
|
matterbridgePluginDirectory = '';
|
|
83
|
+
matterbridgeCertDirectory = '';
|
|
82
84
|
globalModulesDirectory = '';
|
|
83
85
|
matterbridgeVersion = '';
|
|
84
86
|
matterbridgeLatestVersion = '';
|
|
@@ -845,6 +847,29 @@ export class Matterbridge extends EventEmitter {
|
|
|
845
847
|
}
|
|
846
848
|
}
|
|
847
849
|
this.log.debug(`Matterbridge Plugin Directory: ${this.matterbridgePluginDirectory}`);
|
|
850
|
+
this.matterbridgeCertDirectory = path.join(this.homeDirectory, '.mattercert');
|
|
851
|
+
this.matterbridgeInformation.matterbridgeCertDirectory = this.matterbridgeCertDirectory;
|
|
852
|
+
try {
|
|
853
|
+
await fs.access(this.matterbridgeCertDirectory);
|
|
854
|
+
}
|
|
855
|
+
catch (err) {
|
|
856
|
+
if (err instanceof Error) {
|
|
857
|
+
const nodeErr = err;
|
|
858
|
+
if (nodeErr.code === 'ENOENT') {
|
|
859
|
+
try {
|
|
860
|
+
await fs.mkdir(this.matterbridgeCertDirectory, { recursive: true });
|
|
861
|
+
this.log.info(`Created .mattercert directory: ${this.matterbridgeCertDirectory}`);
|
|
862
|
+
}
|
|
863
|
+
catch (err) {
|
|
864
|
+
this.log.error(`Error creating .mattercert directory: ${err}`);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
else {
|
|
868
|
+
this.log.error(`Error accessing .mattercert directory: ${err}`);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
this.log.debug(`Matterbridge Matter Cert Directory: ${this.matterbridgeCertDirectory}`);
|
|
848
873
|
const packageJson = JSON.parse(await fs.readFile(path.join(this.rootDirectory, 'package.json'), 'utf-8'));
|
|
849
874
|
this.matterbridgeVersion = this.matterbridgeLatestVersion = packageJson.version;
|
|
850
875
|
this.matterbridgeInformation.matterbridgeVersion = this.matterbridgeInformation.matterbridgeLatestVersion = this.matterbridgeVersion;
|
package/dist/shelly.js
CHANGED
|
@@ -112,13 +112,15 @@ export async function triggerShellyChangeIp(matterbridge, config) {
|
|
|
112
112
|
postShelly(api, data, 60 * 1000)
|
|
113
113
|
.then(async () => {
|
|
114
114
|
matterbridge.log.debug(`Triggered Shelly network configuration change: ${debugStringify(config)}`);
|
|
115
|
+
matterbridge.log.notice(`Changed Shelly network configuration`);
|
|
116
|
+
matterbridge.frontend.wssSendSnackbarMessage('Changed Shelly network configuration');
|
|
115
117
|
})
|
|
116
118
|
.catch((error) => {
|
|
117
119
|
matterbridge.log.debug(`****Error triggering Shelly network configuration change: ${error instanceof Error ? error.message : error}`);
|
|
120
|
+
matterbridge.log.error(`Error changing Shelly network configuration: ${error instanceof Error ? error.message : error}`);
|
|
121
|
+
matterbridge.frontend.wssSendSnackbarMessage('Error changing Shelly network configuration', 10, 'error');
|
|
118
122
|
})
|
|
119
123
|
.finally(() => {
|
|
120
|
-
matterbridge.log.notice(`Changed Shelly network configuration`);
|
|
121
|
-
matterbridge.frontend.wssSendSnackbarMessage('Changed Shelly network configuration');
|
|
122
124
|
});
|
|
123
125
|
}
|
|
124
126
|
export async function triggerShellyReboot(matterbridge) {
|
|
@@ -126,13 +128,47 @@ export async function triggerShellyReboot(matterbridge) {
|
|
|
126
128
|
postShelly('/api/system/reboot', {}, 60 * 1000)
|
|
127
129
|
.then(async () => {
|
|
128
130
|
matterbridge.log.debug(`Triggered Shelly system reboot`);
|
|
131
|
+
matterbridge.log.notice(`Rebooting Shelly board...`);
|
|
132
|
+
matterbridge.frontend.wssSendSnackbarMessage('Rebooting Shelly board...');
|
|
129
133
|
})
|
|
130
134
|
.catch((error) => {
|
|
131
135
|
matterbridge.log.debug(`****Error triggering Shelly system reboot: ${error instanceof Error ? error.message : error}`);
|
|
136
|
+
matterbridge.log.error(`Error rebooting Shelly board: ${error instanceof Error ? error.message : error}`);
|
|
137
|
+
matterbridge.frontend.wssSendSnackbarMessage('Error rebooting Shelly board', 10, 'error');
|
|
138
|
+
})
|
|
139
|
+
.finally(() => {
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
export async function triggerShellySoftReset(matterbridge) {
|
|
143
|
+
matterbridge.log.debug(`Triggering Shelly soft reset`);
|
|
144
|
+
getShelly('/api/reset/soft', 60 * 1000)
|
|
145
|
+
.then(async () => {
|
|
146
|
+
matterbridge.log.debug(`Triggered Shelly soft reset`);
|
|
147
|
+
matterbridge.log.notice(`Resetting the network parameters on Shelly board...`);
|
|
148
|
+
matterbridge.frontend.wssSendSnackbarMessage('Resetting the network parameters on Shelly board...');
|
|
149
|
+
})
|
|
150
|
+
.catch((error) => {
|
|
151
|
+
matterbridge.log.debug(`****Error triggering Shelly soft reset: ${error instanceof Error ? error.message : error}`);
|
|
152
|
+
matterbridge.log.error(`Error resetting the network parameters on Shelly board: ${error instanceof Error ? error.message : error}`);
|
|
153
|
+
matterbridge.frontend.wssSendSnackbarMessage('Error resetting the network parameters on Shelly board', 10, 'error');
|
|
154
|
+
})
|
|
155
|
+
.finally(() => {
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
export async function triggerShellyHardReset(matterbridge) {
|
|
159
|
+
matterbridge.log.debug(`Triggering Shelly hard reset`);
|
|
160
|
+
getShelly('/api/reset/hard', 60 * 1000)
|
|
161
|
+
.then(async () => {
|
|
162
|
+
matterbridge.log.debug(`Triggered Shelly hard reset`);
|
|
163
|
+
matterbridge.log.notice(`Factory resetting Shelly board...`);
|
|
164
|
+
matterbridge.frontend.wssSendSnackbarMessage('Factory resetting Shelly board...');
|
|
165
|
+
})
|
|
166
|
+
.catch((error) => {
|
|
167
|
+
matterbridge.log.debug(`****Error triggering Shelly hard reset: ${error instanceof Error ? error.message : error}`);
|
|
168
|
+
matterbridge.log.error(`Error while factory resetting the Shelly board: ${error instanceof Error ? error.message : error}`);
|
|
169
|
+
matterbridge.frontend.wssSendSnackbarMessage('Error while factory resetting the Shelly board', 10, 'error');
|
|
132
170
|
})
|
|
133
171
|
.finally(() => {
|
|
134
|
-
matterbridge.log.notice(`Rebooting Shelly board...`);
|
|
135
|
-
matterbridge.frontend.wssSendSnackbarMessage('Rebooting Shelly board...');
|
|
136
172
|
});
|
|
137
173
|
}
|
|
138
174
|
export async function createShellySystemLog(matterbridge) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
3
|
"main.css": "./static/css/main.ea7910e9.css",
|
|
4
|
-
"main.js": "./static/js/main.
|
|
4
|
+
"main.js": "./static/js/main.f00179ca.js",
|
|
5
5
|
"static/js/453.d855a71b.chunk.js": "./static/js/453.d855a71b.chunk.js",
|
|
6
6
|
"static/media/roboto-latin-700-normal.woff2": "./static/media/roboto-latin-700-normal.c4d6cab43bec89049809.woff2",
|
|
7
7
|
"static/media/roboto-latin-500-normal.woff2": "./static/media/roboto-latin-500-normal.599f66a60bdf974e578e.woff2",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"static/media/roboto-greek-ext-300-normal.woff": "./static/media/roboto-greek-ext-300-normal.60729cafbded24073dfb.woff",
|
|
78
78
|
"index.html": "./index.html",
|
|
79
79
|
"main.ea7910e9.css.map": "./static/css/main.ea7910e9.css.map",
|
|
80
|
-
"main.
|
|
80
|
+
"main.f00179ca.js.map": "./static/js/main.f00179ca.js.map",
|
|
81
81
|
"453.d855a71b.chunk.js.map": "./static/js/453.d855a71b.chunk.js.map"
|
|
82
82
|
},
|
|
83
83
|
"entrypoints": [
|
|
84
84
|
"static/css/main.ea7910e9.css",
|
|
85
|
-
"static/js/main.
|
|
85
|
+
"static/js/main.f00179ca.js"
|
|
86
86
|
]
|
|
87
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.f00179ca.js"></script><link href="./static/css/main.ea7910e9.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|