mirror of
https://github.com/espressif/esp-rainmaker.git
synced 2026-01-19 16:03:45 +00:00
examples: Add timezone service in some examples
Setting correct timezone is mandatory for scheduling to work correctly. Earlier, the default timezone was set to "Asia/Shanghai" and a config change was required for setting appropriate timezone. However, now that the phone apps have support for setting the timezone using the RainMaker timezone service, it has been enabled in all examples that had scheduling enabled.
This commit is contained in:
@@ -89,13 +89,14 @@ void app_main()
|
||||
esp_rmaker_device_add_param(fan_device, esp_rmaker_speed_param_create(ESP_RMAKER_DEF_SPEED_NAME, DEFAULT_SPEED));
|
||||
esp_rmaker_node_add_device(node, fan_device);
|
||||
|
||||
/* Enable scheduling.
|
||||
* Please note that you also need to set the timezone for schedules to work correctly.
|
||||
* Simplest option is to use the CONFIG_ESP_RMAKER_DEF_TIMEZONE config option.
|
||||
* Else, you can set the timezone using the API call `esp_rmaker_time_set_timezone("Asia/Shanghai");`
|
||||
/* Enable timezone service which will be require for setting appropriate timezone
|
||||
* from the phone apps for scheduling to work correctly.
|
||||
* For more information on the various ways of setting timezone, please check
|
||||
* https://rainmaker.espressif.com/docs/time-service.html.
|
||||
*/
|
||||
esp_rmaker_timezone_service_enable();
|
||||
|
||||
/* Enable scheduling. */
|
||||
esp_rmaker_schedule_enable();
|
||||
|
||||
/* Start the ESP RainMaker Agent */
|
||||
|
||||
@@ -110,13 +110,14 @@ void app_main()
|
||||
};
|
||||
esp_rmaker_ota_enable(&ota_config, OTA_USING_PARAMS);
|
||||
|
||||
/* Enable scheduling
|
||||
* Please note that you also need to set the timezone for schedules to work correctly.
|
||||
* Simplest option is to use the CONFIG_ESP_RMAKER_DEF_TIMEZONE config option.
|
||||
* Else, you can set the timezone using the API call `esp_rmaker_time_set_timezone("Asia/Shanghai");`
|
||||
/* Enable timezone service which will be require for setting appropriate timezone
|
||||
* from the phone apps for scheduling to work correctly.
|
||||
* For more information on the various ways of setting timezone, please check
|
||||
* https://rainmaker.espressif.com/docs/time-service.html.
|
||||
*/
|
||||
esp_rmaker_timezone_service_enable();
|
||||
|
||||
/* Enable scheduling. */
|
||||
esp_rmaker_schedule_enable();
|
||||
|
||||
/* Start the ESP RainMaker Agent */
|
||||
|
||||
@@ -118,13 +118,14 @@ void app_main()
|
||||
temp_sensor_device = esp_rmaker_temp_sensor_device_create("Temperature Sensor", NULL, app_get_current_temperature());
|
||||
esp_rmaker_node_add_device(node, temp_sensor_device);
|
||||
|
||||
/* Enable scheduling.
|
||||
* Please note that you also need to set the timezone for schedules to work correctly.
|
||||
* Simplest option is to use the CONFIG_ESP_RMAKER_DEF_TIMEZONE config option.
|
||||
* Else, you can set the timezone using the API call `esp_rmaker_time_set_timezone("Asia/Shanghai");`
|
||||
/* Enable timezone service which will be require for setting appropriate timezone
|
||||
* from the phone apps for scheduling to work correctly.
|
||||
* For more information on the various ways of setting timezone, please check
|
||||
* https://rainmaker.espressif.com/docs/time-service.html.
|
||||
*/
|
||||
esp_rmaker_timezone_service_enable();
|
||||
|
||||
/* Enable scheduling. */
|
||||
esp_rmaker_schedule_enable();
|
||||
|
||||
/* Start the ESP RainMaker Agent */
|
||||
|
||||
@@ -170,13 +170,14 @@ void app_main()
|
||||
};
|
||||
esp_rmaker_ota_enable(&ota_config, OTA_USING_PARAMS);
|
||||
|
||||
/* Enable scheduling.
|
||||
* Please note that you also need to set the timezone for schedules to work correctly.
|
||||
* Simplest option is to use the CONFIG_ESP_RMAKER_DEF_TIMEZONE config option.
|
||||
* Else, you can set the timezone using the API call `esp_rmaker_time_set_timezone("Asia/Shanghai");`
|
||||
/* Enable timezone service which will be require for setting appropriate timezone
|
||||
* from the phone apps for scheduling to work correctly.
|
||||
* For more information on the various ways of setting timezone, please check
|
||||
* https://rainmaker.espressif.com/docs/time-service.html.
|
||||
*/
|
||||
esp_rmaker_timezone_service_enable();
|
||||
|
||||
/* Enable scheduling. */
|
||||
esp_rmaker_schedule_enable();
|
||||
|
||||
/* Start the ESP RainMaker Agent */
|
||||
|
||||
Reference in New Issue
Block a user