[fan] Add zero-copy support for API preset mode commands

This commit is contained in:
J. Nick Koston
2025-12-10 12:40:35 +01:00
parent 6b810b340a
commit fdd560b165
8 changed files with 37 additions and 14 deletions
+1 -1
View File
@@ -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