From d0efbac292d58e48be1ddbce990458b77012e2c8 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 12 Apr 2022 11:39:21 -0700 Subject: [PATCH] Rename checkSameFirmwareVersion to checkSameFirmware (#217) --- index.html | 6 +++--- src/install-dialog.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 5ef1c3a..c5078b4 100644 --- a/index.html +++ b/index.html @@ -409,8 +409,8 @@ be setting the overrides property on <esp-web-install-button>. The value is an object containing a - checkSameFirmwareVersion(manifest, improvInfo) function. - The manifest parameter is your manifest and + checkSameFirmware(manifest, improvInfo) function. The + manifest parameter is your manifest and improvInfo is the information returned from Improv: { name, firmware, version, chipFamily }. This check is only called if the device firmware was detected via Improv. @@ -418,7 +418,7 @@
 const button = document.querySelector('esp-web-install-button');
 button.overrides = {
-  checkSameFirmwareVersion(manifest, improvInfo) {
+  checkSameFirmware(manifest, improvInfo) {
     const manifestFirmware = manifest.name.toLowerCase();
     const deviceFirmware = improvInfo.firmware.toLowerCase();
     return manifestFirmware.includes(deviceFirmware);
diff --git a/src/install-dialog.ts b/src/install-dialog.ts
index 70b84a8..ec2c0bb 100644
--- a/src/install-dialog.ts
+++ b/src/install-dialog.ts
@@ -38,7 +38,7 @@ export class EwtInstallDialog extends LitElement {
   public logger: Logger = console;
 
   public overrides?: {
-    checkSameFirmwareVersion?: (
+    checkSameFirmware?: (
       manifest: Manifest,
       deviceImprov: ImprovSerial["info"]
     ) => boolean;
@@ -886,8 +886,8 @@ export class EwtInstallDialog extends LitElement {
   private get _isSameFirmware() {
     return !this._info
       ? false
-      : this.overrides?.checkSameFirmwareVersion
-      ? this.overrides.checkSameFirmwareVersion(this._manifest, this._info)
+      : this.overrides?.checkSameFirmware
+      ? this.overrides.checkSameFirmware(this._manifest, this._info)
       : this._info.firmware === this._manifest.name;
   }