mirror of
https://github.com/esphome/esphome.git
synced 2025-09-08 22:32:21 +01:00
preen
This commit is contained in:
@@ -250,7 +250,9 @@ def compile_program(args, config):
|
|||||||
return 0 if idedata is not None else 1
|
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
|
from esphome import platformio_api
|
||||||
|
|
||||||
first_baudrate = speed or config[CONF_ESPHOME][CONF_PLATFORMIO_OPTIONS].get(
|
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:
|
try:
|
||||||
module = importlib.import_module("esphome.components." + CORE.target_platform)
|
module = importlib.import_module("esphome.components." + CORE.target_platform)
|
||||||
if getattr(module, "upload_program")(config, args, host):
|
if getattr(module, "upload_program")(config, args, host):
|
||||||
|
@@ -223,7 +223,7 @@ def run_external_command(
|
|||||||
return retval
|
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)
|
full_cmd = " ".join(shlex_quote(x) for x in cmd)
|
||||||
_LOGGER.debug("Running: %s", full_cmd)
|
_LOGGER.debug("Running: %s", full_cmd)
|
||||||
filter_lines = kwargs.get("filter_lines")
|
filter_lines = kwargs.get("filter_lines")
|
||||||
|
Reference in New Issue
Block a user