1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-11 15:52:20 +01:00

Add const char overload for Component::defer() (#9324)

This commit is contained in:
J. Nick Koston
2025-07-04 21:52:12 -05:00
committed by GitHub
parent 58b4e7dab2
commit 86e7013f40
4 changed files with 95 additions and 4 deletions

View File

@@ -248,6 +248,9 @@ bool Component::cancel_defer(const std::string &name) { // NOLINT
void Component::defer(const std::string &name, std::function<void()> &&f) { // NOLINT
App.scheduler.set_timeout(this, name, 0, std::move(f));
}
void Component::defer(const char *name, std::function<void()> &&f) { // NOLINT
App.scheduler.set_timeout(this, name, 0, std::move(f));
}
void Component::set_timeout(uint32_t timeout, std::function<void()> &&f) { // NOLINT
App.scheduler.set_timeout(this, "", timeout, std::move(f));
}