missing ifdef

This commit is contained in:
Daniël Koek 2024-05-21 19:42:36 +01:00
parent c3d1d777d6
commit 81fad20ac3
2 changed files with 5 additions and 2 deletions

View file

@ -379,6 +379,7 @@ void EbyteLoraComponent::dump_config() {
LOG_PIN("M0 Pin:", this->pin_m0_); LOG_PIN("M0 Pin:", this->pin_m0_);
LOG_PIN("M1 Pin:", this->pin_m1_); 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::digital_write(uint8_t pin, bool value) { this->send_switch_push_(pin, value); }
void EbyteLoraComponent::send_switch_push_(uint8_t pin, bool value) { void EbyteLoraComponent::send_switch_push_(uint8_t pin, bool value) {
if (!this->can_send_message_()) { if (!this->can_send_message_()) {
@ -395,6 +396,7 @@ void EbyteLoraComponent::send_switch_push_(uint8_t pin, bool value) {
this->setup_wait_response_(5000); this->setup_wait_response_(5000);
ESP_LOGD(TAG, "Successfully put in queue"); ESP_LOGD(TAG, "Successfully put in queue");
} }
#endif
void EbyteLoraComponent::loop() { void EbyteLoraComponent::loop() {
std::string buffer; std::string buffer;
std::vector<uint8_t> data; std::vector<uint8_t> data;

View file

@ -30,12 +30,13 @@ class EbyteLoraComponent : public PollingComponent, public uart::UARTDevice {
float get_setup_priority() const override { return setup_priority::HARDWARE; } float get_setup_priority() const override { return setup_priority::HARDWARE; }
void loop() override; void loop() override;
void dump_config() 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_rssi_sensor(sensor::Sensor *rssi_sensor) { rssi_sensor_ = rssi_sensor; }
void set_pin_aux(InternalGPIOPin *pin_aux) { pin_aux_ = pin_aux; } void set_pin_aux(InternalGPIOPin *pin_aux) { pin_aux_ = pin_aux; }
#ifdef USE_SWITCH #ifdef USE_SWITCH
void set_switch(EbyteLoraSwitch *obj) { this->sensors_.push_back(obj); } 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 #endif
void set_pin_m0(InternalGPIOPin *pin_m0) { pin_m0_ = pin_m0; } void set_pin_m0(InternalGPIOPin *pin_m0) { pin_m0_ = pin_m0; }
void set_pin_m1(InternalGPIOPin *pin_m1) { pin_m1_ = pin_m1; } void set_pin_m1(InternalGPIOPin *pin_m1) { pin_m1_ = pin_m1; }