cleaned for new home
This commit is contained in:
@@ -1,26 +1,5 @@
|
||||
#include "esphome.h"
|
||||
|
||||
// protocol
|
||||
#define TUYA_COVER_MAX_LEN 640 // Max length of message value
|
||||
// #define TUYA_COVER_MAX_LEN 256 // Max length of message value
|
||||
#define TUYA_COVER_BUFFER_LEN 6 // Length of serial buffer for header + type + length
|
||||
#define TUYA_COVER_HEADER_LEN 2 // Length of fixed header
|
||||
|
||||
// enable/disable reversed motor direction
|
||||
// Normal = header (55AA) + (00060005) + 050100010011 "(55AA00060005050100010011)
|
||||
// Reversed = header (55AA) + (00060005) + 050100010112 "(55AA00060005050100010112)"
|
||||
#define TUYA_COVER_DISABLE_REVERSING { 0x69, 0x01, 0x00, 0x01, 0x00 } //dpid = 105, type = bool, len = 1, value = disable
|
||||
#define TUYA_COVER_ENABLE_REVERSING { 0x69, 0x01, 0x00, 0x01, 0x01 } //dpid = 105, type = bool, len = 1, value = enable
|
||||
// Curtain commands
|
||||
// Open = header (55AA) + (00060005) + 6604000100 "(55aa000600056604000100)"
|
||||
// Close = header (55AA) + (00060005) + 6604000101 "(55aa000600056604000101)"
|
||||
// Stop = header (55AA) + (00060005) + 6604000102 "(55AA000600056604000102)"
|
||||
#define TUYA_COVER_OPEN { 0x66, 0x04, 0x00, 0x01, 0x00 } //dpid = 101, type = enum, len = 1, value = OPEN
|
||||
#define TUYA_COVER_CLOSE { 0x66, 0x04, 0x00, 0x01, 0x01 } //dpid = 101, type = enum, len = 1, value = CLOSE
|
||||
#define TUYA_COVER_STOP { 0x66, 0x04, 0x00, 0x01, 0x02 } //dpid = 101, type = enum, len = 1, value = STOP
|
||||
|
||||
#define TUYA_COVER_SET_POSITION { 0x65, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 } //"65020004000000" //dpid = 2, type = value, len = 4, value = 0x000000 + 1 byte (0x00-0x64)
|
||||
|
||||
static const char *TAG = "TUYACOVER";
|
||||
static const uint16_t TUYA_COVER_HEADER = 0x55AA;
|
||||
//static const uint16_t TUYA_COVER_VERSION = 0x03;
|
||||
@@ -71,7 +50,7 @@ enum TUYACOVERdpidType
|
||||
};
|
||||
|
||||
// Variables
|
||||
TUYACOVERCommand command_{TUYA_COVER_HEADER, TUYA_COVER_VERSION, 0, 0, {}, 0};
|
||||
//TUYACOVERCommand command_{TUYA_COVER_HEADER, TUYA_COVER_VERSION, 0, 0, {}, 0};
|
||||
uint8_t uart_buffer_[TUYA_COVER_BUFFER_LEN]{0};
|
||||
|
||||
// Forward declarations
|
||||
|
||||
Reference in New Issue
Block a user