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(); }