Skip to content

Commit

Permalink
Readme for set default command
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsNoahEvans committed Nov 30, 2023
1 parent 0fab0da commit 9a1bcfd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
38 changes: 32 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,40 @@ ID |Type |Name |Colour |Power |Mode |Speed |Vertical |Ho
12345 |20 |DUUX.1.108725 |Black |On |Natural |10 |1 |1 |6 hours |[DEVICE_MAC]
```

### `setdefault`
**Set a default fan, to be assumed for all future commands.**

This will list all the fans on your account (similar to `getfans`), and ask for an ID to be used as the default fan.

For all future commands, you will not have to specify a fan ID. For example, `power on` will suffice.

#### Usage
`setdefault`

#### Arguments
None.

#### Example
```
$ ./duux setdefault
Getting sensors...
ID |Type |Name |Colour |Power |Mode |Speed |Vertical |Horizontal |Timer |MAC Address
12345 |20 |DUUX.1.108725 |Black |On |Natural |10 |1 |1 |6 hours |[DEVICE_MAC]
Enter the ID of the fan you want to set as default:
12345
Successfully set default fan!
```

### `getschedule`
**Get all the schedules set for your device.**

#### Usage
`getschedule <fan id>`

#### Arguments
- **Fan ID**: the ID of the fan to control, obtained from `getfans`
- **Fan ID**: the ID of the fan to control, obtained from `getfans`. _Not required if you have used `setdefault`._

#### Example
```
Expand Down Expand Up @@ -131,7 +157,7 @@ Schedule 239729:
`power <fan id> <on/off>`

#### Arguments
- **Fan ID**: the ID of the fan to control, obtained from `getfans`
- **Fan ID**: the ID of the fan to control, obtained from `getfans`. _Not required if you have used `setdefault`._
- **Power Action**: the power action to perform, `on` or `off`

#### Example
Expand All @@ -149,7 +175,7 @@ Successfully set power!
`speed <fan id> <speed, 1-26>`

#### Arguments
- **Fan ID**: the ID of the fan to control, obtained from `getfans`
- **Fan ID**: the ID of the fan to control, obtained from `getfans`. _Not required if you have used `setdefault`._`
- **Speed**: the speed to set the fan to, between 1 and 26

#### Example
Expand All @@ -167,7 +193,7 @@ Successfully set speed!
`mode <fan id> <normal/natural/night>`

#### Arguments
- **Fan ID**: the ID of the fan to control, obtained from `getfans`
- **Fan ID**: the ID of the fan to control, obtained from `getfans`. _Not required if you have used `setdefault`._
- **Air Mode**: the mode to set, either `normal`, `natural`, or `night`

#### Example
Expand All @@ -187,7 +213,7 @@ If your fan is not currently powered on, it will be before the timer is started.
`timer <fan id> <hours>`

#### Arguments
- **Fan ID**: the ID of the fan to control, obtained from `getfans`
- **Fan ID**: the ID of the fan to control, obtained from `getfans`. _Not required if you have used `setdefault`._
- **Hours**: how many hours, from now, for the fan to remain on for

#### Example
Expand All @@ -207,7 +233,7 @@ Successfully set timer!
`oscillation <fan id> <vertical/horizontal> <on/off>`

#### Arguments
- **Fan ID**: the ID of the fan to control, obtained from `getfans`
- **Fan ID**: the ID of the fan to control, obtained from `getfans`. _Not required if you have used `setdefault`._
- **Direction**: which direction change, either `vertical` or `horizontal`
- **Action**: what to do with this mode, `on` or `off`

Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
"text/tabwriter"
)

// this key is basically useless, as it's hardcoded into the open source code...
// but some encryption is better than none
var encodedKey = "gM4NSmqvYb5ajCxsDwWz5W/+b+RM1LXs11e0zw4gwVY="
var encryptionKey []byte

Expand Down

0 comments on commit 9a1bcfd

Please sign in to comment.