This commit is contained in:
2024-08-16 04:23:20 -04:00
parent 61ca50499f
commit 169af8b5d6

View File

@@ -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.