mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-25 17:17:54 +01:00
Add note explaining what to do in set_action (#2585)
Add note explaining what to do in set_action to update the state of the component.
This commit is contained in:
parent
bc0c9aa286
commit
7697877195
@ -45,6 +45,10 @@ Configuration variables:
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- All other options from :ref:`Select <config-select>`.
|
||||
|
||||
.. note::
|
||||
|
||||
If you don't set a ``lambda`` and ``optimistic`` is ``false`` (default), updates to the select component state will need to be taken care of as part of your ``set_action`` using ``id(my_select).publish_state(x);`` (in a lambda). Do not use :ref:`select-set_action` here, as this would generate a loop. Also, don't use ``id(my_select).state = x`` as this won't have the desired effect (e.g. HA won't update with the change).
|
||||
|
||||
``select.set`` Action
|
||||
---------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user