Giter VIP home page Giter VIP logo

esp-web-tools's Introduction

ESP Web Tools

Allow flashing ESPHome or other ESP-based firmwares via the browser. Will automatically detect the board type and select a supported firmware.

<esp-web-install-button
  manifest="firmware_esphome/manifest.json"
></esp-web-install-button>

Manifest definition:

{
  "name": "ESPHome",
  "builds": [
    {
      "chipFamily": "ESP32",
      "improv": true,
      "parts": [
        { "path": "bootloader.bin", "offset": 4096 },
        { "path": "partitions.bin", "offset": 32768 },
        { "path": "ota.bin", "offset": 57344 },
        { "path": "firmware.bin", "offset": 65536 }
      ]
    },
    {
      "chipFamily": "ESP8266",
      "parts": [
        { "path": "esp8266.bin", "offset": 0 },
      ]
    }
  ]
}

Allows for optionally passing an attribute to trigger an erase before installation.

<esp-web-install-button
  manifest="firmware_esphome/manifest.json"
  erase-first
></esp-web-install-button>

All attributes can also be set via properties (manifest, eraseFirst)

Styling

Attributes

The following attributes are automatically added to <esp-web-install-button> and can be used for styling:

Attribute Description
install-supported Added if installing firmware is supported
install-unsupported Added if installing firmware is not supported
active Added when flashing is active

You can add the following attributes or properties to change the UI elements:

Attribute Property Description
show-log showLog Show a log style view of the progress instead of a progress bar
hide-progress hideProgress Hides all progress UI elements

CSS custom properties (variables)

The following variables can be used to change the colors of the default UI elements:

  • --esp-tools-button-color
  • --esp-tools-button-text-color
  • --esp-tools-success-color
  • --esp-tools-error-color
  • --esp-tools-progress-color
  • --esp-tools-log-background
  • --esp-tools-log-text-color

Slots

The following slots are available:

Slot name Description
activate Button to start the flash progress
unsupported Message to show when the browser is not supported
not-allowed Message to show when not a secure context

Events

When the state of flashing changes, a state-changed event is fired.

A state-changed event contains the following information:

Field Description
state The current state
message A description of the current state
manifest The loaded manifest
build The manifest's build that was selected
chipFamily The chip that was detected;ย "ESP32" | "ESP8266" | "ESP32-S2" | "Unknown Chip"
details An optional extra field that is different per state

Development

Run script/develop. This starts a server. Open it on http://localhost:5000.

esp-web-tools's People

Contributors

balloob avatar bramkragten avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.