summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2021-05-15 15:59:31 +0300
committerYuval Adam <_@yuv.al>2021-05-15 15:59:31 +0300
commit7d7c6e1698dc687cdb8b6e3c3e6db3a03bce1c9e (patch)
tree9c2e2e4a45867c107f14fdb76028331f69b51ee9
parent35b4f4d5da64d9b57a999bdd55f638925de463ef (diff)
Update DATA_DIR
-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):