summaryrefslogtreecommitdiff
path: root/py_include/homekit/mqtt/_util.py
blob: 390d463b00a46274b314884767132eec2074084d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os
import re

from typing import List


def get_modules() -> List[str]:
    modules = []
    modules_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'module')
    for name in os.listdir(modules_dir):
        if os.path.isdir(os.path.join(modules_dir, name)):
            continue
        name = re.sub(r'\.py$', '', name)
        modules.append(name)
    return modules