From 88d000fb2ab7dba21d819ecf10634d08a847ca96 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 7 Jun 2023 09:45:49 -0500 Subject: [PATCH] get rid of strings --- components/ratgdo/ratgdo.cpp | 6 ++++++ components/ratgdo/ratgdo.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index ce36b2d..145f368 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -639,5 +639,11 @@ namespace ratgdo { this->pref_.save(&this->rollingCodeCounter); } + void RATGDOComponent::register_child(RATGDOComponent* obj) + { + this->children_.push_back(obj); + obj->set_parent(this); + } + } // namespace ratgdo } // namespace esphome diff --git a/components/ratgdo/ratgdo.h b/components/ratgdo/ratgdo.h index 283619a..8776dc0 100644 --- a/components/ratgdo/ratgdo.h +++ b/components/ratgdo/ratgdo.h @@ -160,9 +160,12 @@ namespace ratgdo { void statusUpdateLoop(); void readRollingCode(uint8_t& door, uint8_t& light, uint8_t& lock, uint8_t& motion, uint8_t& obstruction); void sendCommand(Commands command); + /** Register a child component. */ + void register_child(RATGDOComponent* obj); protected: ESPPreferenceObject pref_; + std::vector children_; RATGDOStore store_ {}; InternalGPIOPin* output_gdo_pin_;