mirror of
https://github.com/esphome/esphome.git
synced 2025-10-13 07:13:47 +01:00
Merge branch 'dev' into esp32_core
This commit is contained in:
@@ -35,7 +35,7 @@ template<typename... Ts> class UserServiceBase : public UserServiceDescriptor {
|
|||||||
msg.set_name(StringRef(this->name_));
|
msg.set_name(StringRef(this->name_));
|
||||||
msg.key = this->key_;
|
msg.key = this->key_;
|
||||||
std::array<enums::ServiceArgType, sizeof...(Ts)> arg_types = {to_service_arg_type<Ts>()...};
|
std::array<enums::ServiceArgType, sizeof...(Ts)> arg_types = {to_service_arg_type<Ts>()...};
|
||||||
for (int i = 0; i < sizeof...(Ts); i++) {
|
for (size_t i = 0; i < sizeof...(Ts); i++) {
|
||||||
msg.args.emplace_back();
|
msg.args.emplace_back();
|
||||||
auto &arg = msg.args.back();
|
auto &arg = msg.args.back();
|
||||||
arg.type = arg_types[i];
|
arg.type = arg_types[i];
|
||||||
|
@@ -77,7 +77,7 @@ bool ESPTime::strptime(const std::string &time_to_parse, ESPTime &esp_time) {
|
|||||||
&hour, // NOLINT
|
&hour, // NOLINT
|
||||||
&minute, // NOLINT
|
&minute, // NOLINT
|
||||||
&second, &num) == 6 && // NOLINT
|
&second, &num) == 6 && // NOLINT
|
||||||
num == time_to_parse.size()) {
|
num == static_cast<int>(time_to_parse.size())) {
|
||||||
esp_time.year = year;
|
esp_time.year = year;
|
||||||
esp_time.month = month;
|
esp_time.month = month;
|
||||||
esp_time.day_of_month = day;
|
esp_time.day_of_month = day;
|
||||||
@@ -87,7 +87,7 @@ bool ESPTime::strptime(const std::string &time_to_parse, ESPTime &esp_time) {
|
|||||||
} else if (sscanf(time_to_parse.c_str(), "%04hu-%02hhu-%02hhu %02hhu:%02hhu %n", &year, &month, &day, // NOLINT
|
} else if (sscanf(time_to_parse.c_str(), "%04hu-%02hhu-%02hhu %02hhu:%02hhu %n", &year, &month, &day, // NOLINT
|
||||||
&hour, // NOLINT
|
&hour, // NOLINT
|
||||||
&minute, &num) == 5 && // NOLINT
|
&minute, &num) == 5 && // NOLINT
|
||||||
num == time_to_parse.size()) {
|
num == static_cast<int>(time_to_parse.size())) {
|
||||||
esp_time.year = year;
|
esp_time.year = year;
|
||||||
esp_time.month = month;
|
esp_time.month = month;
|
||||||
esp_time.day_of_month = day;
|
esp_time.day_of_month = day;
|
||||||
@@ -95,17 +95,17 @@ bool ESPTime::strptime(const std::string &time_to_parse, ESPTime &esp_time) {
|
|||||||
esp_time.minute = minute;
|
esp_time.minute = minute;
|
||||||
esp_time.second = 0;
|
esp_time.second = 0;
|
||||||
} else if (sscanf(time_to_parse.c_str(), "%02hhu:%02hhu:%02hhu %n", &hour, &minute, &second, &num) == 3 && // NOLINT
|
} else if (sscanf(time_to_parse.c_str(), "%02hhu:%02hhu:%02hhu %n", &hour, &minute, &second, &num) == 3 && // NOLINT
|
||||||
num == time_to_parse.size()) {
|
num == static_cast<int>(time_to_parse.size())) {
|
||||||
esp_time.hour = hour;
|
esp_time.hour = hour;
|
||||||
esp_time.minute = minute;
|
esp_time.minute = minute;
|
||||||
esp_time.second = second;
|
esp_time.second = second;
|
||||||
} else if (sscanf(time_to_parse.c_str(), "%02hhu:%02hhu %n", &hour, &minute, &num) == 2 && // NOLINT
|
} else if (sscanf(time_to_parse.c_str(), "%02hhu:%02hhu %n", &hour, &minute, &num) == 2 && // NOLINT
|
||||||
num == time_to_parse.size()) {
|
num == static_cast<int>(time_to_parse.size())) {
|
||||||
esp_time.hour = hour;
|
esp_time.hour = hour;
|
||||||
esp_time.minute = minute;
|
esp_time.minute = minute;
|
||||||
esp_time.second = 0;
|
esp_time.second = 0;
|
||||||
} else if (sscanf(time_to_parse.c_str(), "%04hu-%02hhu-%02hhu %n", &year, &month, &day, &num) == 3 && // NOLINT
|
} else if (sscanf(time_to_parse.c_str(), "%04hu-%02hhu-%02hhu %n", &year, &month, &day, &num) == 3 && // NOLINT
|
||||||
num == time_to_parse.size()) {
|
num == static_cast<int>(time_to_parse.size())) {
|
||||||
esp_time.year = year;
|
esp_time.year = year;
|
||||||
esp_time.month = month;
|
esp_time.month = month;
|
||||||
esp_time.day_of_month = day;
|
esp_time.day_of_month = day;
|
||||||
|
Reference in New Issue
Block a user