mirror of
https://github.com/esphome/esphome.git
synced 2025-09-09 23:02:23 +01:00
@@ -3,6 +3,7 @@ from __future__ import print_function
|
||||
import collections
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -207,3 +208,16 @@ class OrderedDict(collections.OrderedDict):
|
||||
root[1] = first[0] = link
|
||||
else:
|
||||
super(OrderedDict, self).move_to_end(key, last=last) # pylint: disable=no-member
|
||||
|
||||
|
||||
def list_yaml_files(folder):
|
||||
files = filter_yaml_files([os.path.join(folder, p) for p in os.listdir(folder)])
|
||||
files.sort()
|
||||
return files
|
||||
|
||||
|
||||
def filter_yaml_files(files):
|
||||
files = [f for f in files if os.path.splitext(f)[1] == '.yaml']
|
||||
files = [f for f in files if os.path.basename(f) != 'secrets.yaml']
|
||||
files = [f for f in files if not os.path.basename(f).startswith('.')]
|
||||
return files
|
||||
|
Reference in New Issue
Block a user