diff --git a/esphome/components/custom_component/custom_component.h b/esphome/components/custom_component/custom_component.h index 6b009ba549..3f5760e4cf 100644 --- a/esphome/components/custom_component/custom_component.h +++ b/esphome/components/custom_component/custom_component.h @@ -16,7 +16,7 @@ class CustomComponentConstructor { } } - Component *get_component(int i) { return this->components_[i]; } + Component *get_component(int i) const { return this->components_[i]; } protected: std::vector components_;