Add restore state from flash option (#181)

* Add restore state from flash option

* Add reference
This commit is contained in:
Otto Winter 2019-02-26 16:55:46 +01:00 committed by GitHub
parent b21583682d
commit d9544012c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -51,8 +51,15 @@ Advanced options:
is in.
- **libraries** (*Optional*, list of libraries): A list of `platformio libraries <https://platformio.org/lib>`__
to include in the project. See `platformio lib install <https://docs.platformio.org/en/latest/userguide/lib/cmd_install.html>`__.
ESP8266 Options:
- **board_flash_mode** (*Optional*, string): The `SPI flash mode <https://github.com/espressif/esptool/wiki/SPI-Flash-Modes>`__
to use for the board. One of ``qio``, ``qout``, ``dio`` and ``dout``. Defaults to ``dout``.
- **esp8266_restore_from_flash** (*Optional*, boolean): Whether to save & restore data from flash so
that the device state can be restored across power cycles. Keep in mind that this will slowly
wear out the flash (so if you have automations that repeatedly toggle a component do not use this
option (flash usually supports 100 000 write cycles). Defaults to ``no``.
Automations:

View File

@ -29,6 +29,8 @@ Configuration variables:
- **name** (**Required**, string): The name for the switch.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **restore_mode** (*Optional*): Control how the GPIO Switch attempts to restore state on bootup.
For restoring on ESP8266s, also see ``esp8266_restore_from_flash`` in the
:doc:`esphome section </components/esphome>`.
- ``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.