-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlightbar.h
47 lines (41 loc) · 934 Bytes
/
lightbar.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef LIGHTBAR_H
#define LIGHTBAR_H
#include "radio.h"
class Lightbar
{
public:
Lightbar(Radio *radio, uint32_t serial, const char *name);
~Lightbar();
uint32_t getSerial();
const String getSerialString();
const char *getName();
enum Command
{
ON_OFF = 0x01,
COOLER = 0x02,
WARMER = 0x03,
BRIGHTER = 0x04,
DIMMER = 0x05,
RESET = 0x06
};
void sendRawCommand(Command command, byte options);
void sendRawCommand(Command command);
void onOff();
void brighter();
void dimmer();
void warmer();
void cooler();
void reset();
void pair();
void setOnOff(bool on);
void setTemperature(uint8_t value);
void setMiredTemperature(uint mireds);
void setBrightness(uint8_t value);
private:
Radio *radio;
bool onState = false;
uint32_t serial;
String serialString;
const char *name;
};
#endif