From 276bf39e8ecf2950da34f50144fe6b89f39c4df2 Mon Sep 17 00:00:00 2001 From: mrbigcho Date: Sat, 25 Jul 2026 08:32:00 +0900 Subject: [PATCH] fix(uartex): wire fan preset modes into FanTraits so Home Assistant sees them UARTExFan::set_preset_modes() registers modes on the entity, but get_traits() returned a fresh FanTraits with speed only and never wired the presets in, so Home Assistant never saw PRESET_MODE support (preset_modes stayed empty). Since ESPHome 2026.4, Fan::get_traits() overrides must call wire_preset_modes_() explicitly (the base class no longer auto-injects them, unlike Climate). This is a regression from #226, which removed trait-side registration without adding the required call. Add this->wire_preset_modes_(traits); it no-ops when no presets are configured, so speed-only fans are unaffected. --- components/uartex/fan/uartex_fan.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/components/uartex/fan/uartex_fan.cpp b/components/uartex/fan/uartex_fan.cpp index 49e7fa05..119df7d0 100644 --- a/components/uartex/fan/uartex_fan.cpp +++ b/components/uartex/fan/uartex_fan.cpp @@ -22,6 +22,7 @@ fan::FanTraits UARTExFan::get_traits() traits.set_speed(true); traits.set_supported_speed_count(this->speed_count_); } + this->wire_preset_modes_(traits); return traits; }