Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add restore state from flash option #181

Merged
merged 2 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions components/esphome.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 2 additions & 0 deletions components/switch/gpio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down