mirror of
https://github.com/esphome/esphome.git
synced 2025-09-07 05:42:20 +01:00
Store strings only used for logging in flash (#2274)
Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
@@ -47,28 +47,28 @@ void GPIOSwitch::setup() {
|
||||
void GPIOSwitch::dump_config() {
|
||||
LOG_SWITCH("", "GPIO Switch", this);
|
||||
LOG_PIN(" Pin: ", this->pin_);
|
||||
const char *restore_mode = "";
|
||||
const LogString *restore_mode = LOG_STR("");
|
||||
switch (this->restore_mode_) {
|
||||
case GPIO_SWITCH_RESTORE_DEFAULT_OFF:
|
||||
restore_mode = "Restore (Defaults to OFF)";
|
||||
restore_mode = LOG_STR("Restore (Defaults to OFF)");
|
||||
break;
|
||||
case GPIO_SWITCH_RESTORE_DEFAULT_ON:
|
||||
restore_mode = "Restore (Defaults to ON)";
|
||||
restore_mode = LOG_STR("Restore (Defaults to ON)");
|
||||
break;
|
||||
case GPIO_SWITCH_RESTORE_INVERTED_DEFAULT_ON:
|
||||
restore_mode = "Restore inverted (Defaults to ON)";
|
||||
restore_mode = LOG_STR("Restore inverted (Defaults to ON)");
|
||||
break;
|
||||
case GPIO_SWITCH_RESTORE_INVERTED_DEFAULT_OFF:
|
||||
restore_mode = "Restore inverted (Defaults to OFF)";
|
||||
restore_mode = LOG_STR("Restore inverted (Defaults to OFF)");
|
||||
break;
|
||||
case GPIO_SWITCH_ALWAYS_OFF:
|
||||
restore_mode = "Always OFF";
|
||||
restore_mode = LOG_STR("Always OFF");
|
||||
break;
|
||||
case GPIO_SWITCH_ALWAYS_ON:
|
||||
restore_mode = "Always ON";
|
||||
restore_mode = LOG_STR("Always ON");
|
||||
break;
|
||||
}
|
||||
ESP_LOGCONFIG(TAG, " Restore Mode: %s", restore_mode);
|
||||
ESP_LOGCONFIG(TAG, " Restore Mode: %s", LOG_STR_ARG(restore_mode));
|
||||
if (!this->interlock_.empty()) {
|
||||
ESP_LOGCONFIG(TAG, " Interlocks:");
|
||||
for (auto *lock : this->interlock_) {
|
||||
|
Reference in New Issue
Block a user