don't show handlers if there arn't any

This commit is contained in:
proddy
2021-09-21 18:03:30 +02:00
parent 30d1e7ecb4
commit 906813b8f5

View File

@@ -981,7 +981,10 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & json
obj["type"] = emsdevice->device_type_name(); obj["type"] = emsdevice->device_type_name();
obj["name"] = emsdevice->to_string(); obj["name"] = emsdevice->to_string();
char result[200]; char result[200];
obj["handlers"] = emsdevice->show_telegram_handlers(result); (void)emsdevice->show_telegram_handlers(result);
if (result[0] != '\0') {
obj["handlers"] = result; // don't show hanlders if there aren't any
}
} }
} }
} }