forked from xiaozhi/xiaozhi-esp32
v1.6.6: Set MCP as default IoT Protocol (#690)
This commit is contained in:
@@ -203,6 +203,9 @@ std::string WifiBoard::GetDeviceStatusJson() {
|
||||
* "type": "wifi",
|
||||
* "ssid": "Xiaozhi",
|
||||
* "rssi": -60
|
||||
* },
|
||||
* "chip": {
|
||||
* "temperature": 25
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
@@ -255,6 +258,14 @@ std::string WifiBoard::GetDeviceStatusJson() {
|
||||
}
|
||||
cJSON_AddItemToObject(root, "network", network);
|
||||
|
||||
// Chip
|
||||
float esp32temp = 0.0f;
|
||||
if (board.GetTemperature(esp32temp)) {
|
||||
auto chip = cJSON_CreateObject();
|
||||
cJSON_AddNumberToObject(chip, "temperature", esp32temp);
|
||||
cJSON_AddItemToObject(root, "chip", chip);
|
||||
}
|
||||
|
||||
auto json_str = cJSON_PrintUnformatted(root);
|
||||
std::string json(json_str);
|
||||
cJSON_free(json_str);
|
||||
|
||||
Reference in New Issue
Block a user