Add restore state option to template switch

This commit is contained in:
Otto Winter 2018-11-09 19:50:26 +01:00
parent ddb6105763
commit fbf1e039e8
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E

View File

@ -46,14 +46,11 @@ Configuration variables:
be performed when the remote (like Home Assistant's frontend) requests the switch to be turned on.
- **turn_off_action** (*Optional*, :ref:`Action <config-action>`): The action that should
be performed when the remote (like Home Assistant's frontend) requests the switch to be turned on.
- **restore_state** (*Optional*, boolean): Sets whether esphomelib should attempt to restore the
state on boot-up and call the turn on/off actions with the recovered values. Defaults to ``yes``.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Binary Sensor <config-binary_sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
.. note::
esphomelib will automatically try to restore the last state from flash on boot, it will then also call
the turn on/off actions for you.
See Also
--------