Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save willwhui/78a3d3a8d74f5cdb5417956832801dde to your computer and use it in GitHub Desktop.
Save willwhui/78a3d3a8d74f5cdb5417956832801dde to your computer and use it in GitHub Desktop.
在hass的.yaml文件中使用随机字符串
@willwhui
Copy link
Author

willwhui commented Nov 8, 2017

以下做法本来准备用在tts到google_say的地方,结果并没有成功

参考: https://home-assistant.io/components/alexa/ 中提到的alexa_confirm.yaml部分,使用template
具体做法:
yaml中引用一个文件:

text: !include my-text.yaml

这个文件的内容如下:

# my-text.yaml
>
{{ [
"OK",
"Sure",
"If you insist",
"Done",
"No worries",
"I can do that",
"Leave it to me",
"Consider it done",
"As you wish",
"By your command",
"Affirmative",
"Yes oh revered one",
"I will",
"As you decree, so shall it be",
"No Problem"
] | random }} 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment