ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
radio_frequency.cpp
Go to the documentation of this file.
1#include "radio_frequency.h"
2
3#include <cinttypes>
4
5#include "esphome/core/log.h"
6
8
9ESPHOME_LOG_TAG(TAG, "radio_frequency");
10
12 ESP_LOGCONFIG(TAG,
13 "Radio Frequency '%s'\n"
14 " Supports Transmitter: %s\n"
15 " Supports Receiver: %s",
16 this->get_name().c_str(), YESNO(this->get_supports_transmitter()),
17 YESNO(this->get_supports_receiver()));
18 if (this->traits_.get_frequency_min_hz() > 0) {
19 if (this->traits_.get_frequency_min_hz() == this->traits_.get_frequency_max_hz()) {
20 ESP_LOGCONFIG(TAG, " Frequency: %" PRIu32 " Hz (fixed)", this->traits_.get_frequency_min_hz());
21 } else {
22 ESP_LOGCONFIG(TAG, " Frequency Range: %" PRIu32 " - %" PRIu32 " Hz", this->traits_.get_frequency_min_hz(),
23 this->traits_.get_frequency_max_hz());
24 }
25 }
26}
27
29 this->receive_callback_.call(data);
30 return IrRfEntity::on_receive(data);
31}
32
33} // namespace esphome::radio_frequency
const StringRef & get_name() const
Definition entity_base.h:71
bool get_supports_transmitter() const
What the entity can do; platforms with their own hardware set these from their own setup(),...
Definition ir_rf_base.h:93
LazyCallbackManager< void(remote_base::RemoteReceiveData)> receive_callback_
bool on_receive(remote_base::RemoteReceiveData data) override
Called when RF data is received (from RemoteReceiverListener)
uint32_t get_frequency_min_hz() const
Hardware-supported tunable frequency range in Hz.
ESPHOME_LOG_TAG(TAG, "radio_frequency")