Here is the code snippet for the TV param
Code: Select all
// TV Device
device = esp_rmaker_device_create(deviceName_TV, ESP_RMAKER_DEVICE_TV, NULL);
// Add Name Param
esp_rmaker_device_add_param(device, esp_rmaker_name_param_create(ESP_RMAKER_DEF_NAME_PARAM, deviceName_TV));
// Add Power Param as Primary
esp_rmaker_param_t *power_param = esp_rmaker_param_create("Power", ESP_RMAKER_PARAM_POWER, esp_rmaker_bool(true), PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(power_param, ESP_RMAKER_UI_TOGGLE);
esp_rmaker_device_add_param(device, power_param);
esp_rmaker_device_assign_primary_param(device, power_param);
// Add Volume Param
esp_rmaker_param_t *volume_param = esp_rmaker_param_create("Volume", "esp.param.volume", esp_rmaker_float(5.0), PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(volume_param, ESP_RMAKER_UI_SLIDER);
esp_rmaker_param_add_bounds(volume_param, esp_rmaker_float(0.0), esp_rmaker_float(20.0), esp_rmaker_float(1.0));
esp_rmaker_device_add_param(device, volume_param);
// Add Mute Param
esp_rmaker_param_t *mute_param = esp_rmaker_param_create("Mute", "esp.param.mute", esp_rmaker_bool(true), PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(mute_param, ESP_RMAKER_UI_TOGGLE);
esp_rmaker_device_add_param(device, mute_param);