1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-09 23:02:23 +01:00

Dashboard Update all button (#615)

* Add update all button

* Use bold
This commit is contained in:
Otto Winter
2019-06-07 14:26:28 +02:00
committed by GitHub
parent 4fe0c95ccb
commit 7a895adec9
8 changed files with 128 additions and 27 deletions

View File

@@ -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