diff --git a/ampel-firmware/src/lib/IotWebConf/src/IotWebConfParameter.cpp b/ampel-firmware/src/lib/IotWebConf/src/IotWebConfParameter.cpp index be9d99b96d069836394950d86bacb2d1f6485b4a..269c38e9376e2fcf628d8fe3e615bc56d6bca85d 100644 --- a/ampel-firmware/src/lib/IotWebConf/src/IotWebConfParameter.cpp +++ b/ampel-firmware/src/lib/IotWebConf/src/IotWebConfParameter.cpp @@ -400,7 +400,7 @@ String PasswordParameter::renderHtml( bool dataArrived, bool hasValueFromPost, String valueFromPost) { - return TextParameter::renderHtml("password", true, String("")); + return TextParameter::renderHtml("password", true, String(this->valueBuffer)); } void PasswordParameter::debugTo(Stream* out) @@ -425,7 +425,7 @@ void PasswordParameter::update(String newValue) Serial.print(this->getId()); Serial.print(": "); #endif - if (newValue.length() > 0) + if (newValue != current->valueBuffer) { // -- Value was set. newValue.toCharArray(current->valueBuffer, current->getLength()); diff --git a/ampel-firmware/src/lib/IotWebConf/src/IotWebConfTParameter.h b/ampel-firmware/src/lib/IotWebConf/src/IotWebConfTParameter.h index 65796d506373c21eec3feab3367b44e554c5d6db..ecf50c801917c9cfe91ac9983265e813d10629c3 100644 --- a/ampel-firmware/src/lib/IotWebConf/src/IotWebConfTParameter.h +++ b/ampel-firmware/src/lib/IotWebConf/src/IotWebConfTParameter.h @@ -575,7 +575,7 @@ using CharArrayDataType<len>::CharArrayDataType; Serial.print(this->getId()); Serial.print(": "); #endif - if (newValue.length() > 0) + if (newValue != this->_value) { // -- Value was set. strncpy(this->_value, newValue.c_str(), len); @@ -601,7 +601,7 @@ protected: virtual String renderHtml( bool dataArrived, bool hasValueFromPost, String valueFromPost) override { - return InputParameter::renderHtml(dataArrived, true, String("")); + return InputParameter::renderHtml(dataArrived, true, String(this->_value)); } private: const char* _customHtmlPwd = "ondblclick=\"pw(this.id)\""; diff --git a/ampel-firmware/web_config.cpp b/ampel-firmware/web_config.cpp index 1d4672d0daa2a869efef283cc9fbe3907e3173b9..d4096b9a7bd7144f226326e89588828eb2d16ade 100644 --- a/ampel-firmware/web_config.cpp +++ b/ampel-firmware/web_config.cpp @@ -15,7 +15,6 @@ #include "src/lib/IotWebConf/src/IotWebConfTParameter.h" #include "src/lib/IotWebConf/src/IotWebConfOptionalGroup.h" -//TODO: Check memory consumption. Disable DEBUG info? //TODO: Convert all strings to F-strings namespace web_config { @@ -114,7 +113,6 @@ namespace web_config { TextTParameter<STRING_LEN> mqttUserParam = Builder<TextTParameter<STRING_LEN>>("mqtt_user").label("MQTT User").defaultValue(MQTT_USER).build(); - //TODO: Show the number of * for password? PasswordTParameter<STRING_LEN> mqttPasswordParam = Builder<PasswordTParameter<STRING_LEN>>("mqtt_password").label( "MQTT password").defaultValue(MQTT_PASSWORD).build();