restore_mode (Optional): Control how the light attempts to restore state on bootup. For restoring on ESP8266s, also see esp8266_restore_from_flash in the esphome section.
RESTORE_DEFAULT_OFF (Default) - Attempt to restore state and default to OFF if not possible to restore.
RESTORE_DEFAULT_ON - Attempt to restore state and default to ON.
RESTORE_INVERTED_OFF - Attempt to restore state inverted from the previous state and default to OFF.
RESTORE_INVERTED_ON - Attempt to restore state inverted from the previous state and default to ON.
ALWAYS_OFF - Always initialize the light as OFF on bootup.
ALWAYS_ON - Always initialize the light as ON on bootup.
你都已经把答案贴出来了呀……配合restore from flash,当然你要不心疼flash芯片,这东西写入次数是有限的,手头备上几个模块或flash芯片并且会焊接更好。
~~~~~~~~~~
补充:赞同10楼朋友的观点,flash芯片的寿命其实足够长了,10万次写入也是一个很普通的指标,完全不用担心。不要被我上面那句话吓到