mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-09-30 04:37:44 +02:00
Fix abundant apostrophes (#1137)
This commit is contained in:
parent
ae6066a4f6
commit
4c26033ef0
@ -202,12 +202,12 @@ or just ``|`` or ``>``. There's a slight difference in how these different style
|
|||||||
purposes we can ignore that).
|
purposes we can ignore that).
|
||||||
|
|
||||||
With ``if (...) { ... } else { ... }`` we create a *condition*. What this effectively says that if the thing inside
|
With ``if (...) { ... } else { ... }`` we create a *condition*. What this effectively says that if the thing inside
|
||||||
the first parentheses evaluates to ``true``` then execute the first block (in this case ``return COVER_OPEN;``,
|
the first parentheses evaluates to ``true`` then execute the first block (in this case ``return COVER_OPEN;``,
|
||||||
or else evaluate the second block. ``return ...;`` makes the code block give back a value to the template. In this case,
|
or else evaluate the second block. ``return ...;`` makes the code block give back a value to the template. In this case,
|
||||||
we're either *returning* ``COVER_OPEN`` or ``COVER_CLOSED`` to indicate that the cover is closed or open.
|
we're either *returning* ``COVER_OPEN`` or ``COVER_CLOSED`` to indicate that the cover is closed or open.
|
||||||
|
|
||||||
Finally, ``id(...)`` is a helper function that makes ESPHome fetch an object with the supplied ID (which you defined
|
Finally, ``id(...)`` is a helper function that makes ESPHome fetch an object with the supplied ID (which you defined
|
||||||
somewhere else, like ``top_end_stop```) and lets you call any of ESPHome's many APIs directly. For example, here
|
somewhere else, like ``top_end_stop``) and lets you call any of ESPHome's many APIs directly. For example, here
|
||||||
we're retrieving the current state of the end stop using ``.state`` and using it to construct our cover state.
|
we're retrieving the current state of the end stop using ``.state`` and using it to construct our cover state.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
Loading…
Reference in New Issue
Block a user