You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/globals.rst
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
Global Variables
2
2
----------------
3
3
4
-
In some cases you might need to share a global variable across multiple lambdas. For example, global variables can be
4
+
In some cases you might need to share a global variable across multiple lambdas, or to remember between periods of deep_sleep. For example, global variables can be
5
5
used to store the state of a garage door.
6
6
7
7
.. code-block:: yaml
@@ -46,6 +46,8 @@ Configuration variables:
46
46
can not be restored or if state restoration is not enabled. This needs to be wrapped in quotes! Defaults to
47
47
the C++ default value for this type (for example ``0`` for integers).
48
48
49
+
Within lambdas globals don’t have a state attribute, just a value. Note in the example above the use of id(my_global_int) where other components would require id(my_component).state.
0 commit comments