1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 13:22:19 +01:00
This commit is contained in:
J. Nick Koston
2025-07-31 19:41:04 -10:00
parent 5fac039a06
commit b96cd2b932
2 changed files with 5 additions and 3 deletions

View File

@@ -250,7 +250,9 @@ def compile_program(args, config):
return 0 if idedata is not None else 1
def upload_using_esptool(config: ConfigType, port: str, file: str, speed: int):
def upload_using_esptool(
config: ConfigType, port: str, file: str, speed: int
) -> str | int:
from esphome import platformio_api
first_baudrate = speed or config[CONF_ESPHOME][CONF_PLATFORMIO_OPTIONS].get(
@@ -342,7 +344,7 @@ def check_permissions(port: str):
)
def upload_program(config: ConfigType, args, host: str):
def upload_program(config: ConfigType, args, host: str) -> int | str:
try:
module = importlib.import_module("esphome.components." + CORE.target_platform)
if getattr(module, "upload_program")(config, args, host):

View File

@@ -223,7 +223,7 @@ def run_external_command(
return retval
def run_external_process(*cmd, **kwargs):
def run_external_process(*cmd: str, **kwargs: str) -> int | str:
full_cmd = " ".join(shlex_quote(x) for x in cmd)
_LOGGER.debug("Running: %s", full_cmd)
filter_lines = kwargs.get("filter_lines")