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.

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