mirror of
https://github.com/esphome/esp-web-tools.git
synced 2025-07-28 06:06:36 +00:00
Bump esp-web-flasher to 2.0 + hide improv button when done provision is done (#14)
This commit is contained in:
parent
56a1dd7193
commit
7f03060e86
18
package-lock.json
generated
18
package-lock.json
generated
@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "esp-web-tools",
|
||||
"version": "2.0.2",
|
||||
"version": "3.1.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"version": "2.0.2",
|
||||
"version": "3.1.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@material/mwc-base": "^0.21.0",
|
||||
"@material/mwc-linear-progress": "^0.21.0",
|
||||
"esp-web-flasher": "^1.0.4",
|
||||
"esp-web-flasher": "^2.0.0",
|
||||
"lit": "^2.0.0-rc.2",
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
@ -556,9 +556,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/esp-web-flasher": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/esp-web-flasher/-/esp-web-flasher-1.0.4.tgz",
|
||||
"integrity": "sha512-n1LrBV6M5fu4k06zh7IW5FbpBnLTrPxTRO2YrpRu5ahqG0FO2dsxLkASdlOhVzSHtKNo29ZG4IS6nPtxlLiL5A==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/esp-web-flasher/-/esp-web-flasher-2.0.0.tgz",
|
||||
"integrity": "sha512-vLAVJbWYL/wNIv5AQ8XwqO61ORnbtmbbAMFJJ1C0fMSUnu4J/rogWZYHZLNLZbtjp0XL5nbu8RWjXCE6DeSTjw==",
|
||||
"dependencies": {
|
||||
"tslib": "^2.2.0"
|
||||
}
|
||||
@ -1925,9 +1925,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"esp-web-flasher": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/esp-web-flasher/-/esp-web-flasher-1.0.4.tgz",
|
||||
"integrity": "sha512-n1LrBV6M5fu4k06zh7IW5FbpBnLTrPxTRO2YrpRu5ahqG0FO2dsxLkASdlOhVzSHtKNo29ZG4IS6nPtxlLiL5A==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/esp-web-flasher/-/esp-web-flasher-2.0.0.tgz",
|
||||
"integrity": "sha512-vLAVJbWYL/wNIv5AQ8XwqO61ORnbtmbbAMFJJ1C0fMSUnu4J/rogWZYHZLNLZbtjp0XL5nbu8RWjXCE6DeSTjw==",
|
||||
"requires": {
|
||||
"tslib": "^2.2.0"
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
"dependencies": {
|
||||
"@material/mwc-base": "^0.21.0",
|
||||
"@material/mwc-linear-progress": "^0.21.0",
|
||||
"esp-web-flasher": "^1.0.4",
|
||||
"esp-web-flasher": "^2.0.0",
|
||||
"lit": "^2.0.0-rc.2",
|
||||
"tslib": "^2.2.0"
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ export const flash = async (
|
||||
});
|
||||
|
||||
await sleep(100);
|
||||
await esploader.softReset();
|
||||
await esploader.hardReset();
|
||||
await esploader.disconnect();
|
||||
|
||||
fireStateEvent({
|
||||
|
@ -110,12 +110,24 @@ const startImprov = async (button: InstallButton) => {
|
||||
// @ts-ignore
|
||||
await import("https://www.improv-wifi.com/sdk-js/launch-button.js");
|
||||
|
||||
if (!customElements.get("improv-wifi-launch-button").isSupported) {
|
||||
const improvButtonConstructor = customElements.get(
|
||||
"improv-wifi-launch-button"
|
||||
);
|
||||
|
||||
if (
|
||||
!improvButtonConstructor.isSupported ||
|
||||
!improvButtonConstructor.isAllowed
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!improvEl) {
|
||||
improvEl = document.createElement("improv-wifi-launch-button");
|
||||
improvEl.addEventListener("state-changed", (ev: any) => {
|
||||
if (ev.detail.state === "PROVISIONED") {
|
||||
improvEl!.classList.toggle("hidden", true);
|
||||
}
|
||||
});
|
||||
const improvButton = document.createElement("button");
|
||||
improvButton.slot = "activate";
|
||||
improvButton.textContent = "CLICK HERE TO FINISH SETTING UP YOUR DEVICE";
|
||||
|
Loading…
x
Reference in New Issue
Block a user