-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new filters for templates #18125
Conversation
Added base64_encode, base64_decode and ordinal filters.
added test cases for base64_encode, base64_decode and ordinal filters.
use case? |
The The base64_encode and decode are used for the curl command that expects header variables in base64 encoded format. Without this, there is no way to pass base64 encoded variables using templates. 😄 |
We don't have a curl command? |
We don't have |
I don't find that a good reason to add base64 to our templating engine. People can have their shell command call a script that does the encoding? I'm a bit scared of turning our template engine into a data preparation tool for all possible CLIs out there. |
Base64 could be fine, because it's hard to do this with shell scripts and make rest_command more powerful but the other one for |
I added the However, addition of base64 en/decoding would be very useful and currently there is no clean way of implementing that effectively when using the services like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be merged when docs added
Description:
Added base64 encode, base64 decode and ordinal filters for templates.
Related issue (if applicable): fixes #
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices: