diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index b4e2b52..e68c3c7 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -43,25 +43,11 @@ jobs: name: Turn on test environment runs-on: ubuntu-latest env: - TPLINK_USER: ${{ secrets.TPLINK_USER }} - TPLINK_PASS: ${{ secrets.TPLINK_PASS }} + HOMEASSISTANT_TOKEN: ${{ secrets.HOMEASSISTANT_TOKEN }} steps: - - name: Setup Node.js environment - uses: actions/setup-node@v2-beta - with: - node-version: 11.x - - uses: actions/checkout@v2 - - name: Install npm dependencies - run: | - pushd ext-res/tests - npm install - popd - name: Powering on the dev-environment run: | - pushd ext-res/tests - node ./switch.js --dev MEROSS_LAB --toggle=on - popd - + curl -X POST -k --header "Content-Type: application/json" --header "Authorization: Bearer $HOMEASSISTANT_TOKEN" https://milano.geniola.it/api/services/switch/turn_on -d "{\"entity_id\":\"switch.meross_lab\"}" # --------------------------------- # Testing # --------------------------------- @@ -136,28 +122,15 @@ jobs: # Turn off ENV # ------------------------------ turn-off-env: - name: Turn off test environment runs-on: ubuntu-latest needs: [test] env: - TPLINK_USER: ${{ secrets.TPLINK_USER }} - TPLINK_PASS: ${{ secrets.TPLINK_PASS }} + HOMEASSISTANT_TOKEN: ${{ secrets.HOMEASSISTANT_TOKEN }} steps: - - name: Setup Node.js environment - uses: actions/setup-node@v2-beta - with: - node-version: 11.x - - uses: actions/checkout@v2 - - name: Install npm dependencies - run: | - pushd ext-res/tests - npm install - popd - name: Powering on the dev-environment run: | - pushd ext-res/tests - node ./switch.js --dev MEROSS_LAB --toggle=off - popd + curl -X POST -k --header "Content-Type: application/json" --header "Authorization: Bearer $HOMEASSISTANT_TOKEN" https://milano.geniola.it/api/services/switch/turn_on -d "{\"entity_id\":\"switch.meross_lab\"}" + name: Turn off test environment if: ${{ always() }} # ------------------------------