Update templating.markdown (#5085)

This commit is contained in:
mountainsandcode 2018-04-04 20:53:54 +02:00 committed by Franck Nijhof
parent 66714881d7
commit 4a1255889f

View File

@ -86,6 +86,10 @@ Home Assistant adds extensions to allow templates to access all of the current s
- Filter `timestamp_custom(format_string, local_boolean)` will convert an UNIX timestamp to a custom format, the use of a local timestamp is default, supporting [Python format options](https://docs.python.org/3/library/time.html#time.strftime). - Filter `timestamp_custom(format_string, local_boolean)` will convert an UNIX timestamp to a custom format, the use of a local timestamp is default, supporting [Python format options](https://docs.python.org/3/library/time.html#time.strftime).
- Filter `max` will obtain the largest item in a sequence. - Filter `max` will obtain the largest item in a sequence.
- Filter `min` will obtain the smallest item in a sequence. - Filter `min` will obtain the smallest item in a sequence.
- Filter `regex_match(string, find, ignorecase=FALSE)` will match the find expression at the beginning of the string using regex.
- Filter `regex_search(string, find, ignorecase=FALSE)` will match the find expression anywhere in the string using regex.
- Filter `regex_replace(string, find='', replace='', ignorecase=False)` will replace the find expression with the replace string using regex.
- Filter `regex_findall_index(string, find='', index=0, ignorecase=False)` will find all regex matches of find in string and return the match at index (findall returns an array of matches).
[strp-format]: https://docs.python.org/3.6/library/datetime.html#strftime-and-strptime-behavior [strp-format]: https://docs.python.org/3.6/library/datetime.html#strftime-and-strptime-behavior