mirror of
https://github.com/esphome/esphome.git
synced 2025-06-19 06:45:49 +01:00
Add Captive Portal (#624)
* WIP: Captive Portal * Updates * Updates * Lint * Fixes
This commit is contained in:
esphome
components
captive_portal
__init__.pycaptive_portal.cppcaptive_portal.hindex.htmllock.svgstylesheet.csswifi-strength-1.svgwifi-strength-2.svgwifi-strength-3.svgwifi-strength-4.svg
light
mqtt
ota
time
web_server
web_server_base
wifi
core
dashboard
wizard.pyscript
@ -30,7 +30,7 @@ EXECUTABLE_BIT = {
|
||||
files = [s[3].strip() for s in lines]
|
||||
files.sort()
|
||||
|
||||
file_types = ('.h', '.c', '.cpp', '.tcc', '.yaml', '.yml', '.ini', '.txt', '.ico',
|
||||
file_types = ('.h', '.c', '.cpp', '.tcc', '.yaml', '.yml', '.ini', '.txt', '.ico', '.svg',
|
||||
'.py', '.html', '.js', '.md', '.sh', '.css', '.proto', '.conf', '.cfg')
|
||||
cpp_include = ('*.h', '*.c', '*.cpp', '*.tcc')
|
||||
ignore_types = ('.ico',)
|
||||
@ -104,7 +104,7 @@ def lint_ino(fname):
|
||||
|
||||
@lint_file_check(exclude=['*{}'.format(f) for f in file_types] + [
|
||||
'.clang-*', '.dockerignore', '.editorconfig', '*.gitignore', 'LICENSE', 'pylintrc',
|
||||
'MANIFEST.in', 'docker/Dockerfile*', 'docker/rootfs/*', 'script/*'
|
||||
'MANIFEST.in', 'docker/Dockerfile*', 'docker/rootfs/*', 'script/*',
|
||||
])
|
||||
def lint_ext_check(fname):
|
||||
return "This file extension is not a registered file type. If this is an error, please " \
|
||||
@ -135,7 +135,7 @@ def lint_newline(fname):
|
||||
return "File contains windows newline. Please set your editor to unix newline mode."
|
||||
|
||||
|
||||
@lint_content_check()
|
||||
@lint_content_check(exclude=['*.svg'])
|
||||
def lint_end_newline(fname, content):
|
||||
if content and not content.endswith('\n'):
|
||||
return "File does not end with a newline, please add an empty line at the end of the file."
|
||||
@ -164,7 +164,8 @@ def relative_py_search_text(fname, content):
|
||||
return 'esphome.components.{}'.format(integration)
|
||||
|
||||
|
||||
@lint_content_find_check(relative_py_search_text, include=['esphome/components/*.py'])
|
||||
@lint_content_find_check(relative_py_search_text, include=['esphome/components/*.py'],
|
||||
exclude=['esphome/components/web_server/__init__.py'])
|
||||
def lint_relative_py_import(fname):
|
||||
return ("Component contains absolute import - Components must always use "
|
||||
"relative imports within the integration.\n"
|
||||
|
Reference in New Issue
Block a user