1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-24 22:22:22 +01:00

[esp8266] Store component warning strings in flash to reduce RAM usage (#10623)

This commit is contained in:
J. Nick Koston
2025-09-06 23:56:45 -05:00
committed by GitHub
parent 4d09932320
commit c33bb3a8a9
26 changed files with 70 additions and 55 deletions

View File

@@ -28,12 +28,12 @@ void UDPComponent::setup() {
int enable = 1;
auto err = this->broadcast_socket_->setsockopt(SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int));
if (err != 0) {
this->status_set_warning("Socket unable to set reuseaddr");
this->status_set_warning(LOG_STR("Socket unable to set reuseaddr"));
// we can still continue
}
err = this->broadcast_socket_->setsockopt(SOL_SOCKET, SO_BROADCAST, &enable, sizeof(int));
if (err != 0) {
this->status_set_warning("Socket unable to set broadcast");
this->status_set_warning(LOG_STR("Socket unable to set broadcast"));
}
}
// create listening socket if we either want to subscribe to providers, or need to listen
@@ -55,7 +55,7 @@ void UDPComponent::setup() {
int enable = 1;
err = this->listen_socket_->setsockopt(SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
if (err != 0) {
this->status_set_warning("Socket unable to set reuseaddr");
this->status_set_warning(LOG_STR("Socket unable to set reuseaddr"));
// we can still continue
}
struct sockaddr_in server {};