Remove unused abstractions
There's only 1 protocol (secplus2) and board (esp32)
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "common.h"
|
||||
#include "ratgdo_state.h"
|
||||
|
||||
namespace esphome {
|
||||
|
||||
class Scheduler;
|
||||
class InternalGPIOPin;
|
||||
|
||||
} // namespace esphome
|
||||
|
||||
namespace esphome::ratgdo {
|
||||
|
||||
class RATGDOComponent;
|
||||
|
||||
namespace protocol {
|
||||
|
||||
class Protocol {
|
||||
public:
|
||||
virtual void setup(RATGDOComponent* ratgdo, Scheduler* scheduler, InternalGPIOPin* rx_pin, InternalGPIOPin* tx_pin);
|
||||
virtual void loop();
|
||||
virtual void dump_config();
|
||||
|
||||
virtual void on_shutdown() { }
|
||||
|
||||
virtual void sync();
|
||||
|
||||
virtual void light_action(LightAction action);
|
||||
virtual void lock_action(LockAction action);
|
||||
virtual void door_action(DoorAction action);
|
||||
|
||||
virtual void query_status() {}
|
||||
virtual void query_openings() {}
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace esphome::ratgdo
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
namespace esphome::ratgdo {
|
||||
|
||||
using namespace protocol;
|
||||
|
||||
|
||||
static const char* const TAG = "ratgdo";
|
||||
static constexpr int SYNC_DELAY = 5000;
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
#include "callbacks.h"
|
||||
|
||||
#include "observable.h"
|
||||
#include "protocol.h"
|
||||
#include "ratgdo_state.h"
|
||||
|
||||
namespace esphome::ratgdo {
|
||||
|
||||
namespace secplus2 { class Secplus2; }
|
||||
|
||||
class RATGDOComponent;
|
||||
typedef Parented<RATGDOComponent> RATGDOClient;
|
||||
|
||||
@@ -185,7 +186,7 @@ public:
|
||||
|
||||
protected:
|
||||
// Pointers first (4-byte aligned)
|
||||
protocol::Protocol* protocol_;
|
||||
secplus2::Secplus2* protocol_;
|
||||
InternalGPIOPin* output_gdo_pin_;
|
||||
InternalGPIOPin* input_gdo_pin_;
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "esphome/core/defines.h"
|
||||
#include "ratgdo_uart_esp32.h"
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "ratgdo_uart.h"
|
||||
#include "ratgdo_uart_esp32.h"
|
||||
|
||||
#include "esphome/core/log.h"
|
||||
#include <driver/uart.h>
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
#include "esphome/core/optional.h"
|
||||
#include "esphome/core/preferences.h"
|
||||
#include "esphome/components/mqtt/mqtt_client.h"
|
||||
#include "ratgdo_uart.h"
|
||||
#include "ratgdo_uart_esp32.h"
|
||||
|
||||
#include "callbacks.h"
|
||||
#include "common.h"
|
||||
#include "observable.h"
|
||||
#include "protocol.h"
|
||||
#include "ratgdo_state.h"
|
||||
|
||||
namespace esphome {
|
||||
@@ -23,8 +22,6 @@ class RATGDOComponent;
|
||||
|
||||
namespace secplus2 {
|
||||
|
||||
using namespace esphome::ratgdo::protocol;
|
||||
|
||||
static const uint8_t PACKET_LENGTH = 19;
|
||||
typedef uint8_t WirePacket[PACKET_LENGTH];
|
||||
|
||||
@@ -94,12 +91,12 @@ namespace secplus2 {
|
||||
}
|
||||
};
|
||||
|
||||
class Secplus2 : public Protocol {
|
||||
class Secplus2 {
|
||||
public:
|
||||
void setup(RATGDOComponent* ratgdo, Scheduler* scheduler, InternalGPIOPin* rx_pin, InternalGPIOPin* tx_pin);
|
||||
void loop();
|
||||
void dump_config();
|
||||
void on_shutdown() override;
|
||||
void on_shutdown();
|
||||
|
||||
void sync();
|
||||
|
||||
@@ -107,8 +104,8 @@ namespace secplus2 {
|
||||
void lock_action(LockAction action);
|
||||
void door_action(DoorAction action);
|
||||
|
||||
void query_status() override;
|
||||
void query_openings() override;
|
||||
void query_status();
|
||||
void query_openings();
|
||||
|
||||
protected:
|
||||
void increment_rolling_code_counter(int delta = 1);
|
||||
|
||||
Reference in New Issue
Block a user