fix python lint

This commit is contained in:
Tomasz Duda 2024-04-24 22:12:32 +02:00
parent 625e328e97
commit f7d9af3eaf
3 changed files with 8 additions and 7 deletions

View File

@ -1,9 +1,13 @@
import esphome.codegen as cg
from typing import Union
import esphome.codegen as cg
from esphome.core import CORE
from esphome.helpers import (
write_file_if_changed,
)
from esphome.const import (
CONF_VARIANT,
CONF_BOARD,
)
from .const import (
ZEPHYR_VARIANT_GENERIC,
ZEPHYR_VARIANT_NRF_SDK,
@ -12,10 +16,6 @@ from .const import (
KEY_OVERLAY,
zephyr_ns,
)
from esphome.const import (
CONF_VARIANT,
CONF_BOARD,
)
AUTO_LOAD = ["preferences"]

View File

@ -8,7 +8,7 @@ from bleak.exc import BleakDeviceNotFoundError, BleakDBusError
from smpclient.transport.ble import SMPBLETransport
from smpclient.transport.serial import SMPSerialTransport
from smpclient import SMPClient
from smpclient.mcuboot import IMAGE_TLV, ImageInfo, TLVNotFound
from smpclient.mcuboot import IMAGE_TLV, ImageInfo, TLVNotFound, MCUBootImageError
from smpclient.requests.image_management import ImageStatesRead, ImageStatesWrite
from smpclient.requests.os_management import ResetWrite
from smpclient.generics import error, success
@ -71,7 +71,7 @@ def get_image_tlv_sha256(file):
image_info = ImageInfo.load_file(str(file))
pprint(image_info.header)
_LOGGER.debug(str(image_info))
except Exception as e:
except MCUBootImageError as e:
_LOGGER.error("Inspection of FW image failed: %s", e)
return None

View File

@ -541,6 +541,7 @@ def lint_relative_py_import(fname):
"esphome/components/rp2040/core.cpp",
"esphome/components/libretiny/core.cpp",
"esphome/components/host/core.cpp",
"esphome/components/zephyr/core.cpp",
],
)
def lint_namespace(fname, content):