This is my configuration for the Home Assistant platform.
Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. ~ Home Assistant
The philosophy I have taken with my project structure is similar Frenck's, in that I have modularised everything to the extent that each entity has its own file; thus creating a true separation of concerns.
This project uses pre-commit to format files in order to maintain consistency.
To get started:
-
Install
pre-commit
withbrew install pre-commit
. -
Check your
pre-commit
version to make sure it's installed correctly withpre-commit --version
-
Install the commit hook scripts with
pre-commit install
-
Commit your code!
N.B. You can run pre-commit
manually across all files with pre-commit run --all-files
There is a Github Actions CI pipeline that runs on pushes to the master
branch.
The pipeline will run all pre-commit
hooks for static analysis and to enforce consistency. It also runs the config against a dockerised version of Home Assistant to make sure none of the changes are incompatible.
If all the checks pass, the pipeline will rsync
the updated config and restart the server.
To perform a manual local deployment run ./scripts/sync-config.sh "$user" "$host" "$manualRestartWebhookURL"
. This requires your public ssh
key to be authorized by the server.