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.

50 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. wion-50055
  20. exs-wifi-relay-v31
  21. "
  22. if [ $# -eq 0 ]; then
  23. environments=$ALL_ENVIRONMENTS
  24. fi
  25. # Get current version
  26. version=`cat espurna/config/version.h | grep APP_VERSION | awk '{print $3}' | sed 's/"//g'`
  27. echo "--------------------------------------------------------------"
  28. echo "ESPURNA FIRMWARE BUILDER"
  29. echo "Building for version $version"
  30. # Create output folder
  31. mkdir -p firmware
  32. # Recreate web interface
  33. echo "--------------------------------------------------------------"
  34. echo "Building web interface..."
  35. node node_modules/gulp/bin/gulp.js || exit
  36. # Build all the required firmwares
  37. echo "--------------------------------------------------------------"
  38. echo "Building firmware images..."
  39. for environment in $environments; do
  40. echo "* espurna-$version-$environment.bin"
  41. platformio run -s -e $environment || exit
  42. mv .pioenvs/$environment/firmware.bin firmware/espurna-$version-$environment.bin
  43. done
  44. echo "--------------------------------------------------------------"