Skip to content

Commit 208b182

Browse files
committed
Added enableScenes API to example
1 parent b5a6b63 commit 208b182

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

Diff for: libraries/RainMaker/examples/RMakerCustom/RMakerCustom.ino

+9-7
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ static Device my_device("Dimmer", "custom.device.dimmer", &gpio_dimmer);
2626

2727
void sysProvEvent(arduino_event_t *sys_event)
2828
{
29-
switch (sys_event->event_id) {
29+
switch (sys_event->event_id) {
3030
case ARDUINO_EVENT_PROV_START:
3131
#if CONFIG_IDF_TARGET_ESP32S2
3232
Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on SoftAP\n", service_name, pop);
3333
printQR(service_name, pop, "softap");
3434
#else
3535
Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on BLE\n", service_name, pop);
3636
printQR(service_name, pop, "ble");
37-
#endif
37+
#endif
3838
break;
3939
default:;
4040
}
@@ -63,7 +63,7 @@ void setup()
6363
pinMode(gpio_dimmer, OUTPUT);
6464
digitalWrite(gpio_dimmer, DEFAULT_POWER_MODE);
6565

66-
Node my_node;
66+
Node my_node;
6767
my_node = RMaker.initNode("ESP RainMaker Node");
6868

6969
//Create custom dimmer device
@@ -78,20 +78,22 @@ void setup()
7878
my_device.addParam(level_param);
7979

8080
my_device.addCb(write_callback);
81-
82-
//Add custom dimmer device to the node
81+
82+
//Add custom dimmer device to the node
8383
my_node.addDevice(my_device);
8484

85-
//This is optional
85+
//This is optional
8686
RMaker.enableOTA(OTA_USING_PARAMS);
87-
//If you want to enable scheduling, set time zone for your region using setTimeZone().
87+
//If you want to enable scheduling, set time zone for your region using setTimeZone().
8888
//The list of available values are provided here https://rainmaker.espressif.com/docs/time-service.html
8989
// RMaker.setTimeZone("Asia/Shanghai");
9090
// Alternatively, enable the Timezone service and let the phone apps set the appropriate timezone
9191
RMaker.enableTZService();
9292

9393
RMaker.enableSchedule();
9494

95+
RMaker.enableScenes();
96+
9597
RMaker.start();
9698

9799
WiFi.onEvent(sysProvEvent);

Diff for: libraries/RainMaker/examples/RMakerCustomAirCooler/RMakerCustomAirCooler.ino

+9-7
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ static Device my_device("Air Cooler", "my.device.air-cooler", NULL);
4343

4444
void sysProvEvent(arduino_event_t *sys_event)
4545
{
46-
switch (sys_event->event_id) {
46+
switch (sys_event->event_id) {
4747
case ARDUINO_EVENT_PROV_START:
4848
#if CONFIG_IDF_TARGET_ESP32S2
4949
Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on SoftAP\n", service_name, pop);
5050
printQR(service_name, pop, "softap");
5151
#else
5252
Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on BLE\n", service_name, pop);
5353
printQR(service_name, pop, "ble");
54-
#endif
54+
#endif
5555
break;
5656
default:;
5757
}
@@ -114,7 +114,7 @@ void setup()
114114
pinMode(gpio_speed, OUTPUT);
115115
analogWrite(gpio_speed, DEFAULT_SPEED);
116116

117-
Node my_node;
117+
Node my_node;
118118
my_node = RMaker.initNode("ESP RainMaker Node");
119119

120120
//Create custom air cooler device
@@ -138,20 +138,22 @@ void setup()
138138
my_device.addParam(mode_param);
139139

140140
my_device.addCb(write_callback);
141-
142-
//Add custom Air Cooler device to the node
141+
142+
//Add custom Air Cooler device to the node
143143
my_node.addDevice(my_device);
144144

145-
//This is optional
145+
//This is optional
146146
// RMaker.enableOTA(OTA_USING_PARAMS);
147-
//If you want to enable scheduling, set time zone for your region using setTimeZone().
147+
//If you want to enable scheduling, set time zone for your region using setTimeZone().
148148
//The list of available values are provided here https://rainmaker.espressif.com/docs/time-service.html
149149
// RMaker.setTimeZone("Asia/Shanghai");
150150
//Alternatively, enable the Timezone service and let the phone apps set the appropriate timezone
151151
// RMaker.enableTZService();
152152

153153
RMaker.enableSchedule();
154154

155+
RMaker.enableScenes();
156+
155157
RMaker.start();
156158

157159
WiFi.onEvent(sysProvEvent);

Diff for: libraries/RainMaker/examples/RMakerSonoffDualR3/RMakerSonoffDualR3.ino

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ void setup()
136136
// Alternatively, enable the Timezone service and let the phone apps set the appropriate timezone
137137
RMaker.enableTZService();
138138
RMaker.enableSchedule();
139+
RMaker.enableScenes();
139140

140141
//Service Name
141142
for(int i=0; i<17; i=i+8) {

Diff for: libraries/RainMaker/examples/RMakerSwitch/RMakerSwitch.ino

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ void setup()
8181

8282
RMaker.enableSchedule();
8383

84+
RMaker.enableScenes();
85+
8486
RMaker.start();
8587

8688
WiFi.onEvent(sysProvEvent);

0 commit comments

Comments
 (0)