fix decode on idf

This commit is contained in:
J. Nick Koston
2025-12-22 16:36:23 -10:00
parent 48eaaa8be0
commit af5ea02978

View File

@@ -467,8 +467,14 @@ static void set_json_id(JsonObject &root, EntityBase *obj, const char *prefix, J
// Build id into stack buffer - ArduinoJson copies the string
// Format: {prefix}/{device?}/{name}
// Buffer size guaranteed by schema validation: domain(20) + "/" + device(120) + "/" + name(120) + null = 263
// Buffer size guaranteed by schema validation:
// With devices: domain(20) + "/" + device(120) + "/" + name(120) + null = 263
// Without devices: domain(20) + "/" + name(120) + null = 142
#ifdef USE_DEVICES
char id_buf[280];
#else
char id_buf[150];
#endif
char *p = id_buf;
memcpy(p, prefix, prefix_len);
p += prefix_len;