From 81fad20ac3f43f697097a288c886fa32cca3b7b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Koek?= Date: Tue, 21 May 2024 19:42:36 +0100 Subject: [PATCH] missing ifdef --- esphome/components/ebyte_lora/ebyte_lora_component.cpp | 2 ++ esphome/components/ebyte_lora/ebyte_lora_component.h | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/esphome/components/ebyte_lora/ebyte_lora_component.cpp b/esphome/components/ebyte_lora/ebyte_lora_component.cpp index 14c2471287..dd5049faca 100644 --- a/esphome/components/ebyte_lora/ebyte_lora_component.cpp +++ b/esphome/components/ebyte_lora/ebyte_lora_component.cpp @@ -379,6 +379,7 @@ void EbyteLoraComponent::dump_config() { LOG_PIN("M0 Pin:", this->pin_m0_); LOG_PIN("M1 Pin:", this->pin_m1_); }; +#ifdef USE_SWITCH void EbyteLoraComponent::digital_write(uint8_t pin, bool value) { this->send_switch_push_(pin, value); } void EbyteLoraComponent::send_switch_push_(uint8_t pin, bool value) { if (!this->can_send_message_()) { @@ -395,6 +396,7 @@ void EbyteLoraComponent::send_switch_push_(uint8_t pin, bool value) { this->setup_wait_response_(5000); ESP_LOGD(TAG, "Successfully put in queue"); } +#endif void EbyteLoraComponent::loop() { std::string buffer; std::vector data; diff --git a/esphome/components/ebyte_lora/ebyte_lora_component.h b/esphome/components/ebyte_lora/ebyte_lora_component.h index 59dfc3a9af..690f629e13 100644 --- a/esphome/components/ebyte_lora/ebyte_lora_component.h +++ b/esphome/components/ebyte_lora/ebyte_lora_component.h @@ -30,12 +30,13 @@ class EbyteLoraComponent : public PollingComponent, public uart::UARTDevice { float get_setup_priority() const override { return setup_priority::HARDWARE; } void loop() override; void dump_config() override; - /// Helper function to write the value of a pin. - void digital_write(uint8_t pin, bool value); + void set_rssi_sensor(sensor::Sensor *rssi_sensor) { rssi_sensor_ = rssi_sensor; } void set_pin_aux(InternalGPIOPin *pin_aux) { pin_aux_ = pin_aux; } #ifdef USE_SWITCH void set_switch(EbyteLoraSwitch *obj) { this->sensors_.push_back(obj); } + /// Helper function to write the value of a pin. + void digital_write(uint8_t pin, bool value); #endif void set_pin_m0(InternalGPIOPin *pin_m0) { pin_m0_ = pin_m0; } void set_pin_m1(InternalGPIOPin *pin_m1) { pin_m1_ = pin_m1; }