mirror of
https://github.com/esphome/esphome.git
synced 2026-09-23 21:14:03 +00:00
[core] Compile-time detection of loop() overrides (#14405)
This commit is contained in:
@@ -496,18 +496,6 @@ void Component::set_setup_priority(float priority) {
|
||||
}
|
||||
#endif
|
||||
|
||||
bool Component::has_overridden_loop() const {
|
||||
#if defined(USE_HOST) || defined(CLANG_TIDY)
|
||||
return true;
|
||||
#else
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpmf-conversions"
|
||||
bool loop_overridden = (void *) (this->*(&Component::loop)) != (void *) (&Component::loop);
|
||||
#pragma GCC diagnostic pop
|
||||
return loop_overridden;
|
||||
#endif
|
||||
}
|
||||
|
||||
PollingComponent::PollingComponent(uint32_t update_interval) : update_interval_(update_interval) {}
|
||||
|
||||
void PollingComponent::call_setup() {
|
||||
|
||||
Reference in New Issue
Block a user