diff --git a/esphome/components/usb_host/usb_host.h b/esphome/components/usb_host/usb_host.h index b326903176..dcb76a3a3b 100644 --- a/esphome/components/usb_host/usb_host.h +++ b/esphome/components/usb_host/usb_host.h @@ -177,7 +177,6 @@ class USBClient : public Component { // Lock-free pool management using atomic bitmask (no dynamic allocation) // Bit i = 1: requests_[i] is in use, Bit i = 0: requests_[i] is available // Supports multiple concurrent consumers and producers (both threads can allocate/deallocate) - // 2-byte members packed together; trq_in_use_ is uint16_t when MAX_REQUESTS <= 16 std::atomic trq_in_use_; uint16_t vid_{}; uint16_t pid_{}; diff --git a/esphome/components/usb_host/usb_host_client.cpp b/esphome/components/usb_host/usb_host_client.cpp index 71c63dce41..18d938344c 100644 --- a/esphome/components/usb_host/usb_host_client.cpp +++ b/esphome/components/usb_host/usb_host_client.cpp @@ -233,11 +233,7 @@ void USBClient::setup() { if (this->usb_task_handle_ == nullptr) { ESP_LOGE(TAG, "Failed to create USB task"); this->mark_failed(); - return; } - - // Start with loop disabled - it will be enabled by client_event_cb when events arrive - this->disable_loop(); } void USBClient::usb_task_fn(void *arg) { diff --git a/esphome/components/web_server/web_server.cpp b/esphome/components/web_server/web_server.cpp index bc4fadb30b..1dda6204fe 100644 --- a/esphome/components/web_server/web_server.cpp +++ b/esphome/components/web_server/web_server.cpp @@ -1,4 +1,3 @@ -// Trigger CI memory impact (uses updated ESPAsyncWebServer from web_server_base) #include "web_server.h" #ifdef USE_WEBSERVER #include "esphome/components/json/json_util.h" @@ -1588,32 +1587,17 @@ json::SerializationBuffer<> WebServer::climate_json_(climate::Climate *obj, Json root[ESPHOME_F("state")] = root[ESPHOME_F("action")]; has_state = true; } - if (traits.get_supports_fan_modes()) { - if (obj->fan_mode.has_value()) { - root[ESPHOME_F("fan_mode")] = PSTR_LOCAL(climate_fan_mode_to_string(obj->fan_mode.value())); - } else if (!obj->has_custom_fan_mode()) { - root[ESPHOME_F("fan_mode")] = PSTR_LOCAL(climate_fan_mode_to_string(climate::CLIMATE_FAN_AUTO)); - } else { - root[ESPHOME_F("fan_mode")] = ""; - } + if (traits.get_supports_fan_modes() && obj->fan_mode.has_value()) { + root[ESPHOME_F("fan_mode")] = PSTR_LOCAL(climate_fan_mode_to_string(obj->fan_mode.value())); } - if (!traits.get_supported_custom_fan_modes().empty()) { - if (obj->has_custom_fan_mode()) { - root[ESPHOME_F("custom_fan_mode")] = obj->get_custom_fan_mode(); - } else { - root[ESPHOME_F("custom_fan_mode")] = ""; - } + if (!traits.get_supported_custom_fan_modes().empty() && obj->has_custom_fan_mode()) { + root[ESPHOME_F("custom_fan_mode")] = obj->get_custom_fan_mode(); } - if (traits.get_supports_presets()) { - root[ESPHOME_F("preset")] = - obj->preset.has_value() ? PSTR_LOCAL(climate_preset_to_string(obj->preset.value())) : ""; + if (traits.get_supports_presets() && obj->preset.has_value()) { + root[ESPHOME_F("preset")] = PSTR_LOCAL(climate_preset_to_string(obj->preset.value())); } - if (!traits.get_supported_custom_presets().empty()) { - if (obj->has_custom_preset()) { - root[ESPHOME_F("custom_preset")] = obj->get_custom_preset(); - } else { - root[ESPHOME_F("custom_preset")] = ""; - } + if (!traits.get_supported_custom_presets().empty() && obj->has_custom_preset()) { + root[ESPHOME_F("custom_preset")] = obj->get_custom_preset(); } if (traits.get_supports_swing_modes()) { root[ESPHOME_F("swing_mode")] = PSTR_LOCAL(climate_swing_mode_to_string(obj->swing_mode));