Skip to content

Commit

Permalink
Mention python3-dev dependency + systemd instructions (#33)
Browse files Browse the repository at this point in the history
* Mention python3-dev dependency

I stumbled upon this while not being a python developer, and the `pip` step was failing with an odd `psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory`. Google referred me to https://stackoverflow.com/a/21530768/102960, which did the trick.

* Add systemd instructions
  • Loading branch information
igorsantos07 authored Dec 25, 2024
1 parent f84f0a4 commit f3745c2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Application to run on Linux desktop computer to provide sensor data to Home Assi

### Requirements

Python 3.10+
Python 3.10+ and the related `dev` dependencies (usually `python3-dev` or `python3-devel` on your package manager)

### Instructions

Expand All @@ -23,8 +23,14 @@ Python 3.10+

1. Copy `config.example.json` to `config.json`.
1. Modify `config.json` to match your setup and desired options.
1. Run the application from the virtual environment: `python -m halinuxcompanion --config config.json`
- Alternatively set up a systemd service using the [provided unit file](halinuxcompanion/resources/halinuxcompanion.service)
1. Run the application, either from:
1. the virtual environment directly: `python -m halinuxcompanion --config config.json`. In this case, you'll need to run it again when you restart.
1. or setting up a systemd service (you may need `sudo` for most of the commands below):
1. Copy the sample unit file from `halinuxcompanion/resources/halinuxcompanion.service` to `/etc/systemd/system`
1. Modify it to match your setup - mainly, the installation paths at `WorkingDirectory` and `ExecStart`
1. Start it with `systemctl start halinuxcompanion`
1. You can check if it went well with `systemctl status halinuxcompanion`. If it errored, you can check logs with `journalctl -u halinuxcompanion`
1. If all went well, you can enable it permanently with `systemctl enable halinuxcompanion`

Now in your Home Assistant you will see a new device in the **"mobile_app"** integration, and there will be a new service to notify your Linux desktop. Notification actions work and the expected events will be fired in Home Assistant.

Expand Down

0 comments on commit f3745c2

Please sign in to comment.