setDescription:
The set executor is used to set a named state to a specific value.
Parent: execute, then, else
Value (simple form): string specifying the name of the state Value (key/value form):
set: string, required, specifying state namevalue: any, optional, specifying the new value of the state (default: null, which clears the state)# simple form
- set: (string)
# simple example
- set: alreadyConfirmed
# key/value form
- set: (string, required)
value: (any, optional)
# key/value example
- set: alreadyConfirmed
value: true
EXAMPLE:
- triggers:
- my favorite {thing} is {what}
execute:
- set: 'favorite.{thing}'
value: '{what}'
- display: "Setting your favorite {thing} to {what}"
- speak: "Setting your favorite {thing} to {what}"
- triggers:
- what is my favorite {thing}
execute:
- display: "Your favorite {thing} is {favorite.{thing}}"
- speak: "Your favorite {thing} is {favorite.{thing}}"
- triggers:
- is {what} my favorite {thing}
- is my favorite {thing} {what}
execute:
- if:
- set: 'favorite.{thing}'
value: '{what}'
then:
- display: "Yes, '{what}' is your favorite '{thing}'"
- speak: "Yes, '{what}' is your favorite '{thing}'"
else:
- display: "No, '{what}' is not your favorite '{thing}'"
- speak: "No, '{what}' is not your favorite '{thing}'"
Status: ✅ IMPLEMENTED
…
!! need to update this to match new “set” executor !!