tasmota-esp-web-tools 12.1.0 → 12.1.2
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/components/ew-littlefs-manager.js +4 -9
- package/dist/connect.js +1 -1
- package/dist/flash.d.ts +1 -1
- package/dist/flash.js +4 -4
- package/dist/install-dialog.js +28 -21
- package/dist/util/cors-proxy.js +3 -3
- package/dist/util/partition.js +1 -1
- package/dist/web/install-button.js +1 -1
- package/dist/web/{install-dialog-7l9oLExq.js → install-dialog-C1yqGLP_.js} +16 -11
- package/eslint.config.js +15 -0
- package/js/modules/install-button.js +1 -1
- package/js/modules/{install-dialog-7l9oLExq.js → install-dialog-C1yqGLP_.js} +16 -11
- package/package.json +2 -2
|
@@ -105,7 +105,7 @@ let EwtLittleFSManager = class EwtLittleFSManager extends LitElement {
|
|
|
105
105
|
this.logger.log(`Successfully mounted LittleFS with block size ${bs}`);
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
|
-
catch (
|
|
108
|
+
catch (_err) {
|
|
109
109
|
// Try next block size
|
|
110
110
|
fs = null;
|
|
111
111
|
}
|
|
@@ -125,7 +125,7 @@ let EwtLittleFSManager = class EwtLittleFSManager extends LitElement {
|
|
|
125
125
|
this._diskVersion = "Unknown";
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
catch (
|
|
128
|
+
catch (_e) {
|
|
129
129
|
this._diskVersion = "Unknown";
|
|
130
130
|
}
|
|
131
131
|
this._refreshFiles();
|
|
@@ -238,7 +238,7 @@ let EwtLittleFSManager = class EwtLittleFSManager extends LitElement {
|
|
|
238
238
|
try {
|
|
239
239
|
this._fs.mkdir(built);
|
|
240
240
|
}
|
|
241
|
-
catch (
|
|
241
|
+
catch (_e) {
|
|
242
242
|
// Ignore if directory already exists
|
|
243
243
|
}
|
|
244
244
|
}
|
|
@@ -397,12 +397,7 @@ let EwtLittleFSManager = class EwtLittleFSManager extends LitElement {
|
|
|
397
397
|
}
|
|
398
398
|
_cleanup() {
|
|
399
399
|
if (this._fs) {
|
|
400
|
-
|
|
401
|
-
// Don't call destroy() - just let garbage collection handle it
|
|
402
|
-
}
|
|
403
|
-
catch (e) {
|
|
404
|
-
console.error("Error cleaning up LittleFS:", e);
|
|
405
|
-
}
|
|
400
|
+
// Don't call destroy() - just let garbage collection handle it
|
|
406
401
|
this._fs = null;
|
|
407
402
|
}
|
|
408
403
|
}
|
package/dist/connect.js
CHANGED
package/dist/flash.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Logger } from "tasmota-webserial-esptool";
|
|
2
2
|
import { FlashState } from "./const";
|
|
3
3
|
export declare const flash: (onEvent: (state: FlashState) => void, esploader: any, // ESPLoader instance from tasmota-webserial-esptool
|
|
4
|
-
logger: Logger, manifestPath: string, eraseFirst: boolean, firmwareBuffer: Uint8Array,
|
|
4
|
+
logger: Logger, manifestPath: string, eraseFirst: boolean, firmwareBuffer: Uint8Array, _baudRate?: number) => Promise<void>;
|
package/dist/flash.js
CHANGED
|
@@ -2,7 +2,7 @@ import { getChipFamilyName } from "./util/chip-family-name";
|
|
|
2
2
|
import { sleep } from "./util/sleep";
|
|
3
3
|
import { corsProxyFetch } from "./util/cors-proxy";
|
|
4
4
|
export const flash = async (onEvent, esploader, // ESPLoader instance from tasmota-webserial-esptool
|
|
5
|
-
logger, manifestPath, eraseFirst, firmwareBuffer,
|
|
5
|
+
logger, manifestPath, eraseFirst, firmwareBuffer, _baudRate) => {
|
|
6
6
|
let manifest;
|
|
7
7
|
let build;
|
|
8
8
|
let chipFamily;
|
|
@@ -14,8 +14,8 @@ logger, manifestPath, eraseFirst, firmwareBuffer, baudRate) => {
|
|
|
14
14
|
chipFamily,
|
|
15
15
|
chipVariant,
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
let manifestProm = null;
|
|
18
|
+
let manifestURL = "";
|
|
19
19
|
try {
|
|
20
20
|
manifestProm = JSON.parse(manifestPath);
|
|
21
21
|
}
|
|
@@ -198,7 +198,7 @@ logger, manifestPath, eraseFirst, firmwareBuffer, baudRate) => {
|
|
|
198
198
|
for (let i = 0; i < build.parts.length; i++) {
|
|
199
199
|
const part = build.parts[i];
|
|
200
200
|
const data = files[i];
|
|
201
|
-
await espStub.flashData(data, (bytesWritten,
|
|
201
|
+
await espStub.flashData(data, (bytesWritten, _bytesTotal) => {
|
|
202
202
|
const newPct = Math.floor(((totalBytesWritten + bytesWritten) / totalSize) * 100);
|
|
203
203
|
if (newPct === lastPct) {
|
|
204
204
|
return;
|
package/dist/install-dialog.js
CHANGED
|
@@ -505,8 +505,8 @@ export class EwtInstallDialog extends LitElement {
|
|
|
505
505
|
_renderDashboard() {
|
|
506
506
|
const heading = this._info.name;
|
|
507
507
|
let content;
|
|
508
|
-
|
|
509
|
-
|
|
508
|
+
const hideActions = true;
|
|
509
|
+
const allowClosing = true;
|
|
510
510
|
content = html `
|
|
511
511
|
<ew-list>
|
|
512
512
|
<ew-list-item>
|
|
@@ -828,8 +828,8 @@ export class EwtInstallDialog extends LitElement {
|
|
|
828
828
|
_renderDashboardNoImprov() {
|
|
829
829
|
const heading = "Device Dashboard";
|
|
830
830
|
let content;
|
|
831
|
-
|
|
832
|
-
|
|
831
|
+
const hideActions = true;
|
|
832
|
+
const allowClosing = true;
|
|
833
833
|
content = html `
|
|
834
834
|
<ew-list>
|
|
835
835
|
<ew-list-item
|
|
@@ -1099,8 +1099,8 @@ export class EwtInstallDialog extends LitElement {
|
|
|
1099
1099
|
case 3 /* ImprovSerialErrorState.UNABLE_TO_CONNECT */:
|
|
1100
1100
|
error = "Unable to connect";
|
|
1101
1101
|
break;
|
|
1102
|
+
// UNKNOWN_RPC_COMMAND happens when list SSIDs not supported.
|
|
1102
1103
|
case 0 /* ImprovSerialErrorState.NO_ERROR */:
|
|
1103
|
-
// Happens when list SSIDs not supported.
|
|
1104
1104
|
case 2 /* ImprovSerialErrorState.UNKNOWN_RPC_COMMAND */:
|
|
1105
1105
|
break;
|
|
1106
1106
|
default:
|
|
@@ -1159,9 +1159,6 @@ export class EwtInstallDialog extends LitElement {
|
|
|
1159
1159
|
name="password"
|
|
1160
1160
|
type="password"
|
|
1161
1161
|
></ew-filled-text-field>
|
|
1162
|
-
<ew-text-button slot="actions" @click=${this._doProvision}
|
|
1163
|
-
>Connect</ew-text-button
|
|
1164
|
-
>
|
|
1165
1162
|
<ew-text-button
|
|
1166
1163
|
slot="actions"
|
|
1167
1164
|
@click=${async () => {
|
|
@@ -1185,6 +1182,9 @@ export class EwtInstallDialog extends LitElement {
|
|
|
1185
1182
|
? "Skip"
|
|
1186
1183
|
: "Back"}</ew-text-button
|
|
1187
1184
|
>
|
|
1185
|
+
<ew-text-button slot="actions" @click=${this._doProvision}
|
|
1186
|
+
>Connect</ew-text-button
|
|
1187
|
+
>
|
|
1188
1188
|
`;
|
|
1189
1189
|
}
|
|
1190
1190
|
return [heading, content, hideActions];
|
|
@@ -1203,17 +1203,17 @@ export class EwtInstallDialog extends LitElement {
|
|
|
1203
1203
|
<ew-text-button
|
|
1204
1204
|
slot="actions"
|
|
1205
1205
|
@click=${() => {
|
|
1206
|
-
|
|
1207
|
-
this._startInstall(checkbox.checked);
|
|
1206
|
+
this._state = "DASHBOARD";
|
|
1208
1207
|
}}
|
|
1209
|
-
>
|
|
1208
|
+
>Back</ew-text-button
|
|
1210
1209
|
>
|
|
1211
1210
|
<ew-text-button
|
|
1212
1211
|
slot="actions"
|
|
1213
1212
|
@click=${() => {
|
|
1214
|
-
|
|
1213
|
+
const checkbox = this.shadowRoot.querySelector("ew-checkbox");
|
|
1214
|
+
this._startInstall(checkbox.checked);
|
|
1215
1215
|
}}
|
|
1216
|
-
>
|
|
1216
|
+
>Next</ew-text-button
|
|
1217
1217
|
>
|
|
1218
1218
|
`;
|
|
1219
1219
|
return [heading, content];
|
|
@@ -1229,6 +1229,13 @@ export class EwtInstallDialog extends LitElement {
|
|
|
1229
1229
|
content = html `
|
|
1230
1230
|
Do you want to reset your device and erase all user data from your
|
|
1231
1231
|
device?
|
|
1232
|
+
<ew-text-button
|
|
1233
|
+
slot="actions"
|
|
1234
|
+
@click=${() => {
|
|
1235
|
+
this._state = "DASHBOARD";
|
|
1236
|
+
}}
|
|
1237
|
+
>Back</ew-text-button
|
|
1238
|
+
>
|
|
1232
1239
|
<ew-text-button
|
|
1233
1240
|
class="danger"
|
|
1234
1241
|
slot="actions"
|
|
@@ -1250,9 +1257,6 @@ export class EwtInstallDialog extends LitElement {
|
|
|
1250
1257
|
${this._installErase
|
|
1251
1258
|
? html `<br /><br />All data on the device will be erased.`
|
|
1252
1259
|
: ""}
|
|
1253
|
-
<ew-text-button slot="actions" @click=${this._confirmInstall}
|
|
1254
|
-
>Install</ew-text-button
|
|
1255
|
-
>
|
|
1256
1260
|
<ew-text-button
|
|
1257
1261
|
slot="actions"
|
|
1258
1262
|
@click=${() => {
|
|
@@ -1260,6 +1264,9 @@ export class EwtInstallDialog extends LitElement {
|
|
|
1260
1264
|
}}
|
|
1261
1265
|
>Back</ew-text-button
|
|
1262
1266
|
>
|
|
1267
|
+
<ew-text-button slot="actions" @click=${this._confirmInstall}
|
|
1268
|
+
>Install</ew-text-button
|
|
1269
|
+
>
|
|
1263
1270
|
`;
|
|
1264
1271
|
}
|
|
1265
1272
|
else if (!this._installState ||
|
|
@@ -1347,9 +1354,9 @@ export class EwtInstallDialog extends LitElement {
|
|
|
1347
1354
|
return [heading, content, hideActions, allowClosing];
|
|
1348
1355
|
}
|
|
1349
1356
|
_renderLogs() {
|
|
1350
|
-
|
|
1357
|
+
const heading = `Logs`;
|
|
1351
1358
|
let content;
|
|
1352
|
-
|
|
1359
|
+
const hideActions = false;
|
|
1353
1360
|
content = html `
|
|
1354
1361
|
<ew-console
|
|
1355
1362
|
.port=${this._port}
|
|
@@ -1625,7 +1632,7 @@ export class EwtInstallDialog extends LitElement {
|
|
|
1625
1632
|
try {
|
|
1626
1633
|
ssids = await this._client.scan();
|
|
1627
1634
|
}
|
|
1628
|
-
catch (
|
|
1635
|
+
catch (_err) {
|
|
1629
1636
|
// When we fail while loading, pick "Join other"
|
|
1630
1637
|
if (this._ssids === undefined) {
|
|
1631
1638
|
this._ssids = null;
|
|
@@ -1713,7 +1720,7 @@ export class EwtInstallDialog extends LitElement {
|
|
|
1713
1720
|
try {
|
|
1714
1721
|
this._manifest = await downloadManifest(this.manifestPath);
|
|
1715
1722
|
}
|
|
1716
|
-
catch (
|
|
1723
|
+
catch (_err) {
|
|
1717
1724
|
this._state = "ERROR";
|
|
1718
1725
|
this._error = "Failed to download manifest";
|
|
1719
1726
|
this._busy = false;
|
|
@@ -2087,7 +2094,7 @@ export class EwtInstallDialog extends LitElement {
|
|
|
2087
2094
|
try {
|
|
2088
2095
|
await this._client.provision(ssid, password);
|
|
2089
2096
|
}
|
|
2090
|
-
catch (
|
|
2097
|
+
catch (_err) {
|
|
2091
2098
|
return;
|
|
2092
2099
|
}
|
|
2093
2100
|
finally {
|
package/dist/util/cors-proxy.js
CHANGED
|
@@ -32,7 +32,7 @@ export const corsProxyFetch = async (url, options) => {
|
|
|
32
32
|
// GitHub releases don't support CORS, use proxy directly
|
|
33
33
|
if (url.includes("github.com") && url.includes("/releases/download/")) {
|
|
34
34
|
const proxiedUrl = `${CORS_PROXY}/?url=${encodeURIComponent(url)}`;
|
|
35
|
-
const { headers, credentials, ...safeOptions } = options !== null && options !== void 0 ? options : {};
|
|
35
|
+
const { headers: _headers, credentials: _credentials, ...safeOptions } = options !== null && options !== void 0 ? options : {};
|
|
36
36
|
return fetch(proxiedUrl, safeOptions);
|
|
37
37
|
}
|
|
38
38
|
// Try direct fetch first for other cross-origin requests
|
|
@@ -44,10 +44,10 @@ export const corsProxyFetch = async (url, options) => {
|
|
|
44
44
|
// Direct fetch failed, try proxy
|
|
45
45
|
try {
|
|
46
46
|
const proxiedUrl = `${CORS_PROXY}/?url=${encodeURIComponent(url)}`;
|
|
47
|
-
const { headers, credentials, ...safeOptions } = options !== null && options !== void 0 ? options : {};
|
|
47
|
+
const { headers: _headers, credentials: _credentials, ...safeOptions } = options !== null && options !== void 0 ? options : {};
|
|
48
48
|
return await fetch(proxiedUrl, safeOptions);
|
|
49
49
|
}
|
|
50
|
-
catch (
|
|
50
|
+
catch (_proxyError) {
|
|
51
51
|
// Both failed, throw the original error
|
|
52
52
|
throw directError;
|
|
53
53
|
}
|