Merge pull request #13028 from barbudor/fix_opentherm_json

Fix opentherm json
This commit is contained in:
Theo Arends 2021-09-02 10:47:38 +02:00 committed by GitHub
commit b4bcccba35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View File

@ -235,9 +235,7 @@ void sns_opentherm_stat(bool json)
if (json)
{
ResponseAppend_P(PSTR(",\"OPENTHERM\":{"));
ResponseAppend_P(PSTR("\"conn\":\"%s\","), statusStr);
ResponseAppend_P(PSTR("\"settings\":%d,"), Settings->ot_flags);
ResponseAppend_P(PSTR(",\"OPENTHERM\":{\"conn\":\"%s\",\"settings\":%d"), statusStr, Settings->ot_flags);
sns_opentherm_dump_telemetry();
ResponseJsonEnd();
#ifdef USE_WEBSERVER

View File

@ -549,7 +549,6 @@ void sns_opentherm_process_success_response(struct OT_BOILER_STATUS_T *boilerSta
void sns_opentherm_dump_telemetry()
{
bool add_coma = false;
for (int i = 0; i < SNS_OT_COMMANDS_COUNT; ++i)
{
struct OpenThermCommandT *cmd = &sns_opentherm_commands[i];
@ -558,11 +557,8 @@ void sns_opentherm_dump_telemetry()
continue;
}
ResponseAppend_P(PSTR("%s\"%s\":"), add_coma ? "," : "", cmd->m_command_name);
ResponseAppend_P(PSTR(",\"%s\":"), cmd->m_command_name);
cmd->m_ot_appent_telemetry(cmd);
add_coma = true;
}
}