Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.6 KiB

  1. #!/bin/bash
  2. environments=$@
  3. # Environments to build
  4. ALL_ENVIRONMENTS="
  5. tinkerman-espurna-h
  6. itead-sonoff-basic itead-sonoff-rf itead-sonoff-basic-dht22 itead-sonoff-basic-ds18b20
  7. itead-sonoff-pow itead-sonoff-dual itead-sonoff-4ch itead-sonoff-4ch-pro
  8. itead-sonoff-touch itead-sonoff-b1 itead-sonoff-led itead-sonoff-rfbridge
  9. itead-sonoff-t1-1ch itead-sonoff-t1-2ch itead-sonoff-t1-3ch
  10. itead-slampher itead-s20 itead-1ch-inching itead-motor itead-bnsz01
  11. electrodragon-wifi-iot
  12. workchoice-ecoplug
  13. jangoe-wifi-relay
  14. openenergymonitor-mqtt-relay
  15. jorgegarcia-wifi-relays
  16. aithinker-ai-light
  17. magichome-led-controller
  18. huacanxing-h801
  19. "
  20. if [ $# -eq 0 ]; then
  21. environments=$ALL_ENVIRONMENTS
  22. fi
  23. # Get current version
  24. version=`cat espurna/config/version.h | grep APP_VERSION | awk '{print $3}' | sed 's/"//g'`
  25. echo "--------------------------------------------------------------"
  26. echo "ESPURNA FIRMWARE BUILDER"
  27. echo "Building for version $version"
  28. # Create output folder
  29. mkdir -p firmware
  30. # Recreate web interface
  31. echo "--------------------------------------------------------------"
  32. echo "Building web interface..."
  33. node node_modules/gulp/bin/gulp.js || exit
  34. # Build all the required firmwares
  35. echo "--------------------------------------------------------------"
  36. echo "Building firmware images..."
  37. for environment in $environments; do
  38. echo "* espurna-$version-$environment.bin"
  39. platformio run -s -e $environment || exit
  40. mv .pioenvs/$environment/firmware.bin firmware/espurna-$version-$environment.bin
  41. done
  42. echo "--------------------------------------------------------------"