@quentinsf wrote:
I’m delighted to see that scripts can take parameters using the ‘fields’ clause. Each parameter can be given a description and an example value.
It would be very nice to set defaults for the parameter values there, too, I think. At present you can handle defaults to some degree with a Jinja filter. Here’s my little trial script:
parameter_test: alias: Parameter test fields: number: description: The number to go in the message example: 123 sequence: - service: notify.mobile_app_my_iphone data_template: title: "Life, the Universe and Everything" message: "The answer is {{ number|default('42') }}"
But if you use the parameter in multiple places, you get duplication, and I think it would be tidier anyway to be able to do this:
fields: number: description: The number to go in the message example: 123 default: 42
Should I dig in and see if I can implement this? Is there a better solution?
Posts: 1
Participants: 1