mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 06:33:51 +00:00 
			
		
		
		
	Allow specifying the dashboard bind address (#2787)
This commit is contained in:
		| @@ -637,6 +637,12 @@ def parse_args(argv): | ||||
|         type=int, | ||||
|         default=6052, | ||||
|     ) | ||||
|     parser_dashboard.add_argument( | ||||
|         "--address", | ||||
|         help="The address to bind to.", | ||||
|         type=str, | ||||
|         default="0.0.0.0", | ||||
|     ) | ||||
|     parser_dashboard.add_argument( | ||||
|         "--username", | ||||
|         help="The optional username to require for authentication.", | ||||
|   | ||||
| @@ -970,16 +970,17 @@ def start_web_server(args): | ||||
|         server.add_socket(socket) | ||||
|     else: | ||||
|         _LOGGER.info( | ||||
|             "Starting dashboard web server on http://0.0.0.0:%s and configuration dir %s...", | ||||
|             "Starting dashboard web server on http://%s:%s and configuration dir %s...", | ||||
|             args.address, | ||||
|             args.port, | ||||
|             settings.config_dir, | ||||
|         ) | ||||
|         app.listen(args.port) | ||||
|         app.listen(args.port, args.address) | ||||
|  | ||||
|         if args.open_ui: | ||||
|             import webbrowser | ||||
|  | ||||
|             webbrowser.open(f"localhost:{args.port}") | ||||
|             webbrowser.open(f"http://{args.address}:{args.port}") | ||||
|  | ||||
|     if settings.status_use_ping: | ||||
|         status_thread = PingStatusThread() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user