From c69b2e0754325899a9dad83d1a3650ec68df1eed Mon Sep 17 00:00:00 2001 From: rwalker777 <49888088+rwalker777@users.noreply.github.com> Date: Fri, 17 Jul 2026 13:23:01 -0500 Subject: [PATCH] Add explicit protocol creator function declarations to protocol_factory.h Make protocol dependencies explicit by declaring the built-in protocol creator functions in the header. This provides better type safety and clearer dependency tracking for the factory initialization. --- components/ups_hid/protocol_factory.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/ups_hid/protocol_factory.h b/components/ups_hid/protocol_factory.h index f542af6..b7e277d 100644 --- a/components/ups_hid/protocol_factory.h +++ b/components/ups_hid/protocol_factory.h @@ -13,6 +13,12 @@ namespace ups_hid { class UpsProtocolBase; class UpsHidComponent; +// Forward declarations for built-in protocol creator functions +std::unique_ptr create_apc_protocol(UpsHidComponent* parent); +std::unique_ptr create_cyberpower_protocol(UpsHidComponent* parent); +std::unique_ptr create_goldenmate_protocol(UpsHidComponent* parent); +std::unique_ptr create_generic_protocol(UpsHidComponent* parent); + /** * Protocol Factory with Self-Registration Support * @@ -82,7 +88,7 @@ private: // Fallback protocol registry (sorted by priority) static std::vector& get_fallback_registry(); - // Ensure registries are initialized + // Ensure registries are initialized with built-in protocols static void ensure_initialized(); }; @@ -130,4 +136,4 @@ class ProtocolFactory; } } // namespace ups_hid -} // namespace esphome \ No newline at end of file +} // namespace esphome