完成初代的雏形设计
This commit is contained in:
40
main/status_web.h
Normal file
40
main/status_web.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "mqtt_control.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char temp[16];
|
||||
char hum[16];
|
||||
char lux[16];
|
||||
bool fan_on;
|
||||
bool light_on;
|
||||
bool hot_on;
|
||||
bool cool_on;
|
||||
bool auto_mode;
|
||||
float light_on_threshold;
|
||||
float light_off_threshold;
|
||||
float hot_on_temp_threshold;
|
||||
float hot_off_temp_threshold;
|
||||
float cool_on_temp_threshold;
|
||||
float cool_off_temp_threshold;
|
||||
float fan_on_hum_threshold;
|
||||
float fan_off_hum_threshold;
|
||||
bool i2c_ready;
|
||||
uint32_t loop_counter;
|
||||
} status_web_snapshot_t;
|
||||
|
||||
esp_err_t status_web_start(uint16_t port);
|
||||
esp_err_t status_web_update(const status_web_snapshot_t *snapshot);
|
||||
esp_err_t status_web_register_control_handler(mqtt_control_command_handler_t handler, void *user_ctx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user