2021-10-12 20:38:19 +02:00
|
|
|
#include "ir_sender_esphome.h"
|
|
|
|
|
|
|
|
#ifdef USE_ARDUINO
|
|
|
|
|
|
|
|
namespace esphome {
|
|
|
|
namespace heatpumpir {
|
|
|
|
|
|
|
|
void IRSenderESPHome::setFrequency(int frequency) { // NOLINT(readability-identifier-naming)
|
2022-01-23 08:29:58 +01:00
|
|
|
auto *data = transmit_.get_data();
|
2021-10-12 20:38:19 +02:00
|
|
|
data->set_carrier_frequency(1000 * frequency);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Send an IR 'mark' symbol, i.e. transmitter ON
|
|
|
|
void IRSenderESPHome::mark(int mark_length) {
|
2022-01-23 08:29:58 +01:00
|
|
|
auto *data = transmit_.get_data();
|
2021-10-12 20:38:19 +02:00
|
|
|
data->mark(mark_length);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Send an IR 'space' symbol, i.e. transmitter OFF
|
|
|
|
void IRSenderESPHome::space(int space_length) {
|
|
|
|
if (space_length) {
|
2022-01-23 08:29:58 +01:00
|
|
|
auto *data = transmit_.get_data();
|
2021-10-12 20:38:19 +02:00
|
|
|
data->space(space_length);
|
|
|
|
} else {
|
|
|
|
transmit_.perform();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace heatpumpir
|
|
|
|
} // namespace esphome
|
|
|
|
|
|
|
|
#endif
|