Improved Add Sreen of the Z-WAve.Me intergration (#68568)

This commit is contained in:
Poltorak Serguei 2022-03-29 14:00:35 +03:00 committed by GitHub
parent 80f34e5e2e
commit d9a6371679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -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,
)

View File

@ -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%]"
}
}
},