[datetime] Inline the trivial make_call helpers

This commit is contained in:
J. Nick Koston
2026-08-22 01:22:15 -05:00
parent ef1d77885d
commit f22b022244
6 changed files with 6 additions and 6 deletions
@@ -37,8 +37,6 @@ void DateEntity::publish_state() {
#endif #endif
} }
DateCall DateEntity::make_call() { return DateCall(this); }
void DateCall::validate_() { void DateCall::validate_() {
if (this->year_.has_value() && (this->year_ < 1970 || this->year_ > 3000)) { if (this->year_.has_value() && (this->year_ < 1970 || this->year_ > 3000)) {
ESP_LOGE(TAG, "Year must be between 1970 and 3000"); ESP_LOGE(TAG, "Year must be between 1970 and 3000");
@@ -96,6 +96,8 @@ class DateCall {
optional<uint8_t> day_; optional<uint8_t> day_;
}; };
inline DateCall DateEntity::make_call() { return DateCall(this); }
template<typename... Ts> class DateSetAction final : public Action<Ts...>, public Parented<DateEntity> { template<typename... Ts> class DateSetAction final : public Action<Ts...>, public Parented<DateEntity> {
public: public:
TEMPLATABLE_VALUE(ESPTime, date) TEMPLATABLE_VALUE(ESPTime, date)
@@ -53,8 +53,6 @@ void DateTimeEntity::publish_state() {
#endif #endif
} }
DateTimeCall DateTimeEntity::make_call() { return DateTimeCall(this); }
ESPTime DateTimeEntity::state_as_esptime() const { ESPTime DateTimeEntity::state_as_esptime() const {
ESPTime obj; ESPTime obj;
obj.year = this->year_; obj.year = this->year_;
@@ -121,6 +121,8 @@ class DateTimeCall {
optional<uint8_t> second_; optional<uint8_t> second_;
}; };
inline DateTimeCall DateTimeEntity::make_call() { return DateTimeCall(this); }
template<typename... Ts> class DateTimeSetAction final : public Action<Ts...>, public Parented<DateTimeEntity> { template<typename... Ts> class DateTimeSetAction final : public Action<Ts...>, public Parented<DateTimeEntity> {
public: public:
TEMPLATABLE_VALUE(ESPTime, datetime) TEMPLATABLE_VALUE(ESPTime, datetime)
@@ -33,8 +33,6 @@ void TimeEntity::publish_state() {
#endif #endif
} }
TimeCall TimeEntity::make_call() { return TimeCall(this); }
void TimeCall::validate_() { void TimeCall::validate_() {
if (this->hour_.has_value() && this->hour_ > 23) { if (this->hour_.has_value() && this->hour_ > 23) {
ESP_LOGE(TAG, "Hour must be between 0 and 23"); ESP_LOGE(TAG, "Hour must be between 0 and 23");
@@ -98,6 +98,8 @@ class TimeCall {
optional<uint8_t> second_; optional<uint8_t> second_;
}; };
inline TimeCall TimeEntity::make_call() { return TimeCall(this); }
template<typename... Ts> class TimeSetAction final : public Action<Ts...>, public Parented<TimeEntity> { template<typename... Ts> class TimeSetAction final : public Action<Ts...>, public Parented<TimeEntity> {
public: public:
TEMPLATABLE_VALUE(ESPTime, time) TEMPLATABLE_VALUE(ESPTime, time)