Skip to content

Commit

Permalink
Allow version to be specified and added as query param (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Oct 21, 2024
1 parent 4cae3dc commit 5b4f0f1
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,34 @@
</head>

<body>
<h1>Install Production Firmware</h1>
<esp-web-install-button
manifest="https://firmware.esphome.io/home-assistant-voice-pe/home-assistant-voice/manifest.json"></esp-web-install-button>
<div>

<h2>Install Beta Firmware</h2>
<esp-web-install-button
manifest="https://firmware.esphome.io/home-assistant-voice-pe/home-assistant-voice/manifest-beta.json"></esp-web-install-button>
<h1>Install Voice PE Latest Firmware</h1>
<esp-web-install-button
manifest="https://firmware.esphome.io/home-assistant-voice-pe/home-assistant-voice/manifest.json">
</esp-web-install-button>
</div>
<br />
<details>
<summary>Install Specific Version</summary>
Version: <input />
</details>
<script>
function setVersion(version) {
document.querySelector('h1').innerHTML = `Install Voice PE v${version}`;
document.querySelector('esp-web-install-button').manifest = `https://firmware.esphome.io/home-assistant-voice-pe/home-assistant-voice/${version}/manifest.json`;
}

document.querySelector('input').addEventListener('change', ev => {
const version = ev.target.value;
setVersion(version);
});
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('version')) {
const version = urlParams.get('version');
setVersion(version);
}
</script>

</body>
<script type="module" src="https://unpkg.com/esp-web-tools@10/dist/web/install-button.js?module"></script>
Expand Down

0 comments on commit 5b4f0f1

Please sign in to comment.