diff --git a/interface/src/framework/system/SystemStatus.tsx b/interface/src/framework/system/SystemStatus.tsx index 5a6d65383..3a60cc832 100644 --- a/interface/src/framework/system/SystemStatus.tsx +++ b/interface/src/framework/system/SystemStatus.tsx @@ -314,16 +314,6 @@ const SystemStatus: FC = () => { return ( <> - - - - - - - - - - @@ -347,7 +337,6 @@ const SystemStatus: FC = () => { - @@ -375,8 +364,8 @@ const SystemStatus: FC = () => { )} - + { text={data.emsesp_version} to="/settings/upload" /> - + + + + { text={formatNumber(data.free_heap) + ' KB' + ' ' + LL.FREE_MEMORY()} to="/system/espsystemstatus" /> - + { text={networkStatus()} to="/settings/network/status" /> - + { text={data.mqtt_status ? LL.ACTIVE() : LL.INACTIVE(0)} to="/settings/mqtt/status" /> - + { text={ntpStatus()} to="/settings/ntp/status" /> - + read([&](NetworkSettings & settings) { if (WiFi.status() == WL_CONNECTED && !settings.bssid.isEmpty()) { - node["BSSID"] = "set"; // TODO why is this not the actual value?? + node["BSSID"] = "set"; // we don't disclose the name } node["TxPower setting"] = settings.tx_power; node["static ip config"] = settings.staticIPConfig; @@ -1591,6 +1592,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject output obj["name"] = emsdevice->name(); // custom name obj["device id"] = Helpers::hextoa(emsdevice->device_id()); obj["product id"] = emsdevice->product_id(); + obj["brand"] = emsdevice->brand_to_char(); obj["version"] = emsdevice->version(); obj["entities"] = emsdevice->count_entities(); char result[500]; diff --git a/test/api_test.http b/test/api_test.http index 8af1807e8..71012060a 100755 --- a/test/api_test.http +++ b/test/api_test.http @@ -146,3 +146,23 @@ Content-Type: application/json < ./standalone_file_export/emsesp_settings.json ------WebKitFormBoundary7MA4YWxkTrZu0gW-- +# test calling Home Assistant script +# https://developers.home-assistant.io/docs/api/rest/#post-apiservicesdomainservice +POST {{host_standalone}}/api + +# HA + +@ha = http://192.168.1.42:8123 +@ha_token = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIwMzMyZjU1MjhlZmM0NGIyOTgyMjIxNThiODU1NDkyNSIsImlhdCI6MTcyMTMwNDg2NSwiZXhwIjoyMDM2NjY0ODY1fQ.Q-Y7E_i7clH3ff4Ma-OMmhZfbN7aMi_CahKwmoar + +### + +GET {{ha}}/api/services +Content-Type: application/json +Authorization: Bearer {{ha_token}} + +### + +POST {{ha}}/api/services/script/test_notify +Content-Type: application/json +Authorization: Bearer {{ha_token}} diff --git a/test/api_test.sh b/test/api_test.sh new file mode 100755 index 000000000..c6e464831 --- /dev/null +++ b/test/api_test.sh @@ -0,0 +1,16 @@ +#!/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" \