From 1e30f54dffeaccb36062f46b310ad7e15d7c9053 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 8 Jan 2026 21:49:59 -1000 Subject: [PATCH] cleanup --- esphome/components/fan/fan.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/fan/fan.h b/esphome/components/fan/fan.h index 0504b1010e..df42af9f99 100644 --- a/esphome/components/fan/fan.h +++ b/esphome/components/fan/fan.h @@ -130,7 +130,9 @@ class Fan : public EntityBase { /// Set the restore mode of this fan. void set_restore_mode(FanRestoreMode restore_mode) { this->restore_mode_ = restore_mode; } - /// Get the current preset mode (returns view of string stored in traits, or empty view if not set) + /// Get the current preset mode. + /// Returns a view of the string stored in traits (static storage), or empty view if not set. + /// Safe to use as the underlying string has static lifetime. std::string_view get_preset_mode() const { return this->preset_mode_ != nullptr ? std::string_view(this->preset_mode_) : std::string_view(); }