diff --git a/README.md b/README.md index 1e316a6..06efdc1 100644 --- a/README.md +++ b/README.md @@ -66,9 +66,9 @@ print(device.switch) ### CLI Interface (WIP) - If you have all the needed env vars loaded you can use the env related options - - If not, just use the cli arg based approach + - If not, just use the cli arg based approach, this should be installed system wide ```bash -python3 -m hubitatcontrol print-devices-env +hubitatcontrol print-devices-env ``` ## Docs diff --git a/hubitatcontrol/__main__.py b/hubitatcontrol/__main__.py index 8401a6f..ded6c73 100644 --- a/hubitatcontrol/__main__.py +++ b/hubitatcontrol/__main__.py @@ -1,11 +1,22 @@ +import rich.errors import typer from hubitatcontrol import get_hub +from importlib import metadata -app = typer.Typer(no_args_is_help=True) +version = metadata.version("hubitatcontrol") + +app = typer.Typer( + no_args_is_help=True, + help='Hubitat Control CLI Interface', + epilog=f'Version: {version} \n Project: https://github.com/Jelloeater/hubitatcontrol', +) @app.command() def print_devices_env(): + """ + Loads .env file at current location and prints current devices + """ import os from dotenv import load_dotenv @@ -21,6 +32,9 @@ def print_devices_env(): @app.command() def print_devices_cli(host_env, token_env, app_id_env: int, cloud_token_env=typer.Argument(None)): + """ + Prints current devices from CLI input + """ h = get_hub(host=host_env, token=token_env, app_id=app_id_env, cloud_token=cloud_token_env) print_device_list_types(h) diff --git a/pyproject.toml b/pyproject.toml index 3dad819..d564132 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hubitatcontrol" -version = "1.1.1" +version = "1.1.2" description = "Hubitat Maker API Interface" authors = ["Jesse Schoepfer "] license = "MIT License" @@ -14,6 +14,9 @@ classifiers = ["Development Status :: 5 - Production/Stable", "Operating System :: OS Independent", ] +[tool.poetry.scripts] +hubitatcontrol = "hubitatcontrol.__main__:app" + [tool.poetry.dependencies] python = "^3.10"