diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bcf9567c..0475d5ad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@master - uses: DoozyX/clang-format-lint-action@v0.11 with: source: './pio/src' @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@master with: fetch-depth: '0' - name: Get versionname diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..73a37f3e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +on: + push: + tags: + - '*' + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + with: + fetch-depth: '0' + - name: Get versionname + id: get-ver + run: | + echo ::set-output name=ver_name::$(git describe --tags) + - name: Print version + run: | + echo ${{ steps.get-ver.outputs.ver_name }} + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Cache PlatformIO + uses: actions/cache@v2 + with: + path: ~/.platformio + key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} + - name: Set up Python + uses: actions/setup-python@v2 + - name: Install PlatformIO + run: | + python -m pip install --upgrade pip + pip install --upgrade platformio + - name: Install library dependencies + run: pio lib -g install 1 + - name: Run PlatformIO + run: pio run -e d1_mini_git + - name: Save firmware + uses: actions/upload-artifact@v2 + with: + name: firmware + path: .pio/build/d1_mini_git/firmware.bin + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + .pio/build/d1_mini_git/firmware.bin diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6a46b226..00000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: python -python: - - "3.7" - -# Cache PlatformIO packages using Travis CI container-based infrastructure -sudo: false -cache: - directories: - - "~/.platformio" - - $HOME/.cache/pip - -install: - - pip install -U platformio - - pio update - -script: - - platformio run -e d1_mini - -deploy: - provider: releases - prerelease: false - api_key: - secure: bU4iotLTrslYAlXQmSoMaGfCsjpM96TrKKne/2gFTlg++EQwjD/Z/i6T59lO7YVwp1GTD3qp/E4vSXfgkEm559mFIKZkd1IT8Vx/hpjX5CU6/OinGNmj1hYJw5M9DI1kQtc0wFDpbyNDnjPpKqBpFmIpqFyJUC7b3vctk/BMPkiiI5ncuBGp2f35M4qN2FedpTWoZdSAVZms7hsKFP4qZcih6stSlncUNf/niLwf78B31r5Td3G1aYQtHkB0BzyGQSgCvVuZ+PBm6zD/EWqRUGo6OWBCgwykbIZlgu45J4q46yQ2uS1CvRf4DFzIWU79bPg26MmxpjFe3oZucITTUtvOSzHFn8b1nuJE8IajYdM1KHSREl8Piej3A446P+JDQPk6ki3jCRyQentaZofI2ePUuqrvsV3iL4qKXMWpX1cOGU2c6nx0vvl/oft4rEcccibGpGZr0RIL7Ebpp7D4DSQ+bM+2XkuFab3W3QdrqrB6A0DOJuJfu/MvxEgkLtlpypZ2Z3g/F/TDgJkLSNEvX9e6kGAAIiIgkKz/zuuy04eNX+jox22TldovjbNSMCDfeeD6ghfKm0Q1+mdZax2dhvldgKOiwcZFL+TozN3AdPkr5GG/9m+dVaUGdrMK/n6uEJ++FZeUmdT8Pa2u/m3w2A4zeqMUWLM4WZMaUDW4cnA= - file: ".pio/build/d1_mini/firmware.bin" - skip_cleanup: true - overwrite: true - on: - tags: true diff --git a/pio/src/iSpindel.cpp b/pio/src/iSpindel.cpp index 3a3c8d03..7deef1b9 100644 --- a/pio/src/iSpindel.cpp +++ b/pio/src/iSpindel.cpp @@ -787,11 +787,13 @@ bool uploadData(uint8_t service) { CONSOLELN(F("adding BRICKS params")); - if (my_token[0] != 0) { + if (my_token[0] != 0) + { CONSOLELN(F("found token")); sender.add("apikey", my_token); // use the token field as vessel for the api key } - else { + else + { CONSOLELN(F("missing token in params")); } @@ -804,7 +806,7 @@ bool uploadData(uint8_t service) sender.add("chipid", chipidHashed); sender.add("s_number_wort_0", (float)(round(Gravity * 10) / 10)); sender.add("s_number_temp_0", (float)(round(Temperatur * 10) / 10)); // always transmit °C - sender.add("s_number_voltage_0", (float)round(Volt * 100 ) / 100 ); + sender.add("s_number_voltage_0", (float)round(Volt * 100) / 100); sender.add("s_number_wifi_0", WiFi.RSSI()); sender.add("s_number_tilt_0", (float)(round(Tilt * 100) / 100)); @@ -1254,11 +1256,11 @@ void setup() initDS18B20(); initAccel(); - #ifdef WIFI_IS_OFF_AT_BOOT - // persistence is disabled by default and WiFi does not start automatically at boot - // source: https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/generic-class.html#persistent - enableWiFiAtBootTime(); - #endif +#ifdef WIFI_IS_OFF_AT_BOOT + // persistence is disabled by default and WiFi does not start automatically at boot + // source: https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/generic-class.html#persistent + enableWiFiAtBootTime(); +#endif // decide whether we want configuration mode or normal mode if (shouldStartConfig(validConf))