[ESP32] Fix compile error when bt is disabled (#30867)

* [ESP32] Fix compile error when bt is disabled

* include esp_log.h in light-switch app
diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt
index e812480..0ce9cb5 100644
--- a/config/esp32/components/chip/CMakeLists.txt
+++ b/config/esp32/components/chip/CMakeLists.txt
@@ -493,7 +493,7 @@
     list(APPEND chip_libraries "${esp_phy_dir}/lib/${target_name}/lib${phy_blob}.a")
 endforeach()
 
-set(components_to_link esp_event hal esp_system soc efuse vfs driver esp_coex freertos)
+set(components_to_link esp_event hal esp_system soc efuse vfs driver esp_coex freertos esp_timer)
 idf_build_get_property(build_components BUILD_COMPONENTS)
 foreach(component ${components_to_link})
     # Some of the components are not present in IDF v4.x
diff --git a/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp b/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp
index dd82cac..795c433 100644
--- a/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp
+++ b/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp
@@ -24,6 +24,7 @@
  **/
 
 #include "DeviceCallbacks.h"
+#include <esp_log.h>
 #include <lib/support/logging/CHIPLogging.h>
 
 static const char TAG[] = "light-switch-app-callbacks";