Files
esphome/components/cc1101/switch/switch.h
T
2025-05-18 13:01:10 +02:00

23 lines
681 B
C++

#pragma once
#include "esphome/components/switch/switch.h"
#include "../cc1101.h"
namespace esphome {
namespace cc1101 {
template<void (CC1101Component::*F)(bool)> class Switch : public switch_::Switch, public Parented<CC1101Component> {
protected:
void write_state(bool value) override {
this->publish_state(value);
(this->parent_->*F)(value);
}
};
using DcBlockingFilterSwitch = Switch<&CC1101Component::set_dc_blocking_filter>;
using CarrierSenseAboveThresholdSwitch = Switch<&CC1101Component::set_tuner_carrier_sense_above_threshold>;
using AgcLnaPrioritySwitch = Switch<&CC1101Component::set_agc_lna_priority>;
} // namespace cc1101
} // namespace esphome