From bd3e360e9f533446581c344fd82fae4d65a95add Mon Sep 17 00:00:00 2001 From: Florian Hess Date: Wed, 5 Feb 2025 00:05:40 +0100 Subject: [PATCH] Test --- components/tc_bus/tc_bus.cpp | 4 ++++ components/tc_bus/tc_bus.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/components/tc_bus/tc_bus.cpp b/components/tc_bus/tc_bus.cpp index ff25226..b54e246 100644 --- a/components/tc_bus/tc_bus.cpp +++ b/components/tc_bus/tc_bus.cpp @@ -133,6 +133,10 @@ namespace esphome listener->turn_off(&listener->timer_); } #endif + + #ifdef USE_API + register_service(&TCBusComponent::save_settings, "save_settings"); + #endif } void TCBusComponent::save_settings() diff --git a/components/tc_bus/tc_bus.h b/components/tc_bus/tc_bus.h index 4f56733..92ab5bc 100644 --- a/components/tc_bus/tc_bus.h +++ b/components/tc_bus/tc_bus.h @@ -79,7 +79,11 @@ namespace esphome uint32_t serial_number; }; + #ifdef USE_API + class TCBusComponent : public Component, public remote_base::RemoteReceiverListener, public esphome::api::CustomAPIDevice + #else class TCBusComponent : public Component, public remote_base::RemoteReceiverListener + #endif { #ifdef USE_TEXT_SENSOR SUB_TEXT_SENSOR(bus_command)