mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
move tests
This commit is contained in:
@@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# API
|
|
||||||
|
|
||||||
curl -X GET http://ems-esp.local/api/system/info
|
|
||||||
echo "\n"
|
|
||||||
|
|
||||||
# HA
|
|
||||||
|
|
||||||
ha_url="http://192.168.1.42:8123"
|
|
||||||
ha_token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIwMzMyZjU1MjhlZmM0NGIyOTgyMjIxNThiODU1NDkyNSIsImlhdCI6MTcyMTMwNDg2NSwiZXhwIjoyMDM2NjY0ODY1fQ.Q-Y7E_i7clH3ff4Ma-OMmhZfbN7aMi_CahKwmoar"
|
|
||||||
|
|
||||||
curl -X POST \
|
|
||||||
${ha_url}/api/services/script/test_notify \
|
|
||||||
-H "Authorization: Bearer ${ha_token}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
@@ -3,7 +3,8 @@
|
|||||||
# Open this file in VSC, modify the token, go to the API call and click on 'Send Request' (or Ctrl+Alt+R)
|
# Open this file in VSC, modify the token, go to the API call and click on 'Send Request' (or Ctrl+Alt+R)
|
||||||
# The response will be shown in the right panel
|
# The response will be shown in the right panel
|
||||||
|
|
||||||
@host = http://ems-esp.local
|
# @host = http://ems-esp.local
|
||||||
|
@host = http://192.168.1.206
|
||||||
@host_dev = http://10.10.10.175
|
@host_dev = http://10.10.10.175
|
||||||
@host_standalone = http://localhost:3080
|
@host_standalone = http://localhost:3080
|
||||||
@host_standalone2 = http://localhost:3082
|
@host_standalone2 = http://localhost:3082
|
||||||
31
test/test_api/api_test.sh
Executable file
31
test/test_api/api_test.sh
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Command line test for the API
|
||||||
|
#
|
||||||
|
|
||||||
|
# EMS_ESP API
|
||||||
|
|
||||||
|
emsesp_url="http://192.168.1.206"
|
||||||
|
emsesp_token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiYWRtaW4iOnRydWV9.2bHpWya2C7Q12WjNUBD6_7N3RCD7CMl-EGhyQVzFdDg"
|
||||||
|
|
||||||
|
curl -X GET ${emsesp_url}/api/system/info
|
||||||
|
echo "\n"
|
||||||
|
|
||||||
|
curl -X POST \
|
||||||
|
-H "Authorization: Bearer ${emsesp_token}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"data":"8 1"}' \
|
||||||
|
${emsesp_url}/api/system/read
|
||||||
|
|
||||||
|
echo "\n"
|
||||||
|
|
||||||
|
# HA API
|
||||||
|
|
||||||
|
ha_url="http://192.168.1.42:8123"
|
||||||
|
ha_token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIwMzMyZjU1MjhlZmM0NGIyOTgyMjIxNThiODU1NDkyNSIsImlhdCI6MTcyMTMwNDg2NSwiZXhwIjoyMDM2NjY0ODY1fQ.Q-Y7E_i7clH3ff4Ma-OMmhZfbN7aMi_CahKwmoar"
|
||||||
|
|
||||||
|
# curl -X POST \
|
||||||
|
# ${ha_url}/api/services/script/test_notify \
|
||||||
|
# -H "Authorization: Bearer ${ha_token}" \
|
||||||
|
# -H "Content-Type: application/json"
|
||||||
Reference in New Issue
Block a user