diff --git a/ESP32-Rainmaker-Switch/main/app_driver.c b/ESP32-Rainmaker-Switch/main/app_driver.c index eae199be..ef55e21d 100644 --- a/ESP32-Rainmaker-Switch/main/app_driver.c +++ b/ESP32-Rainmaker-Switch/main/app_driver.c @@ -8,9 +8,13 @@ */ #include +#include +#include + #include #include +#include #include #include @@ -41,11 +45,22 @@ static bool g_power_state = DEFAULT_POWER; // Define the name of app for logs. static const char *TAG = "ESP32-Nodes Rainmaker Switch"; +static float a_light; +static TimerHandle_t sensor_timer; static void light_sensor_init(void) { ESP_LOGI(TAG, "Initializing sensor ..."); } +static void light_sensor_update(TimerHandle_t handle) { + static float delta = 0.25; + + a_light += delta; + esp_rmaker_param_update_and_report( + esp_rmaker_device_get_param_by_type(switch_device, ESP_RMAKER_PARAM_TEMPERATURE), + esp_rmaker_float(a_light)); +} + static void app_bme280_init() {} static void app_indicator_set(bool state)