Skip to content

Commit

Permalink
Prettier changes
Browse files Browse the repository at this point in the history
  • Loading branch information
xx4h committed Sep 30, 2024
1 parent 8a741e4 commit da17acb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
push:
branches: main

permissions: { }
permissions: {}

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: main

permissions: { }
permissions: {}

jobs:
build:
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# hctl

hctl is a tool to control your Home Assistant (and maybe more in the future) devices from the command line

## Features
Expand All @@ -13,30 +14,38 @@ hctl is a tool to control your Home Assistant (and maybe more in the future) dev
## Install

### Go

```bash
go install github.com/xx4h/hctl@latest
```

## Configuration

Run the init command

```bash
hctl init
```

or copy the example config from this project

```bash
# Configure Hub
hub:
type: hass
url: https://home-assistant.example.com/api
token: YourToken
```

ensure the folder does already exist and edit with your favorite editor

```bash
mkdir -p ~/.config/hctl
$EDITOR ~/.config/hctl/hctl.yaml
```

To really benefit from all features, ensure you've loaded the bash completion

```bash
# Bash (e.g. your ~/.bashrc)
type hctl >/dev/null 2>&1 && source <(hctl completion bash)
Expand All @@ -54,7 +63,9 @@ hctl toggle some_switch
```

### Completion Short Names

Home Assistant names its entities `domain.name`, like `light.some_light`.

```bash
# Imagine having the following devices/entities
light.livingroom_main
Expand All @@ -73,13 +84,14 @@ hctl off li<TAB>
hclt off light.<TAB><TAB>
light.livingroom_main light.livingroom_corner light.livingroom_other
```

Completion Short Names can be disabled with:

```bash
completion:
short_names: false
```


### Fuzzy Matching

```bash
Expand All @@ -92,8 +104,10 @@ switch.livingroom_warp
# Turn on device with fuzzy matching (matching "switch.livingroom_warp")
hctl on lw
```

Fuzzy Matching is enabled by default.
Fuzzy Matching can be turned off in the config with:

```bash
handling:
fuzz: false
Expand Down

0 comments on commit da17acb

Please sign in to comment.