cade formatting

This commit is contained in:
GrKoR
2022-07-14 17:22:57 +03:00
parent 517265f73c
commit 18edab9742
2 changed files with 2649 additions and 2675 deletions

View File

@@ -1,16 +1,15 @@
#pragma once #pragma once
#include "esphome/core/component.h"
#include "esphome/core/automation.h"
#include "aux_ac.h" #include "aux_ac.h"
#include "esphome/core/automation.h"
#include "esphome/core/component.h"
namespace esphome { namespace esphome {
namespace aux_ac { namespace aux_ac {
// **************************************** DISPLAY ACTIONS **************************************** // **************************************** DISPLAY ACTIONS ****************************************
template <typename... Ts> template <typename... Ts>
class AirConDisplayOffAction : public Action<Ts...> class AirConDisplayOffAction : public Action<Ts...> {
{
public: public:
explicit AirConDisplayOffAction(AirCon *ac) : ac_(ac) {} explicit AirConDisplayOffAction(AirCon *ac) : ac_(ac) {}
@@ -18,11 +17,10 @@ namespace aux_ac {
protected: protected:
AirCon *ac_; AirCon *ac_;
}; };
template <typename... Ts> template <typename... Ts>
class AirConDisplayOnAction : public Action<Ts...> class AirConDisplayOnAction : public Action<Ts...> {
{
public: public:
explicit AirConDisplayOnAction(AirCon *ac) : ac_(ac) {} explicit AirConDisplayOnAction(AirCon *ac) : ac_(ac) {}
@@ -30,14 +28,11 @@ namespace aux_ac {
protected: protected:
AirCon *ac_; AirCon *ac_;
}; };
// **************************************** VERTICAL LOUVER ACTIONS **************************************** // **************************************** VERTICAL LOUVER ACTIONS ****************************************
template <typename... Ts> template <typename... Ts>
class AirConVLouverSwingAction : public Action<Ts...> class AirConVLouverSwingAction : public Action<Ts...> {
{
public: public:
explicit AirConVLouverSwingAction(AirCon *ac) : ac_(ac) {} explicit AirConVLouverSwingAction(AirCon *ac) : ac_(ac) {}
@@ -45,11 +40,10 @@ namespace aux_ac {
protected: protected:
AirCon *ac_; AirCon *ac_;
}; };
template <typename... Ts> template <typename... Ts>
class AirConVLouverStopAction : public Action<Ts...> class AirConVLouverStopAction : public Action<Ts...> {
{
public: public:
explicit AirConVLouverStopAction(AirCon *ac) : ac_(ac) {} explicit AirConVLouverStopAction(AirCon *ac) : ac_(ac) {}
@@ -57,11 +51,10 @@ namespace aux_ac {
protected: protected:
AirCon *ac_; AirCon *ac_;
}; };
template <typename... Ts> template <typename... Ts>
class AirConVLouverTopAction : public Action<Ts...> class AirConVLouverTopAction : public Action<Ts...> {
{
public: public:
explicit AirConVLouverTopAction(AirCon *ac) : ac_(ac) {} explicit AirConVLouverTopAction(AirCon *ac) : ac_(ac) {}
@@ -69,11 +62,10 @@ namespace aux_ac {
protected: protected:
AirCon *ac_; AirCon *ac_;
}; };
template <typename... Ts> template <typename... Ts>
class AirConVLouverMiddleAboveAction : public Action<Ts...> class AirConVLouverMiddleAboveAction : public Action<Ts...> {
{
public: public:
explicit AirConVLouverMiddleAboveAction(AirCon *ac) : ac_(ac) {} explicit AirConVLouverMiddleAboveAction(AirCon *ac) : ac_(ac) {}
@@ -81,11 +73,10 @@ namespace aux_ac {
protected: protected:
AirCon *ac_; AirCon *ac_;
}; };
template <typename... Ts> template <typename... Ts>
class AirConVLouverMiddleAction : public Action<Ts...> class AirConVLouverMiddleAction : public Action<Ts...> {
{
public: public:
explicit AirConVLouverMiddleAction(AirCon *ac) : ac_(ac) {} explicit AirConVLouverMiddleAction(AirCon *ac) : ac_(ac) {}
@@ -93,11 +84,10 @@ namespace aux_ac {
protected: protected:
AirCon *ac_; AirCon *ac_;
}; };
template <typename... Ts> template <typename... Ts>
class AirConVLouverMiddleBelowAction : public Action<Ts...> class AirConVLouverMiddleBelowAction : public Action<Ts...> {
{
public: public:
explicit AirConVLouverMiddleBelowAction(AirCon *ac) : ac_(ac) {} explicit AirConVLouverMiddleBelowAction(AirCon *ac) : ac_(ac) {}
@@ -105,11 +95,10 @@ namespace aux_ac {
protected: protected:
AirCon *ac_; AirCon *ac_;
}; };
template <typename... Ts> template <typename... Ts>
class AirConVLouverBottomAction : public Action<Ts...> class AirConVLouverBottomAction : public Action<Ts...> {
{
public: public:
explicit AirConVLouverBottomAction(AirCon *ac) : ac_(ac) {} explicit AirConVLouverBottomAction(AirCon *ac) : ac_(ac) {}
@@ -117,30 +106,27 @@ namespace aux_ac {
protected: protected:
AirCon *ac_; AirCon *ac_;
}; };
template<typename... Ts> template <typename... Ts>
class AirConVLouverSetAction : public Action<Ts...> class AirConVLouverSetAction : public Action<Ts...> {
{
public: public:
AirConVLouverSetAction(AirCon *ac) : ac_(ac) {} AirConVLouverSetAction(AirCon *ac) : ac_(ac) {}
TEMPLATABLE_VALUE(uint8_t, value); TEMPLATABLE_VALUE(uint8_t, value);
void play(Ts... x) { void play(Ts... x) {
vlpos_ = this->value_.value(x...); vlpos_ = this->value_.value(x...);
this->ac_->setVLouverFrontendSequence( (ac_vlouver_frontend)vlpos_); this->ac_->setVLouverFrontendSequence((ac_vlouver_frontend)vlpos_);
} }
protected: protected:
AirCon *ac_; AirCon *ac_;
uint8_t vlpos_; uint8_t vlpos_;
}; };
// **************************************** SEND TEST PACKET ACTION **************************************** // **************************************** SEND TEST PACKET ACTION ****************************************
template <typename... Ts> template <typename... Ts>
class AirConSendTestPacketAction : public Action<Ts...> class AirConSendTestPacketAction : public Action<Ts...> {
{
public: public:
explicit AirConSendTestPacketAction(AirCon *ac) : ac_(ac) {} explicit AirConSendTestPacketAction(AirCon *ac) : ac_(ac) {}
void set_data_template(std::function<std::vector<uint8_t>(Ts...)> func) { void set_data_template(std::function<std::vector<uint8_t>(Ts...)> func) {
@@ -166,7 +152,7 @@ namespace aux_ac {
bool static_{false}; bool static_{false};
std::function<std::vector<uint8_t>(Ts...)> data_func_{}; std::function<std::vector<uint8_t>(Ts...)> data_func_{};
std::vector<uint8_t> data_static_{}; std::vector<uint8_t> data_static_{};
}; };
} // namespace aux_ac } // namespace aux_ac
} // namespace esphome } // namespace esphome

File diff suppressed because it is too large Load Diff