Support multi backend items
This commit is contained in:
@ -3,8 +3,9 @@
|
||||
|
||||
#include<util/delay.h>
|
||||
#include"writepin.h"
|
||||
#include "item.h"
|
||||
|
||||
class WirelessRelay
|
||||
class WirelessRelay: public Item
|
||||
{
|
||||
public:
|
||||
static constexpr uint16_t LARGE_TIME = 750;
|
||||
@ -13,23 +14,14 @@ public:
|
||||
static constexpr uint16_t MAX_NAME_LENGTH = 16;
|
||||
|
||||
private:
|
||||
bool _state = false;
|
||||
uint16_t _id;
|
||||
char _name[MAX_NAME_LENGTH];
|
||||
void sendBit(const bool i);
|
||||
void sync();
|
||||
void sendId();
|
||||
void sendBit(const bool i);
|
||||
void sync();
|
||||
void sendId();
|
||||
|
||||
public:
|
||||
WirelessRelay(const uint16_t id, char nameIn[]);
|
||||
WirelessRelay();
|
||||
void init(const uint16_t id, char nameIn[]);
|
||||
void on();
|
||||
void off();
|
||||
char* getName();
|
||||
void setName(char* name);
|
||||
uint16_t getId();
|
||||
bool getExpectedState();
|
||||
WirelessRelay(const uint16_t idIn, char nameIn[]);
|
||||
WirelessRelay(const Item& item);
|
||||
void setValue(const uint8_t value);
|
||||
void resend();
|
||||
};
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user