mirror of
https://github.com/esphome/esphome.git
synced 2025-09-13 00:32:20 +01:00
lint
This commit is contained in:
@@ -24,8 +24,7 @@ template<typename... Ts> class JVCAction : public RemoteTransmitterActionBase<Ts
|
||||
public:
|
||||
TEMPLATABLE_VALUE(uint32_t, data)
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
JVCData data{};
|
||||
data.data = this->data_.value(x...);
|
||||
JVCProtocol().encode(dst, data);
|
||||
|
@@ -27,8 +27,7 @@ template<typename... Ts> class LGAction : public RemoteTransmitterActionBase<Ts.
|
||||
TEMPLATABLE_VALUE(uint32_t, data)
|
||||
TEMPLATABLE_VALUE(uint8_t, nbits)
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
LGData data{};
|
||||
data.data = this->data_.value(x...);
|
||||
data.nbits = this->nbits_.value(x...);
|
||||
|
@@ -26,8 +26,7 @@ template<typename... Ts> class NECAction : public RemoteTransmitterActionBase<Ts
|
||||
TEMPLATABLE_VALUE(uint16_t, address)
|
||||
TEMPLATABLE_VALUE(uint16_t, command)
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
NECData data{};
|
||||
data.address = this->address_.value(x...);
|
||||
data.command = this->command_.value(x...);
|
||||
|
@@ -27,8 +27,7 @@ template<typename... Ts> class PanasonicAction : public RemoteTransmitterActionB
|
||||
TEMPLATABLE_VALUE(uint16_t, address)
|
||||
TEMPLATABLE_VALUE(uint32_t, command)
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
PanasonicData data{};
|
||||
data.address = this->address_.value(x...);
|
||||
data.command = this->command_.value(x...);
|
||||
|
@@ -26,8 +26,7 @@ template<typename... Ts> class PioneerAction : public RemoteTransmitterActionBas
|
||||
TEMPLATABLE_VALUE(uint16_t, rc_code_1)
|
||||
TEMPLATABLE_VALUE(uint16_t, rc_code_2)
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
PioneerData data{};
|
||||
data.rc_code_1 = this->rc_code_1_.value(x...);
|
||||
data.rc_code_2 = this->rc_code_2_.value(x...);
|
||||
|
@@ -46,8 +46,7 @@ template<typename... Ts> class RawAction : public RemoteTransmitterActionBase<Ts
|
||||
}
|
||||
TEMPLATABLE_VALUE(uint32_t, carrier_frequency);
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
if (this->code_static_ != nullptr) {
|
||||
for (size_t i = 0; i < this->code_static_len_; i++) {
|
||||
auto val = this->code_static_[i];
|
||||
@@ -62,6 +61,7 @@ template<typename... Ts> class RawAction : public RemoteTransmitterActionBase<Ts
|
||||
dst->set_carrier_frequency(this->carrier_frequency_.value(x...));
|
||||
}
|
||||
|
||||
protected:
|
||||
std::function<std::vector<int32_t>(Ts...)> code_func_{};
|
||||
const int32_t *code_static_{nullptr};
|
||||
int32_t code_static_len_{0};
|
||||
|
@@ -27,8 +27,7 @@ template<typename... Ts> class RC5Action : public RemoteTransmitterActionBase<Ts
|
||||
TEMPLATABLE_VALUE(uint8_t, address)
|
||||
TEMPLATABLE_VALUE(uint8_t, command)
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
RC5Data data{};
|
||||
data.address = this->address_.value(x...);
|
||||
data.command = this->command_.value(x...);
|
||||
|
@@ -71,8 +71,7 @@ template<typename... Ts> class RCSwitchRawAction : public RemoteTransmitterActio
|
||||
TEMPLATABLE_VALUE(RCSwitchBase, protocol);
|
||||
TEMPLATABLE_VALUE(std::string, code);
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
auto code = this->code_.value(x...);
|
||||
uint64_t the_code = decode_binary_string(code);
|
||||
uint8_t nbits = code.size();
|
||||
@@ -89,8 +88,7 @@ template<typename... Ts> class RCSwitchTypeAAction : public RemoteTransmitterAct
|
||||
TEMPLATABLE_VALUE(std::string, device);
|
||||
TEMPLATABLE_VALUE(bool, state);
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
auto group = this->group_.value(x...);
|
||||
auto device = this->device_.value(x...);
|
||||
auto state = this->state_.value(x...);
|
||||
@@ -113,8 +111,7 @@ template<typename... Ts> class RCSwitchTypeBAction : public RemoteTransmitterAct
|
||||
TEMPLATABLE_VALUE(uint8_t, channel);
|
||||
TEMPLATABLE_VALUE(bool, state);
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
auto address = this->address_.value(x...);
|
||||
auto channel = this->channel_.value(x...);
|
||||
auto state = this->state_.value(x...);
|
||||
@@ -136,8 +133,7 @@ template<typename... Ts> class RCSwitchTypeCAction : public RemoteTransmitterAct
|
||||
TEMPLATABLE_VALUE(uint8_t, device);
|
||||
TEMPLATABLE_VALUE(bool, state);
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
auto family = this->family_.value(x...);
|
||||
auto group = this->group_.value(x...);
|
||||
auto device = this->device_.value(x...);
|
||||
@@ -160,8 +156,7 @@ template<typename... Ts> class RCSwitchTypeDAction : public RemoteTransmitterAct
|
||||
TEMPLATABLE_VALUE(uint8_t, device);
|
||||
TEMPLATABLE_VALUE(bool, state);
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
auto group = this->group_.value(x...);
|
||||
auto device = this->device_.value(x...);
|
||||
auto state = this->state_.value(x...);
|
||||
|
@@ -326,17 +326,17 @@ template<typename... Ts> class RemoteTransmitterActionBase : public Action<Ts...
|
||||
TEMPLATABLE_VALUE(uint32_t, send_times);
|
||||
TEMPLATABLE_VALUE(uint32_t, send_wait);
|
||||
|
||||
protected:
|
||||
virtual void encode_(RemoteTransmitData *dst, Ts... x) = 0;
|
||||
|
||||
void play_(Ts... x) override {
|
||||
void play(Ts... x) override {
|
||||
auto call = this->parent_->transmit();
|
||||
this->encode_(call.get_data(), x...);
|
||||
this->encode(call.get_data(), x...);
|
||||
call.set_send_times(this->send_times_.value_or(x..., 1));
|
||||
call.set_send_wait(this->send_wait_.value_or(x..., 0));
|
||||
call.perform();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void encode(RemoteTransmitData *dst, Ts... x) = 0;
|
||||
|
||||
RemoteTransmitterBase *parent_{};
|
||||
};
|
||||
|
||||
|
@@ -25,8 +25,7 @@ template<typename... Ts> class SamsungAction : public RemoteTransmitterActionBas
|
||||
public:
|
||||
TEMPLATABLE_VALUE(uint32_t, data)
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
SamsungData data{};
|
||||
data.data = this->data_.value(x...);
|
||||
SamsungProtocol().encode(dst, data);
|
||||
|
@@ -27,8 +27,7 @@ template<typename... Ts> class SonyAction : public RemoteTransmitterActionBase<T
|
||||
TEMPLATABLE_VALUE(uint32_t, data)
|
||||
TEMPLATABLE_VALUE(uint8_t, nbits)
|
||||
|
||||
protected:
|
||||
void encode_(RemoteTransmitData *dst, Ts... x) override {
|
||||
void encode(RemoteTransmitData *dst, Ts... x) override {
|
||||
SonyData data{};
|
||||
data.data = this->data_.value(x...);
|
||||
data.nbits = this->nbits_.value(x...);
|
||||
|
Reference in New Issue
Block a user