From 2551e9b5b5ec9e81feaa7ed1c28b3bdc5905c6c5 Mon Sep 17 00:00:00 2001 From: Alberto Geniola Date: Mon, 25 Sep 2023 20:10:06 +0200 Subject: [PATCH] Update build-dev.yml Update turn-on and turn-off --- .github/workflows/build-dev.yml | 37 +++++---------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) 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() }} # ------------------------------