Send secret into script (not application) #661
Unanswered
Nikolay-Ch
asked this question in
Q&A
Replies: 1 comment
-
secret1: "this is a secret!" pyscript allow_all_imports: true
hass_is_global: true
secrets:
secret1: !secret secret1 a separate pyscript def SECRET(value):
# noinspection PyUnresolvedReferences
return pyscript.config.get('secrets', {}).get(value)
# and if you want
SECRET_1 = SECRET('secret1') pyscript from secrets import SECRET_1
# or
from secrets import SECRET
SECRET_1 = SECRET('secret1')
#or just
SECRET_1 = pyscript.config.get('secrets', {}).get('secret') |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
How I can send some secret from secrets.yaml into script (not application)?
In documentation I found this:
But for single script this solution not worked.
Beta Was this translation helpful? Give feedback.
All reactions