[lock] Store lock state strings in flash on ESP8266 (#12163)

This commit is contained in:
J. Nick Koston
2025-12-02 09:59:05 -06:00
committed by GitHub
parent 29be1423f5
commit deda7a1bf3
4 changed files with 26 additions and 17 deletions

View File

@@ -1334,7 +1334,7 @@ std::string WebServer::climate_json(climate::Climate *obj, JsonDetail start_conf
const auto traits = obj->get_traits();
int8_t target_accuracy = traits.get_target_temperature_accuracy_decimals();
int8_t current_accuracy = traits.get_current_temperature_accuracy_decimals();
char buf[16];
char buf[PSTR_LOCAL_SIZE];
if (start_config == DETAIL_ALL) {
JsonArray opt = root["modes"].to<JsonArray>();
@@ -1484,7 +1484,8 @@ std::string WebServer::lock_json(lock::Lock *obj, lock::LockState value, JsonDet
json::JsonBuilder builder;
JsonObject root = builder.root();
set_json_icon_state_value(root, obj, "lock", lock::lock_state_to_string(value), value, start_config);
char buf[PSTR_LOCAL_SIZE];
set_json_icon_state_value(root, obj, "lock", PSTR_LOCAL(lock::lock_state_to_string(value)), value, start_config);
if (start_config == DETAIL_ALL) {
this->add_sorting_info_(root, obj);
}
@@ -1645,7 +1646,7 @@ std::string WebServer::alarm_control_panel_json(alarm_control_panel::AlarmContro
json::JsonBuilder builder;
JsonObject root = builder.root();
char buf[16];
char buf[PSTR_LOCAL_SIZE];
set_json_icon_state_value(root, obj, "alarm-control-panel", PSTR_LOCAL(alarm_control_panel_state_to_string(value)),
value, start_config);
if (start_config == DETAIL_ALL) {