Revert ifdefs added in #265 (#300)

This commit is contained in:
J. Nick Koston 2024-07-03 08:41:59 -07:00 committed by GitHub
parent 38d2508edc
commit 9fc5cc4510
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 2 additions and 19 deletions

View File

@ -1,12 +1,9 @@
#include "ratgdo.h"
#ifdef PROTOCOL_DRYCONTACT
#include "dry_contact.h" #include "dry_contact.h"
#include "esphome/core/gpio.h" #include "esphome/core/gpio.h"
#include "esphome/core/log.h" #include "esphome/core/log.h"
#include "esphome/core/scheduler.h" #include "esphome/core/scheduler.h"
#include "ratgdo.h"
namespace esphome { namespace esphome {
namespace ratgdo { namespace ratgdo {
@ -132,5 +129,3 @@ namespace ratgdo {
} // namespace dry_contact } // namespace dry_contact
} // namespace ratgdo } // namespace ratgdo
} // namespace esphome } // namespace esphome
#endif

View File

@ -2,8 +2,6 @@
#include "esphome/core/defines.h" #include "esphome/core/defines.h"
#ifdef PROTOCOL_DRYCONTACT
#include "SoftwareSerial.h" // Using espsoftwareserial https://github.com/plerup/espsoftwareserial #include "SoftwareSerial.h" // Using espsoftwareserial https://github.com/plerup/espsoftwareserial
#include "esphome/core/gpio.h" #include "esphome/core/gpio.h"
#include "esphome/core/optional.h" #include "esphome/core/optional.h"
@ -78,5 +76,3 @@ namespace ratgdo {
} // namespace dry_contact } // namespace dry_contact
} // namespace ratgdo } // namespace ratgdo
} // namespace esphome } // namespace esphome
#endif

View File

@ -680,7 +680,6 @@ namespace ratgdo {
this->learn_state.subscribe([=](LearnState state) { defer("learn_state", [=] { f(state); }); }); this->learn_state.subscribe([=](LearnState state) { defer("learn_state", [=] { f(state); }); });
} }
#ifdef PROTOCOL_DRYCONTACT
// dry contact methods // dry contact methods
void RATGDOComponent::set_dry_contact_open_sensor(esphome::binary_sensor::BinarySensor* dry_contact_open_sensor) void RATGDOComponent::set_dry_contact_open_sensor(esphome::binary_sensor::BinarySensor* dry_contact_open_sensor)
{ {
@ -697,7 +696,6 @@ namespace ratgdo {
this->protocol_->set_close_limit(sensor_value); this->protocol_->set_close_limit(sensor_value);
}); });
} }
#endif
} // namespace ratgdo } // namespace ratgdo
} // namespace esphome } // namespace esphome

View File

@ -13,13 +13,11 @@
#pragma once #pragma once
#include "esphome/components/binary_sensor/binary_sensor.h"
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/defines.h" #include "esphome/core/defines.h"
#include "esphome/core/hal.h" #include "esphome/core/hal.h"
#include "esphome/core/preferences.h" #include "esphome/core/preferences.h"
#ifdef PROTOCOL_DRYCONTACT
#include "esphome/components/binary_sensor/binary_sensor.h"
#endif
#include "callbacks.h" #include "callbacks.h"
#include "macros.h" #include "macros.h"
@ -95,13 +93,11 @@ namespace ratgdo {
void set_input_gdo_pin(InternalGPIOPin* pin) { this->input_gdo_pin_ = pin; } void set_input_gdo_pin(InternalGPIOPin* pin) { this->input_gdo_pin_ = pin; }
void set_input_obst_pin(InternalGPIOPin* pin) { this->input_obst_pin_ = pin; } void set_input_obst_pin(InternalGPIOPin* pin) { this->input_obst_pin_ = pin; }
#ifdef PROTOCOL_DRYCONTACT
// dry contact methods // dry contact methods
void set_dry_contact_open_sensor(esphome::binary_sensor::BinarySensor* dry_contact_open_sensor_); void set_dry_contact_open_sensor(esphome::binary_sensor::BinarySensor* dry_contact_open_sensor_);
void set_dry_contact_close_sensor(esphome::binary_sensor::BinarySensor* dry_contact_close_sensor_); void set_dry_contact_close_sensor(esphome::binary_sensor::BinarySensor* dry_contact_close_sensor_);
void set_discrete_open_pin(InternalGPIOPin* pin) { this->protocol_->set_discrete_open_pin(pin); } void set_discrete_open_pin(InternalGPIOPin* pin) { this->protocol_->set_discrete_open_pin(pin); }
void set_discrete_close_pin(InternalGPIOPin* pin) { this->protocol_->set_discrete_close_pin(pin); } void set_discrete_close_pin(InternalGPIOPin* pin) { this->protocol_->set_discrete_close_pin(pin); }
#endif
Result call_protocol(Args args); Result call_protocol(Args args);
@ -186,10 +182,8 @@ namespace ratgdo {
InternalGPIOPin* output_gdo_pin_; InternalGPIOPin* output_gdo_pin_;
InternalGPIOPin* input_gdo_pin_; InternalGPIOPin* input_gdo_pin_;
InternalGPIOPin* input_obst_pin_; InternalGPIOPin* input_obst_pin_;
#ifdef PROTOCOL_DRYCONTACT
esphome::binary_sensor::BinarySensor* dry_contact_open_sensor_; esphome::binary_sensor::BinarySensor* dry_contact_open_sensor_;
esphome::binary_sensor::BinarySensor* dry_contact_close_sensor_; esphome::binary_sensor::BinarySensor* dry_contact_close_sensor_;
#endif
}; // RATGDOComponent }; // RATGDOComponent
} // namespace ratgdo } // namespace ratgdo