-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtasmota.h
35 lines (30 loc) · 924 Bytes
/
tasmota.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
#define SENSORS_JSON "/run/mcp/sensors.json"
typedef struct tasmota_config_t {
const unsigned int id;
const unsigned int relay;
const unsigned int t1;
const unsigned int t1b;
const unsigned int t2;
const unsigned int t2b;
const unsigned int t3;
const unsigned int t3b;
const unsigned int t4;
const unsigned int t4b;
const unsigned int timer;
} tasmota_config_t;
typedef struct tasmota_state_t {
unsigned int id;
unsigned int relay1;
unsigned int relay2;
unsigned int relay3;
unsigned int relay4;
unsigned int position;
unsigned int timer;
void *next;
} tasmota_state_t;
int tasmota_power(unsigned int id, int relay, int power);
int tasmota_power_on(unsigned int id);
int tasmota_power_off(unsigned int id);
int tasmota_power_get(unsigned int id, int relay);
int tasmota_shutter(unsigned int, unsigned int);
int tasmota_dispatch(const char *topic, uint16_t tsize, const char *message, size_t msize);