state information
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
#include "esp_http_server.h"
|
||||
#include "ygg_http_routes.h"
|
||||
|
||||
extern float last_temperature;
|
||||
extern float last_pressure;
|
||||
extern float last_humidity;
|
||||
#include "ygg_state.h"
|
||||
|
||||
esp_err_t ygg_get_handler(httpd_req_t *req)
|
||||
{
|
||||
@@ -21,7 +18,7 @@ esp_err_t ygg_get_handler(httpd_req_t *req)
|
||||
|
||||
static ygg_http_user_ctx temp_ctx = {
|
||||
.param_name = "temperature",
|
||||
.param_val = &last_temperature
|
||||
.param_val = &CURR_READOUT.temperature
|
||||
};
|
||||
|
||||
const httpd_uri_t ygg_temp_uri = {
|
||||
@@ -33,7 +30,7 @@ const httpd_uri_t ygg_temp_uri = {
|
||||
|
||||
static ygg_http_user_ctx press_ctx = {
|
||||
.param_name = "pressure",
|
||||
.param_val = &last_pressure
|
||||
.param_val = &CURR_READOUT.pressure
|
||||
};
|
||||
|
||||
const httpd_uri_t ygg_press_uri = {
|
||||
@@ -45,7 +42,7 @@ const httpd_uri_t ygg_press_uri = {
|
||||
|
||||
static ygg_http_user_ctx hum_ctx = {
|
||||
.param_name = "humidity",
|
||||
.param_val = &last_humidity
|
||||
.param_val = &CURR_READOUT.humidity
|
||||
};
|
||||
|
||||
const httpd_uri_t ygg_hum_uri = {
|
||||
|
||||
Reference in New Issue
Block a user