mirror of
https://github.com/esphome/esphome.git
synced 2026-02-20 08:25:35 -07:00
Revert "Use PROGMEM format strings to reduce RAM usage on ESP8266"
This reverts commit da67c47a76.
This commit is contained in:
@@ -154,9 +154,8 @@ bool MQTTComponent::send_discovery_() {
|
||||
device_info[MQTT_DEVICE_MANUFACTURER] =
|
||||
model == nullptr ? ESPHOME_PROJECT_NAME : std::string(ESPHOME_PROJECT_NAME, model - ESPHOME_PROJECT_NAME);
|
||||
#else
|
||||
char sw_version[64];
|
||||
snprintf_P(sw_version, sizeof(sw_version), PSTR(ESPHOME_VERSION " (%08" PRIx32 ")"), App.get_config_hash());
|
||||
device_info[MQTT_DEVICE_SW_VERSION] = sw_version;
|
||||
device_info[MQTT_DEVICE_SW_VERSION] =
|
||||
str_sprintf(ESPHOME_VERSION " (config hash 0x%08" PRIx32 ")", App.get_config_hash());
|
||||
device_info[MQTT_DEVICE_MODEL] = ESPHOME_BOARD;
|
||||
#if defined(USE_ESP8266) || defined(USE_ESP32)
|
||||
device_info[MQTT_DEVICE_MANUFACTURER] = "Espressif";
|
||||
|
||||
@@ -10,16 +10,14 @@ namespace version {
|
||||
static const char *const TAG = "version.text_sensor";
|
||||
|
||||
void VersionTextSensor::setup() {
|
||||
char version_str[128];
|
||||
if (this->hide_timestamp_) {
|
||||
snprintf_P(version_str, sizeof(version_str), PSTR(ESPHOME_VERSION " (%08" PRIx32 ")"), App.get_config_hash());
|
||||
this->publish_state(str_sprintf(ESPHOME_VERSION " (config hash 0x%08" PRIx32 ")", App.get_config_hash()));
|
||||
} else {
|
||||
char build_time_str[esphome::Application::BUILD_TIME_STR_SIZE];
|
||||
App.get_build_time_string(build_time_str);
|
||||
snprintf_P(version_str, sizeof(version_str), PSTR(ESPHOME_VERSION " (%08" PRIx32 ", built: %s)"),
|
||||
App.get_config_hash(), build_time_str);
|
||||
this->publish_state(str_sprintf(ESPHOME_VERSION " (config hash 0x%08" PRIx32 ", built: %s)", App.get_config_hash(),
|
||||
build_time_str));
|
||||
}
|
||||
this->publish_state(version_str);
|
||||
}
|
||||
float VersionTextSensor::get_setup_priority() const { return setup_priority::DATA; }
|
||||
void VersionTextSensor::set_hide_timestamp(bool hide_timestamp) { this->hide_timestamp_ = hide_timestamp; }
|
||||
|
||||
Reference in New Issue
Block a user