mirror of
https://github.com/esphome/esp-web-tools.git
synced 2025-07-28 06:06:36 +00:00
Rename checkSameFirmwareVersion to checkSameFirmware (#217)
This commit is contained in:
parent
c90e17a5ff
commit
d0efbac292
@ -409,8 +409,8 @@
|
||||
be setting the <code>overrides</code> property on
|
||||
<code><esp-web-install-button></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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user