diff options
Diffstat (limited to 'include/py/homekit/util.py')
-rw-r--r-- | include/py/homekit/util.py | 9 |
1 files changed, 8 insertions, 1 deletions
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) + ) |