mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 00:58:40 +00:00
[fan] Add zero-copy support for API preset mode commands
This commit is contained in:
@@ -447,7 +447,7 @@ void APIConnection::fan_command(const FanCommandRequest &msg) {
|
||||
if (msg.has_direction)
|
||||
call.set_direction(static_cast<fan::FanDirection>(msg.direction));
|
||||
if (msg.has_preset_mode)
|
||||
call.set_preset_mode(msg.preset_mode);
|
||||
call.set_preset_mode(reinterpret_cast<const char *>(msg.preset_mode), msg.preset_mode_len);
|
||||
call.perform();
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user