Skip to content

Commit 68c86dc

Browse files
committed
[Update help output (fixes #173)
See python/mypy#3869
1 parent 8bf2b3b commit 68c86dc

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

homeassistant_cli/cli.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def get_command(
9696

9797

9898
def _default_token() -> Optional[str]:
99+
"""Handle the token provided as env variable."""
99100
return os.environ.get('HASS_TOKEN', os.environ.get('HASSIO_TOKEN', None))
100101

101102

@@ -105,21 +106,30 @@ def _default_token() -> Optional[str]:
105106
@click.option(
106107
'--server',
107108
'-s',
108-
help='The server URL or `auto` for automatic detection',
109+
help=(
110+
'The server URL or `auto` for automatic detection. Can also be set '
111+
'with he environment variable HASS_SERVER.'
112+
),
109113
default="auto",
110114
show_default=True,
111115
envvar='HASS_SERVER',
112116
)
113117
@click.option(
114118
'--token',
115119
default=_default_token,
116-
help='The Bearer token for Home Assistant instance.',
120+
help=(
121+
'The Bearer token for Home Assistant instance. Can also be set with '
122+
'the environment variable HASS_TOKEN.'
123+
),
117124
envvar='HASS_TOKEN',
118125
)
119126
@click.option(
120127
'--password',
121-
default=None, # type: ignore
122-
help='The API password for Home Assistant instance.',
128+
default=None,
129+
help=(
130+
'The API password for Home Assistant instance. Can also be set with '
131+
'the environment variable HASS_PASSWORD.'
132+
),
123133
envvar='HASS_PASSWORD',
124134
)
125135
@click.option(
@@ -212,7 +222,7 @@ def cli(
212222
no_headers: bool,
213223
table_format: str,
214224
sort_by: Optional[str],
215-
):
225+
) -> None:
216226
"""Command line interface for Home Assistant."""
217227
ctx.verbose = verbose
218228
ctx.server = server

0 commit comments

Comments
 (0)