From 2042c413c7665ebb1b3163cdb1182d868611b3f6 Mon Sep 17 00:00:00 2001
From: "Edgar P. Burkhart" <git@edgarpierre.fr>
Date: Sun, 9 Mar 2025 11:27:57 +0100
Subject: [PATCH] Fix config file installation path in PKGBUILD and update main
 application to load config from new path

---
 PKGBUILD           | 2 +-
 hasspy/__main__.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/PKGBUILD b/PKGBUILD
index 2453f1b..2f1bf0c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -53,6 +53,6 @@ package() {
 	cd "$srcdir/${pkgname%-git}"
 
 	python -m installer --destdir="${pkgdir}" dist/*.whl
-	install -Dm644 config.example.toml "${pkgdir}/etc/${pkgname}/config.toml"
+	install -Dm644 config.example.toml "${pkgdir}/etc/${pkgname%-git}/config.toml"
 	install -Dm644 ${pkgname%-git}.service "${pkgdir}/usr/lib/systemd/system/${pkgname%-git}.service"
 }
diff --git a/hasspy/__main__.py b/hasspy/__main__.py
index bebb1c5..688d500 100644
--- a/hasspy/__main__.py
+++ b/hasspy/__main__.py
@@ -7,7 +7,7 @@ from hasspy.mqtt import HassClient
 def main() -> None:
     logging.basicConfig(level=logging.INFO)
 
-    with open("/etc/config.toml", "rb") as file:
+    with open("/etc/hasspy/config.toml", "rb") as file:
         config = tomllib.load(file)
 
     ha = HassClient(