diff --git a/components/ratgdo/dry_contact.cpp b/components/ratgdo/dry_contact.cpp index 282d7b0..c88263d 100644 --- a/components/ratgdo/dry_contact.cpp +++ b/components/ratgdo/dry_contact.cpp @@ -1,12 +1,9 @@ -#include "ratgdo.h" - -#ifdef PROTOCOL_DRYCONTACT - #include "dry_contact.h" #include "esphome/core/gpio.h" #include "esphome/core/log.h" #include "esphome/core/scheduler.h" +#include "ratgdo.h" namespace esphome { namespace ratgdo { @@ -132,5 +129,3 @@ namespace ratgdo { } // namespace dry_contact } // namespace ratgdo } // namespace esphome - -#endif diff --git a/components/ratgdo/dry_contact.h b/components/ratgdo/dry_contact.h index 60fa729..deba39e 100644 --- a/components/ratgdo/dry_contact.h +++ b/components/ratgdo/dry_contact.h @@ -2,8 +2,6 @@ #include "esphome/core/defines.h" -#ifdef PROTOCOL_DRYCONTACT - #include "SoftwareSerial.h" // Using espsoftwareserial https://github.com/plerup/espsoftwareserial #include "esphome/core/gpio.h" #include "esphome/core/optional.h" @@ -78,5 +76,3 @@ namespace ratgdo { } // namespace dry_contact } // namespace ratgdo } // namespace esphome - -#endif diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index 16c8e2a..90cb713 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -680,7 +680,6 @@ namespace ratgdo { this->learn_state.subscribe([=](LearnState state) { defer("learn_state", [=] { f(state); }); }); } -#ifdef PROTOCOL_DRYCONTACT // dry contact methods 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); }); } -#endif } // namespace ratgdo } // namespace esphome diff --git a/components/ratgdo/ratgdo.h b/components/ratgdo/ratgdo.h index c26ee43..228d5bc 100644 --- a/components/ratgdo/ratgdo.h +++ b/components/ratgdo/ratgdo.h @@ -13,13 +13,11 @@ #pragma once +#include "esphome/components/binary_sensor/binary_sensor.h" #include "esphome/core/component.h" #include "esphome/core/defines.h" #include "esphome/core/hal.h" #include "esphome/core/preferences.h" -#ifdef PROTOCOL_DRYCONTACT -#include "esphome/components/binary_sensor/binary_sensor.h" -#endif #include "callbacks.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_obst_pin(InternalGPIOPin* pin) { this->input_obst_pin_ = pin; } -#ifdef PROTOCOL_DRYCONTACT // dry contact methods 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_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); } -#endif Result call_protocol(Args args); @@ -186,10 +182,8 @@ namespace ratgdo { InternalGPIOPin* output_gdo_pin_; InternalGPIOPin* input_gdo_pin_; InternalGPIOPin* input_obst_pin_; -#ifdef PROTOCOL_DRYCONTACT esphome::binary_sensor::BinarySensor* dry_contact_open_sensor_; esphome::binary_sensor::BinarySensor* dry_contact_close_sensor_; -#endif }; // RATGDOComponent } // namespace ratgdo