mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2024-10-05 20:47:50 -04:00
.
This commit is contained in:
parent
b3f1826cf4
commit
90ef4ca4a3
@ -238,7 +238,13 @@ void app_main()
|
|||||||
|
|
||||||
/* CREATE TEMPERATURE SENSOR DEVICE*/
|
/* CREATE TEMPERATURE SENSOR DEVICE*/
|
||||||
// esp.device.temperature-sensor
|
// esp.device.temperature-sensor
|
||||||
temp_sensor_device = esp_rmaker_temp_sensor_device_create("Temperature Sensor", NULL, app_get_current_temperature());
|
// Use pre-defined function
|
||||||
|
// temp_sensor_device = esp_rmaker_temp_sensor_device_create("Temperature Sensor", NULL, app_get_current_temperature());
|
||||||
|
temp_sensor_device = esp_rmaker_device_create("Node ESP32C3 Temperature", ESP_RMAKER_DEVICE_TEMP_SENSOR, app_get_current_temperature());
|
||||||
|
esp_rmaker_device_add_param(temp_sensor_device, esp_rmaker_name_param_create(ESP_RMAKER_DEF_NAME_PARAM, "Node ESP32C3"));
|
||||||
|
esp_rmaker_param_t *temp_param_primary = esp_rmaker_temperature_param_create(ESP_RMAKER_DEF_TEMPERATURE_NAME, app_get_current_temperature());
|
||||||
|
esp_rmaker_device_add_param(temp_sensor_device, temp_param_primary);
|
||||||
|
esp_rmaker_device_assign_primary_param(temp_sensor_device, temp_param_primary);
|
||||||
esp_rmaker_node_add_device(node, temp_sensor_device);
|
esp_rmaker_node_add_device(node, temp_sensor_device);
|
||||||
|
|
||||||
/* CREATE AMBIENT LIGHT SENSOR DEVICE*/
|
/* CREATE AMBIENT LIGHT SENSOR DEVICE*/
|
||||||
|
Loading…
Reference in New Issue
Block a user