From d9a63716794afa04be24d0cf295a9e00aa62ccbb Mon Sep 17 00:00:00 2001 From: Poltorak Serguei Date: Tue, 29 Mar 2022 14:00:35 +0300 Subject: [PATCH] Improved Add Sreen of the Z-WAve.Me intergration (#68568) --- homeassistant/components/zwave_me/config_flow.py | 8 ++++++++ homeassistant/components/zwave_me/strings.json | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/zwave_me/config_flow.py b/homeassistant/components/zwave_me/config_flow.py index a4b257bdab5..4fee380ca48 100644 --- a/homeassistant/components/zwave_me/config_flow.py +++ b/homeassistant/components/zwave_me/config_flow.py @@ -26,6 +26,13 @@ class ZWaveMeConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): async def async_step_user(self, user_input=None): """Handle a flow initialized by the user or started with zeroconf.""" errors = {} + placeholders = { + "local_token": "/112f7a4a-0051-cc2b-3b61-1898181b9950", + "find_token": "0481effe8a5c6f757b455babb678dc0e764feae279/112f7a4a-0051-cc2b-3b61-1898181b9950", + "local_url": "192.168.1.39:8083", + "find_url": "wss://find.z-wave.me", + "remote_url": "wss://87.250.250.242:8083", + } if self.url is None: schema = vol.Schema( { @@ -64,6 +71,7 @@ class ZWaveMeConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return self.async_show_form( step_id="user", + description_placeholders=placeholders, data_schema=schema, errors=errors, ) diff --git a/homeassistant/components/zwave_me/strings.json b/homeassistant/components/zwave_me/strings.json index 4986de744c0..00c57bfeec7 100644 --- a/homeassistant/components/zwave_me/strings.json +++ b/homeassistant/components/zwave_me/strings.json @@ -2,10 +2,10 @@ "config": { "step": { "user": { - "description": "Input IP address of Z-Way server and Z-Way access token. IP address can be prefixed with wss:// if HTTPS should be used instead of HTTP. To get the token go to the Z-Way user interface > Menu > Settings > User > API token. It is suggested to create a new user for Home Assistant and grant access to devices you need to control from Home Assistant. It is also possible to use remote access via find.z-wave.me to connect a remote Z-Way. Input wss://find.z-wave.me in IP field and copy the token with Global scope (log-in to Z-Way via find.z-wave.me for this).", + "description": "Input IP address with port and access token of Z-Way server. To get the token go to the Z-Way user interface Smart Home UI > Menu > Settings > Users > Administrator > API token.\n\nExample of connecting to Z-Way in the local network:\nURL: {local_url}\nToken: {local_token}\n\nExample of connecting to Z-Way via remote access find.z-wave.me:\nURL: {find_url}\nToken: {find_token}\n\nExample of connecting to Z-Way with a static public IP address:\nURL: {remote_url}\nToken: {local_token}\n\nWhen connecting via find.z-wave.me you need to use a token with a global scope (log-in to Z-Way via find.z-wave.me for this).", "data": { "url": "[%key:common::config_flow::data::url%]", - "token": "Token" + "token": "[%key:common::config_flow::data::api_token%]" } } },