1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-03 02:22:25 +01:00

Merge branch 'user_services' into integration

This commit is contained in:
J. Nick Koston
2025-10-01 15:57:51 +02:00

View File

@@ -25,8 +25,8 @@ template<typename T> enums::ServiceArgType to_service_arg_type();
template<typename... Ts> class UserServiceBase : public UserServiceDescriptor { template<typename... Ts> class UserServiceBase : public UserServiceDescriptor {
public: public:
UserServiceBase(std::string name, const std::array<std::string, sizeof...(Ts)> &arg_names) UserServiceBase(const std::string &name, const std::array<std::string, sizeof...(Ts)> &arg_names)
: name_(std::move(name)), arg_names_(arg_names) { : name_(name), arg_names_(arg_names) {
this->key_ = fnv1_hash(this->name_); this->key_ = fnv1_hash(this->name_);
} }
@@ -55,7 +55,7 @@ template<typename... Ts> class UserServiceBase : public UserServiceDescriptor {
protected: protected:
virtual void execute(Ts... x) = 0; virtual void execute(Ts... x) = 0;
template<int... S> void execute_(std::vector<ExecuteServiceArgument> args, seq<S...> type) { template<int... S> void execute_(const std::vector<ExecuteServiceArgument> &args, seq<S...> type) {
this->execute((get_execute_arg_value<Ts>(args[S]))...); this->execute((get_execute_arg_value<Ts>(args[S]))...);
} }