(Founder Home Assistant here)
Everything that you can do in YAML + more, you can do in Home Assistant using Python. Have a look at my PyCon talk [1] from 2 years ago or check the available functions in the docs [2].
About the dashes. In Home Assistant when an option takes a list, you can omit the list if you are just passing in a single entry.
[1]: https://youtu.be/Cfasc9EgbMU?t=1038 [2]: https://dev-docs.home-assistant.io/en/master/api/event.html