1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-14 17:08:22 +00:00

Merge branch 'pass_name_run_logs' into integration

This commit is contained in:
J. Nick Koston 2023-11-15 15:32:22 -06:00
commit a9756d2b51
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

@ -18,9 +18,10 @@ from . import CONF_ENCRYPTION
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
async def async_run_logs(config, address): async def async_run_logs(config: dict[str, Any], address: str) -> None:
"""Run the logs command in the event loop.""" """Run the logs command in the event loop."""
conf = config["api"] conf = config["api"]
name = config["esphome"]["name"]
port: int = int(conf[CONF_PORT]) port: int = int(conf[CONF_PORT])
password: str = conf[CONF_PASSWORD] password: str = conf[CONF_PASSWORD]
noise_psk: str | None = None noise_psk: str | None = None
@ -28,7 +29,6 @@ async def async_run_logs(config, address):
noise_psk = conf[CONF_ENCRYPTION][CONF_KEY] noise_psk = conf[CONF_ENCRYPTION][CONF_KEY]
_LOGGER.info("Starting log output from %s using esphome API", address) _LOGGER.info("Starting log output from %s using esphome API", address)
aiozc = AsyncZeroconf() aiozc = AsyncZeroconf()
cli = APIClient( cli = APIClient(
address, address,
port, port,
@ -48,7 +48,7 @@ async def async_run_logs(config, address):
text = text.replace("\033", "\\033") text = text.replace("\033", "\\033")
print(f"[{time_.hour:02}:{time_.minute:02}:{time_.second:02}]{text}") print(f"[{time_.hour:02}:{time_.minute:02}:{time_.second:02}]{text}")
stop = await async_run(cli, on_log, aio_zeroconf_instance=aiozc) stop = await async_run(cli, on_log, aio_zeroconf_instance=aiozc, name=name)
try: try:
while True: while True:
await asyncio.sleep(60) await asyncio.sleep(60)

View File

@ -10,7 +10,7 @@ platformio==6.1.11 # When updating platformio, also update Dockerfile
esptool==4.6.2 esptool==4.6.2
click==8.1.7 click==8.1.7
esphome-dashboard==20231107.0 esphome-dashboard==20231107.0
aioesphomeapi==18.4.0 aioesphomeapi==18.4.1
zeroconf==0.126.0 zeroconf==0.126.0
# esp-idf requires this, but doesn't bundle it by default # esp-idf requires this, but doesn't bundle it by default