Skip to content

Commit

Permalink
fix completion message for turn cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
neroist committed Mar 13, 2024
1 parent 496d24b commit 609a795
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands/turn.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ func toggle*(str: string): string =
elif str == "off": "on"
else: str

# TODO accept bool instead of string for `state`
proc turn*(device: int = 0; state: string = ""; toggle = false, output = on, all: bool = false): string =
## Turn device on or off

Expand Down Expand Up @@ -57,7 +58,7 @@ proc turn*(device: int = 0; state: string = ""; toggle = false, output = on, all
let re = put(ControlURI, @{"Govee-API-Key": apiKey, "Content-Type": "application/json"}, $body)

if output:
echo "Set device power state to \'", state, "\'"
echo &"Set device {device} power state to \'", state, "\'"
echo ""

sendCompletionMsg re.code, parseJson(re.body)["message"], HttpCode(re.code)
Expand Down

0 comments on commit 609a795

Please sign in to comment.