From 4ca9aefc43c189583d0f99d2023a7ea9e11fc36b Mon Sep 17 00:00:00 2001 From: Pavlo Dudnytskyi Date: Sun, 5 Nov 2023 21:28:50 +0100 Subject: [PATCH] Fixed int variables for user defined service in case of ESP32-C3 (#5675) --- esphome/components/api/user_services.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/esphome/components/api/user_services.cpp b/esphome/components/api/user_services.cpp index 49618f5467..7e73722a92 100644 --- a/esphome/components/api/user_services.cpp +++ b/esphome/components/api/user_services.cpp @@ -5,7 +5,7 @@ namespace esphome { namespace api { template<> bool get_execute_arg_value(const ExecuteServiceArgument &arg) { return arg.bool_; } -template<> int get_execute_arg_value(const ExecuteServiceArgument &arg) { +template<> int32_t get_execute_arg_value(const ExecuteServiceArgument &arg) { if (arg.legacy_int != 0) return arg.legacy_int; return arg.int_; @@ -26,11 +26,13 @@ template<> std::vector get_execute_arg_value enums::ServiceArgType to_service_arg_type() { return enums::SERVICE_ARG_TYPE_BOOL; } -template<> enums::ServiceArgType to_service_arg_type() { return enums::SERVICE_ARG_TYPE_INT; } +template<> enums::ServiceArgType to_service_arg_type() { return enums::SERVICE_ARG_TYPE_INT; } template<> enums::ServiceArgType to_service_arg_type() { return enums::SERVICE_ARG_TYPE_FLOAT; } template<> enums::ServiceArgType to_service_arg_type() { return enums::SERVICE_ARG_TYPE_STRING; } template<> enums::ServiceArgType to_service_arg_type>() { return enums::SERVICE_ARG_TYPE_BOOL_ARRAY; } -template<> enums::ServiceArgType to_service_arg_type>() { return enums::SERVICE_ARG_TYPE_INT_ARRAY; } +template<> enums::ServiceArgType to_service_arg_type>() { + return enums::SERVICE_ARG_TYPE_INT_ARRAY; +} template<> enums::ServiceArgType to_service_arg_type>() { return enums::SERVICE_ARG_TYPE_FLOAT_ARRAY; }