diff --git a/src/hasp_dispatch.cpp b/src/hasp_dispatch.cpp index 71e2f0d0..a92a1a4d 100644 --- a/src/hasp_dispatch.cpp +++ b/src/hasp_dispatch.cpp @@ -501,7 +501,7 @@ void dispatchParseJson(const char * payload) // json.shrinkToFit(); if(jsonError) { // Couldn't parse incoming JSON command - Log.warning(TAG_MSGR, F("JSON: Failed to parse incoming JSON command with error: %s"), jsonError.c_str()); + Log.warning(TAG_MSGR, F("Failed to parse incoming JSON command with error: %s"), jsonError.c_str()); } else { if(json.is()) { @@ -514,9 +514,17 @@ void dispatchParseJson(const char * payload) // handle json as a jsonl uint8_t savedPage = haspGetPage(); hasp_new_object(json.as(), savedPage); - } else { + } else if(json.is()) { // handle json as a single command dispatchTextLine(json.as()); + } else if(json.is()) { + // handle json as a single command + dispatchTextLine(json.as()); + } else if(json.is()) { + // handle json as a single command + dispatchTextLine(json.as().c_str()); + } else { + Log.warning(TAG_MSGR, F("Failed to parse incoming JSON command")); } } }