1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-15 15:18:16 +00:00

Merge f6083354681fdee7e0dc4e436bfeb6c305b48ab2 into bfa3254d6c5ab2f555196a3b4f8e245800d85724

This commit is contained in:
Dinghan Zhu 2025-02-23 16:20:47 -05:00 committed by GitHub
commit 89441aa1c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -919,7 +919,7 @@ def parse_args(argv):
"--port", "--port",
help="The HTTP port to open connections on. Defaults to 6052.", help="The HTTP port to open connections on. Defaults to 6052.",
type=int, type=int,
default=6052, default=os.environ.get("ESPHOME_DASHBOARD_PORT", 6052),
) )
parser_dashboard.add_argument( parser_dashboard.add_argument(
"--address", "--address",

View File

@ -35,14 +35,14 @@ class DashboardTestHelper:
return result return result
@pytest_asyncio.fixture() @pytest_asyncio.fixture(name="dashboard")
async def dashboard() -> DashboardTestHelper: async def fixture_dashboard() -> DashboardTestHelper:
sock, port = bind_unused_port() sock, port = bind_unused_port()
args = Mock( args = Mock(
ha_addon=True, ha_addon=True,
configuration=get_fixture_path("conf"), configuration=get_fixture_path("conf"),
port=port,
) )
os.environ["ESPHOME_DASHBOARD_PORT"] = str(port)
DASHBOARD.settings.parse_args(args) DASHBOARD.settings.parse_args(args)
app = web_server.make_app() app = web_server.make_app()
http_server = HTTPServer(app) http_server = HTTPServer(app)