Rename checkSameFirmwareVersion to checkSameFirmware (#217)

This commit is contained in:
Paulus Schoutsen 2022-04-12 11:39:21 -07:00 committed by GitHub
parent c90e17a5ff
commit d0efbac292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -409,8 +409,8 @@
be setting the <code>overrides</code> property on
<code>&lt;esp-web-install-button&gt;</code>. The value is an object
containing a
<code>checkSameFirmwareVersion(manifest, improvInfo)</code> function.
The <code>manifest</code> parameter is your manifest and
<code>checkSameFirmware(manifest, improvInfo)</code> function. The
<code>manifest</code> parameter is your manifest and
<code>improvInfo</code> is the information returned from Improv:
<code>{ name, firmware, version, chipFamily }</code>. This check is only
called if the device firmware was detected via Improv.
@ -418,7 +418,7 @@
<pre>
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);

View File

@ -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;
}