1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 00:31:58 +00:00

Bump ruff from 0.14.14 to 0.15.0 (#13752)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
dependabot[bot]
2026-02-04 09:24:05 +00:00
committed by GitHub
parent 2541ec1565
commit 4d05cd3059
15 changed files with 60 additions and 65 deletions

View File

@@ -183,7 +183,7 @@ async def to_code(config):
if CORE.using_zephyr:
zephyr_add_prj_conf("I2C", True)
i2c = "i2c0"
if zephyr_data()[KEY_BOARD] in ["xiao_ble"]:
if zephyr_data()[KEY_BOARD] == "xiao_ble":
i2c = "i2c1"
zephyr_add_overlay(
f"""

View File

@@ -272,9 +272,7 @@ async def obj_hide_to_code(config, action_id, template_arg, args):
async def do_hide(widget: Widget):
widget.add_flag("LV_OBJ_FLAG_HIDDEN")
widgets = [
widget.outer if widget.outer else widget for widget in await get_widgets(config)
]
widgets = [widget.outer or widget for widget in await get_widgets(config)]
return await action_to_code(widgets, do_hide, action_id, template_arg, args)
@@ -285,9 +283,7 @@ async def obj_show_to_code(config, action_id, template_arg, args):
if widget.move_to_foreground:
lv_obj.move_foreground(widget.obj)
widgets = [
widget.outer if widget.outer else widget for widget in await get_widgets(config)
]
widgets = [widget.outer or widget for widget in await get_widgets(config)]
return await action_to_code(widgets, do_show, action_id, template_arg, args)

View File

@@ -31,7 +31,9 @@ def define_has_settings(keys: list[str], schemas: dict[str, SettingSchema]) -> N
cg.RawExpression(
" sep ".join(
map(
lambda key: f"F({schemas[key].backing_type}, {key}_setting, {schemas[key].default_value})",
lambda key: (
f"F({schemas[key].backing_type}, {key}_setting, {schemas[key].default_value})"
),
keys,
)
)

View File

@@ -213,9 +213,10 @@ def copy_files():
zephyr_data()[KEY_OVERLAY],
)
if zephyr_data()[KEY_BOOTLOADER] == BOOTLOADER_MCUBOOT or zephyr_data()[
KEY_BOARD
] in ["xiao_ble"]:
if (
zephyr_data()[KEY_BOOTLOADER] == BOOTLOADER_MCUBOOT
or zephyr_data()[KEY_BOARD] == "xiao_ble"
):
fake_board_manifest = """
{
"frameworks": [

View File

@@ -682,7 +682,7 @@ def only_with_framework(
def validator_(obj):
if CORE.target_framework not in frameworks:
err_str = f"This feature is only available with framework(s) {', '.join([framework.value for framework in frameworks])}"
if suggestion := suggestions.get(CORE.target_framework, None):
if suggestion := suggestions.get(CORE.target_framework):
(component, docs_path) = suggestion
err_str += f"\nPlease use '{component}'"
if docs_path:

View File

@@ -2,19 +2,7 @@
from __future__ import annotations
from enum import Enum
from typing import Any
from enum import StrEnum as _StrEnum
class StrEnum(str, Enum):
"""Partial backport of Python 3.11's StrEnum for our basic use cases."""
def __new__(cls, value: str, *args: Any, **kwargs: Any) -> StrEnum:
"""Create a new StrEnum instance."""
if not isinstance(value, str):
raise TypeError(f"{value!r} is not a string")
return super().__new__(cls, value, *args, **kwargs)
def __str__(self) -> str:
"""Return self.value."""
return str(self.value)
# Re-export StrEnum from standard library for backwards compatibility
StrEnum = _StrEnum

View File

@@ -470,7 +470,7 @@ def wizard(path: Path) -> int:
sleep(1)
# Do not create wifi if the board does not support it
if board not in ["rpipico"]:
if board != "rpipico":
safe_print_step(3, WIFI_BIG)
safe_print("In this step, I'm going to create the configuration for WiFi.")
safe_print()