mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-08 03:42:24 +00:00
.
This commit is contained in:
@@ -180,7 +180,7 @@ void app_main()
|
|||||||
esp_rmaker_config_t rainmaker_cfg = {
|
esp_rmaker_config_t rainmaker_cfg = {
|
||||||
.enable_time_sync = false,
|
.enable_time_sync = false,
|
||||||
};
|
};
|
||||||
esp_rmaker_node_t *node = esp_rmaker_node_init(&rainmaker_cfg, "ESP RainMaker Device", "Switch");
|
esp_rmaker_node_t *node = esp_rmaker_node_init(&rainmaker_cfg, "ESP RainMaker Table Lamp", "Lamp");
|
||||||
if (!node) {
|
if (!node) {
|
||||||
ESP_LOGE(TAG, "Could not initialise node. Aborting!!!");
|
ESP_LOGE(TAG, "Could not initialise node. Aborting!!!");
|
||||||
vTaskDelay(5000/portTICK_PERIOD_MS);
|
vTaskDelay(5000/portTICK_PERIOD_MS);
|
||||||
@@ -191,7 +191,7 @@ void app_main()
|
|||||||
* You can optionally use the helper API esp_rmaker_switch_device_create() to
|
* You can optionally use the helper API esp_rmaker_switch_device_create() to
|
||||||
* avoid writing code for adding the name and power parameters.
|
* avoid writing code for adding the name and power parameters.
|
||||||
*/
|
*/
|
||||||
switch_device = esp_rmaker_device_create("Switch", ESP_RMAKER_DEVICE_SWITCH, NULL);
|
switch_device = esp_rmaker_device_create("Lamp", ESP_RMAKER_DEVICE_SWITCH, NULL);
|
||||||
|
|
||||||
/* Add the write callback for the device. We aren't registering any read callback yet as
|
/* Add the write callback for the device. We aren't registering any read callback yet as
|
||||||
* it is for future use.
|
* it is for future use.
|
||||||
@@ -202,7 +202,7 @@ void app_main()
|
|||||||
* user friendly custom name from the phone apps. All devices are recommended to have this
|
* user friendly custom name from the phone apps. All devices are recommended to have this
|
||||||
* parameter.
|
* parameter.
|
||||||
*/
|
*/
|
||||||
esp_rmaker_device_add_param(switch_device, esp_rmaker_name_param_create(ESP_RMAKER_DEF_NAME_PARAM, "Switch"));
|
esp_rmaker_device_add_param(switch_device, esp_rmaker_name_param_create(ESP_RMAKER_DEF_NAME_PARAM, "Lamp"));
|
||||||
|
|
||||||
/* Add the standard power parameter (type: esp.param.power), which adds a boolean param
|
/* Add the standard power parameter (type: esp.param.power), which adds a boolean param
|
||||||
* with a toggle switch ui-type.
|
* with a toggle switch ui-type.
|
||||||
|
Reference in New Issue
Block a user