summaryrefslogtreecommitdiff
path: root/include/py
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2023-09-13 09:34:49 +0300
committerEvgeny Zinoviev <me@ch1p.io>2023-09-13 09:34:49 +0300
commit405a17a9fdd420faa7af90f769e72eb21fda73ce (patch)
treea9617d83412066f05dccb1d935c02ecfd3eed66d /include/py
parent44aad914a3cea1b6e39cf5db7bebeafb59191707 (diff)
save
Diffstat (limited to 'include/py')
-rw-r--r--include/py/homekit/config/config.py2
-rw-r--r--include/py/homekit/util.py9
2 files changed, 8 insertions, 3 deletions
diff --git a/include/py/homekit/config/config.py b/include/py/homekit/config/config.py
index 773de1e..7d30a77 100644
--- a/include/py/homekit/config/config.py
+++ b/include/py/homekit/config/config.py
@@ -277,9 +277,7 @@ class Config:
and not isinstance(name, bool) \
and issubclass(name, AppConfigUnit) or name == AppConfigUnit:
self.app_name = name.NAME
- print(self.app_config)
self.app_config = name()
- print(self.app_config)
app_config = self.app_config
else:
self.app_name = name if isinstance(name, str) else None
diff --git a/include/py/homekit/util.py b/include/py/homekit/util.py
index 22bba86..2680c37 100644
--- a/include/py/homekit/util.py
+++ b/include/py/homekit/util.py
@@ -9,6 +9,7 @@ import logging
import string
import random
import re
+import os
from enum import Enum
from datetime import datetime
@@ -252,4 +253,10 @@ def next_tick_gen(freq):
t = time.time()
while True:
t += freq
- yield max(t - time.time(), 0) \ No newline at end of file
+ yield max(t - time.time(), 0)
+
+
+def homekit_path(*args) -> str:
+ return os.path.realpath(
+ os.path.join(os.path.dirname(__file__), '..', '..', '..', *args)
+ )