feat(ui): add weather and lucky color commands
This commit is contained in:
@@ -147,6 +147,8 @@ bool control_plane_extract_model_command(const char *text,
|
||||
cJSON *direction = cJSON_GetObjectItemCaseSensitive(cmd_json, "转向");
|
||||
cJSON *calibrate = cJSON_GetObjectItemCaseSensitive(cmd_json, "校准");
|
||||
cJSON *chouqian = cJSON_GetObjectItemCaseSensitive(cmd_json, "抽签");
|
||||
cJSON *weather = cJSON_GetObjectItemCaseSensitive(cmd_json, "天气");
|
||||
cJSON *lucky_color = cJSON_GetObjectItemCaseSensitive(cmd_json, "喜色");
|
||||
|
||||
if (cJSON_IsString(direction) && direction->valuestring != NULL) {
|
||||
if (is_supported_model_direction(direction->valuestring)) {
|
||||
@@ -173,6 +175,16 @@ bool control_plane_extract_model_command(const char *text,
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
} else if (cJSON_IsString(weather) && weather->valuestring != NULL &&
|
||||
weather->valuestring[0] != '\0') {
|
||||
*out_command_type = CONTROL_PLANE_MODEL_COMMAND_WEATHER;
|
||||
strlcpy(out_value, weather->valuestring, out_value_capacity);
|
||||
found = true;
|
||||
} else if (cJSON_IsString(lucky_color) && lucky_color->valuestring != NULL &&
|
||||
lucky_color->valuestring[0] != '\0') {
|
||||
*out_command_type = CONTROL_PLANE_MODEL_COMMAND_LUCKY_COLOR;
|
||||
strlcpy(out_value, lucky_color->valuestring, out_value_capacity);
|
||||
found = true;
|
||||
}
|
||||
|
||||
cJSON_Delete(cmd_json);
|
||||
|
||||
Reference in New Issue
Block a user