Skip to content

Commit 8e55674

Browse files
committed
feat(example): Update factoryResetoption in sleepy example
1 parent 160e286 commit 8e55674

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ void loop() {
133133
// If key pressed for more than 10secs, factory reset Zigbee and reboot
134134
Serial.println("Resetting Zigbee to factory and rebooting in 1s.");
135135
delay(1000);
136-
Zigbee.factoryReset();
136+
// Optional set reset in factoryReset to false, to not restart device after erasing nvram, but set it to endless sleep manually instead
137+
Zigbee.factoryReset(false);
138+
Serial.println("Going to endless sleep, press RESET button or power off/on the device to wake up");
139+
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_TIMER);
140+
esp_deep_sleep_start();
137141
}
138142
}
139143
}

0 commit comments

Comments
 (0)