Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,22 @@
### 1.1. Requirements

- Raspberry Pi (ARM64)
- Python 3.8+

You should access the Raspberry Pi (ARM64) to run the following commands.

### 1.2. Run using Docker
### 1.2. Install

```sh
curl -fsSL https://raw.githubusercontent.com/jyje/pifanctl/main/install.sh -o install-pifanctl.sh
chmod +x install-pifanctl.sh
./install-pifanctl.sh
rm install-pifanctl.sh
```

After installation, you can use the following command to control the fan, `pifanctl --help`

### 1.3. Run using Docker
```sh
docker run -it ghcr.io/jyje/pifanctl:latest python main.py --help
```
Expand All @@ -45,7 +57,7 @@ Currently, `--privileged` is required to access and control the GPIO pins.
We will try to find a better solution in the future.


### 1.3. Run using Source Code
### 1.4. Run using Source Code
```sh
git clone https://github.com/jyje/pifanctl ~/.pifanctl
cd ~/.pifanctl/sources
Expand Down
10 changes: 8 additions & 2 deletions sources/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def get_usage(self, ctx: typer.Context) -> str:
context_settings = {"help_option_names": ["-h", "--help"]},
help = """
🥧 pifanctl: A CLI for PWM Fan Controlling of Raspberry Pi
\n
\nProject Page: https://github.com/jyje/pifanctl

Project Page: https://github.com/jyje/pifanctl
"""
)

Expand Down Expand Up @@ -104,13 +104,15 @@ def common_callback(


@app.command(
cls = TyperGroup,
help = "Show current status"
)
def status(ctx: typer.Context):
router.status(state)


@app.command(
cls = TyperGroup,
help = "Start fan control"
)
def start(
Expand Down Expand Up @@ -178,27 +180,31 @@ def start(


@app.command(
cls = TyperGroup,
help = "Stop fan control"
)
def stop(ctx: typer.Context):
router.stop(state)


@app.command(
cls = TyperGroup,
help = "Set and enable fan control in system service"
)
def enable(ctx: typer.Context):
router.enable(state)


@app.command(
cls = TyperGroup,
help = "Disable fan control from system service"
)
def disable(ctx: typer.Context):
router.disable(state)


@app.command(
cls = TyperGroup,
help = "Manage a configuration of fan control"
)
def config(ctx: typer.Context):
Expand Down