dashboard: split dashboard web server code into its own module (#5770)

This commit is contained in:
J. Nick Koston 2023-11-15 15:34:09 -06:00 committed by GitHub
parent 4ce627b4ee
commit c795dbde26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1091 additions and 1068 deletions

View file

@ -514,7 +514,7 @@ def command_clean(args, config):
def command_dashboard(args): def command_dashboard(args):
from esphome.dashboard import dashboard from esphome.dashboard import dashboard
return dashboard.start_web_server(args) return dashboard.start_dashboard(args)
def command_update_all(args): def command_update_all(args):

File diff suppressed because it is too large Load diff

View file

@ -29,15 +29,15 @@ class DashboardSettings:
] = {} ] = {}
def parse_args(self, args): def parse_args(self, args):
self.on_ha_addon = args.ha_addon self.on_ha_addon: bool = args.ha_addon
password = args.password or os.getenv("PASSWORD", "") password: str = args.password or os.getenv("PASSWORD", "")
if not self.on_ha_addon: if not self.on_ha_addon:
self.username = args.username or os.getenv("USERNAME", "") self.username: str = args.username or os.getenv("USERNAME", "")
self.using_password = bool(password) self.using_password = bool(password)
if self.using_password: if self.using_password:
self.password_hash = password_hash(password) self.password_hash = password_hash(password)
self.config_dir = args.configuration self.config_dir: str = args.configuration
self.absolute_config_dir = Path(self.config_dir).resolve() self.absolute_config_dir: Path = Path(self.config_dir).resolve()
CORE.config_path = os.path.join(self.config_dir, ".") CORE.config_path = os.path.join(self.config_dir, ".")
@property @property

File diff suppressed because it is too large Load diff