From b4142fc7ee4d45ff0271afbafa8d09efae38d42c Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Sun, 10 May 2020 12:10:09 +0200 Subject: [PATCH] Add const module to oauth2 scaffold template (#35438) * Add const module to oauth2 template * Remove const append * Add domain to const --- script/scaffold/generate.py | 9 --------- .../templates/config_flow_oauth2/integration/const.py | 7 +++++++ 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 script/scaffold/templates/config_flow_oauth2/integration/const.py diff --git a/script/scaffold/generate.py b/script/scaffold/generate.py index 93f5db58587..292ae86e3a9 100644 --- a/script/scaffold/generate.py +++ b/script/scaffold/generate.py @@ -171,12 +171,3 @@ def _custom_tasks(template, info) -> None: }, }, ) - _append( - info.integration_dir / "const.py", - """ - -# TODO Update with your own urls -OAUTH2_AUTHORIZE = "https://www.example.com/auth/authorize" -OAUTH2_TOKEN = "https://www.example.com/auth/token" -""", - ) diff --git a/script/scaffold/templates/config_flow_oauth2/integration/const.py b/script/scaffold/templates/config_flow_oauth2/integration/const.py new file mode 100644 index 00000000000..7255de72d84 --- /dev/null +++ b/script/scaffold/templates/config_flow_oauth2/integration/const.py @@ -0,0 +1,7 @@ +"""Constants for the NEW_NAME integration.""" + +DOMAIN = "NEW_DOMAIN" + +# TODO Update with your own urls +OAUTH2_AUTHORIZE = "https://www.example.com/auth/authorize" +OAUTH2_TOKEN = "https://www.example.com/auth/token"