mirror of
https://github.com/esphome/esphome.git
synced 2026-02-18 15:35:59 -07:00
Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@home-assistant.io>
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
#pragma once
|
|
|
|
// WARNING: This component is EXPERIMENTAL. The API may change at any time
|
|
// without following the normal breaking changes policy. Use at your own risk.
|
|
// Once the API is considered stable, this warning will be removed.
|
|
|
|
#include "esphome/components/infrared/infrared.h"
|
|
#include "esphome/components/remote_transmitter/remote_transmitter.h"
|
|
#include "esphome/components/remote_receiver/remote_receiver.h"
|
|
|
|
namespace esphome::ir_rf_proxy {
|
|
|
|
/// IrRfProxy - Infrared platform implementation using remote_transmitter/receiver as backend
|
|
class IrRfProxy : public infrared::Infrared {
|
|
public:
|
|
IrRfProxy() = default;
|
|
|
|
void dump_config() override;
|
|
|
|
/// Set RF frequency in kHz (0 = infrared, non-zero = RF)
|
|
void set_frequency(uint32_t frequency_khz) { this->frequency_khz_ = frequency_khz; }
|
|
/// Get RF frequency in kHz
|
|
uint32_t get_frequency() const { return this->frequency_khz_; }
|
|
/// Check if this is RF mode (non-zero frequency)
|
|
bool is_rf() const { return this->frequency_khz_ > 0; }
|
|
|
|
protected:
|
|
// RF frequency in kHz (Hz / 1000); 0 = infrared, non-zero = RF
|
|
uint32_t frequency_khz_{0};
|
|
};
|
|
|
|
} // namespace esphome::ir_rf_proxy
|