index.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <html>
  2. <head>
  3. <title>ESP Web Tools</title>
  4. <style>
  5. body {
  6. font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI",
  7. Roboto, Ubuntu, sans-serif;
  8. padding: 0;
  9. margin: 0;
  10. line-height: 1.4;
  11. }
  12. .content {
  13. max-width: 600px;
  14. margin: 0 auto;
  15. padding: 12px;
  16. }
  17. esp-web-flash-button {
  18. display: inline-block;
  19. margin-bottom: 8px;
  20. }
  21. a {
  22. color: #03a9f4;
  23. }
  24. </style>
  25. <script module>
  26. import(
  27. // In development we import locally.
  28. window.location.hostname === "localhost"
  29. ? "/dist/web/install-button.js"
  30. : "https://unpkg.com/esp-web-tools@1.0.0/dist/web/install-button.js?module"
  31. );
  32. </script>
  33. </head>
  34. <body>
  35. <div class="content">
  36. <h1>ESP Web Tools</h1>
  37. <p>
  38. ESP Web Tools is a set of tools to allow working with ESP devices in the
  39. browser.
  40. </p>
  41. <p>
  42. To flash the ESPHome firmware, connect an ESP to your computer and hit
  43. the button:
  44. </p>
  45. <esp-web-install-button
  46. manifest="firmware_build/manifest.json"
  47. ></esp-web-install-button>
  48. <p>
  49. <i
  50. >Note, this only works in desktop Chrome and Edge. Android support has
  51. not been implemented yet.</i
  52. >
  53. </p>
  54. <p>
  55. This works by combining Web Serial with a
  56. <a href="firmware_build/manifest.json">manifest</a> which describes the
  57. firmware. It will automatically detect the type of the connected ESP
  58. device and find the right firmware files in the manifest.
  59. </p>
  60. <p>
  61. To add this to your own website, create a manifest and add the button
  62. pointing at it to your website:
  63. </p>
  64. <pre>
  65. &lt;script
  66. type="module"
  67. src="https://unpkg.com/esp-web-tools@1.0.0/dist/web/install-button.js?module"
  68. >&lt;/script>
  69. &lt;esp-web-install-button
  70. manifest="firmware_build/manifest.json"
  71. >&lt;/esp-web-install-button></pre
  72. >
  73. <p>
  74. Add the attribute <code>erase-first</code> if you want to first fully
  75. erase the ESP prior to installation.
  76. </p>
  77. <p>
  78. Customize the button or unsupported message by using the
  79. <code>activate</code> and <code>unsupported</code> slots:
  80. </p>
  81. <pre>
  82. &lt;esp-web-install-button
  83. manifest="firmware_build/manifest.json"
  84. erase-first
  85. >
  86. &lt;button slot="activate">Custom install button&lt;/button>
  87. &lt;span slot="unsupported">Ah snap, your browser doesn't work!&lt;/span>
  88. &lt;/esp-web-install-button>
  89. </pre
  90. >
  91. </div>
  92. </body>
  93. </html>