Skip to content

Commit 9fc5cc4

Browse files
authored
Revert ifdefs added in #265 (#300)
1 parent 38d2508 commit 9fc5cc4

File tree

4 files changed

+2
-19
lines changed

4 files changed

+2
-19
lines changed

components/ratgdo/dry_contact.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11

2-
#include "ratgdo.h"
3-
4-
#ifdef PROTOCOL_DRYCONTACT
5-
62
#include "dry_contact.h"
73
#include "esphome/core/gpio.h"
84
#include "esphome/core/log.h"
95
#include "esphome/core/scheduler.h"
6+
#include "ratgdo.h"
107

118
namespace esphome {
129
namespace ratgdo {
@@ -132,5 +129,3 @@ namespace ratgdo {
132129
} // namespace dry_contact
133130
} // namespace ratgdo
134131
} // namespace esphome
135-
136-
#endif

components/ratgdo/dry_contact.h

-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
#include "esphome/core/defines.h"
44

5-
#ifdef PROTOCOL_DRYCONTACT
6-
75
#include "SoftwareSerial.h" // Using espsoftwareserial https://github.com/plerup/espsoftwareserial
86
#include "esphome/core/gpio.h"
97
#include "esphome/core/optional.h"
@@ -78,5 +76,3 @@ namespace ratgdo {
7876
} // namespace dry_contact
7977
} // namespace ratgdo
8078
} // namespace esphome
81-
82-
#endif

components/ratgdo/ratgdo.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,6 @@ namespace ratgdo {
680680
this->learn_state.subscribe([=](LearnState state) { defer("learn_state", [=] { f(state); }); });
681681
}
682682

683-
#ifdef PROTOCOL_DRYCONTACT
684683
// dry contact methods
685684
void RATGDOComponent::set_dry_contact_open_sensor(esphome::binary_sensor::BinarySensor* dry_contact_open_sensor)
686685
{
@@ -697,7 +696,6 @@ namespace ratgdo {
697696
this->protocol_->set_close_limit(sensor_value);
698697
});
699698
}
700-
#endif
701699

702700
} // namespace ratgdo
703701
} // namespace esphome

components/ratgdo/ratgdo.h

+1-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313

1414
#pragma once
1515

16+
#include "esphome/components/binary_sensor/binary_sensor.h"
1617
#include "esphome/core/component.h"
1718
#include "esphome/core/defines.h"
1819
#include "esphome/core/hal.h"
1920
#include "esphome/core/preferences.h"
20-
#ifdef PROTOCOL_DRYCONTACT
21-
#include "esphome/components/binary_sensor/binary_sensor.h"
22-
#endif
2321

2422
#include "callbacks.h"
2523
#include "macros.h"
@@ -95,13 +93,11 @@ namespace ratgdo {
9593
void set_input_gdo_pin(InternalGPIOPin* pin) { this->input_gdo_pin_ = pin; }
9694
void set_input_obst_pin(InternalGPIOPin* pin) { this->input_obst_pin_ = pin; }
9795

98-
#ifdef PROTOCOL_DRYCONTACT
9996
// dry contact methods
10097
void set_dry_contact_open_sensor(esphome::binary_sensor::BinarySensor* dry_contact_open_sensor_);
10198
void set_dry_contact_close_sensor(esphome::binary_sensor::BinarySensor* dry_contact_close_sensor_);
10299
void set_discrete_open_pin(InternalGPIOPin* pin) { this->protocol_->set_discrete_open_pin(pin); }
103100
void set_discrete_close_pin(InternalGPIOPin* pin) { this->protocol_->set_discrete_close_pin(pin); }
104-
#endif
105101

106102
Result call_protocol(Args args);
107103

@@ -186,10 +182,8 @@ namespace ratgdo {
186182
InternalGPIOPin* output_gdo_pin_;
187183
InternalGPIOPin* input_gdo_pin_;
188184
InternalGPIOPin* input_obst_pin_;
189-
#ifdef PROTOCOL_DRYCONTACT
190185
esphome::binary_sensor::BinarySensor* dry_contact_open_sensor_;
191186
esphome::binary_sensor::BinarySensor* dry_contact_close_sensor_;
192-
#endif
193187
}; // RATGDOComponent
194188

195189
} // namespace ratgdo

0 commit comments

Comments
 (0)