summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alarmpy/alarmpy.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/alarmpy/alarmpy.py b/alarmpy/alarmpy.py
index 55f66c6..e7263f5 100644
--- a/alarmpy/alarmpy.py
+++ b/alarmpy/alarmpy.py
@@ -3,6 +3,7 @@ import json
import requests
from datetime import datetime
+from pathlib import Path
from time import sleep, time
@@ -42,7 +43,8 @@ class Alarm:
return requests.Session()
def load_labels(self):
- with open("labels.json", "r") as f:
+ DATA_DIR = Path(__file__).parent / "data"
+ with open(DATA_DIR / "labels.json", "r") as f:
return json.load(f)
def start(self):