mirror of
https://github.com/esphome/esphome.git
synced 2026-10-09 21:13:12 +00:00
[core] Add TemplatableFn for 4-byte function-pointer templatable storage (#15545)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
parent
9bf53e0ab8
commit
a8b7c7a4ac
@@ -36,7 +36,7 @@ class TimeoutFilter : public Filter, public Component {
|
||||
template<typename T> void set_timeout_value(T timeout) { this->timeout_delay_ = timeout; }
|
||||
|
||||
protected:
|
||||
TemplatableValue<uint32_t> timeout_delay_{};
|
||||
TemplatableFn<uint32_t> timeout_delay_{};
|
||||
};
|
||||
|
||||
class DelayedOnOffFilter final : public Filter, public Component {
|
||||
@@ -49,8 +49,8 @@ class DelayedOnOffFilter final : public Filter, public Component {
|
||||
template<typename T> void set_off_delay(T delay) { this->off_delay_ = delay; }
|
||||
|
||||
protected:
|
||||
TemplatableValue<uint32_t> on_delay_{};
|
||||
TemplatableValue<uint32_t> off_delay_{};
|
||||
TemplatableFn<uint32_t> on_delay_{};
|
||||
TemplatableFn<uint32_t> off_delay_{};
|
||||
};
|
||||
|
||||
class DelayedOnFilter : public Filter, public Component {
|
||||
@@ -62,7 +62,7 @@ class DelayedOnFilter : public Filter, public Component {
|
||||
template<typename T> void set_delay(T delay) { this->delay_ = delay; }
|
||||
|
||||
protected:
|
||||
TemplatableValue<uint32_t> delay_{};
|
||||
TemplatableFn<uint32_t> delay_{};
|
||||
};
|
||||
|
||||
class DelayedOffFilter : public Filter, public Component {
|
||||
@@ -74,7 +74,7 @@ class DelayedOffFilter : public Filter, public Component {
|
||||
template<typename T> void set_delay(T delay) { this->delay_ = delay; }
|
||||
|
||||
protected:
|
||||
TemplatableValue<uint32_t> delay_{};
|
||||
TemplatableFn<uint32_t> delay_{};
|
||||
};
|
||||
|
||||
class InvertFilter : public Filter {
|
||||
@@ -155,7 +155,7 @@ class SettleFilter : public Filter, public Component {
|
||||
template<typename T> void set_delay(T delay) { this->delay_ = delay; }
|
||||
|
||||
protected:
|
||||
TemplatableValue<uint32_t> delay_{};
|
||||
TemplatableFn<uint32_t> delay_{};
|
||||
bool steady_{true};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user