mirror of
https://github.com/oxan/esphome-stream-server.git
synced 2026-02-14 18:29:54 +00:00
Fix null pointer dereference when no sensors are defined (fixes #37)
This commit is contained in:
@@ -41,12 +41,7 @@ void StreamServerComponent::setup() {
|
||||
this->socket_->bind(reinterpret_cast<struct sockaddr *>(&bind_addr), bind_addrlen);
|
||||
this->socket_->listen(8);
|
||||
|
||||
#ifdef USE_BINARY_SENSOR
|
||||
this->connected_sensor_->publish_state(false);
|
||||
#endif
|
||||
#ifdef USE_SENSOR
|
||||
this->connection_count_sensor_->publish_state(0);
|
||||
#endif
|
||||
this->publish_sensor();
|
||||
}
|
||||
|
||||
void StreamServerComponent::loop() {
|
||||
|
||||
Reference in New Issue
Block a user