1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

[ruff] Enable SIM rules and fix code simplification violations (#9872)

This commit is contained in:
J. Nick Koston
2025-07-24 20:26:08 -10:00
committed by GitHub
parent cb87f156d0
commit ffebd30033
72 changed files with 400 additions and 432 deletions

View File

@@ -49,12 +49,15 @@ def validate_internal_filter(value):
[CONF_USE_PCNT],
)
if CORE.is_esp32 and use_pcnt:
if value.get(CONF_INTERNAL_FILTER).total_microseconds > 13:
raise cv.Invalid(
"Maximum internal filter value when using ESP32 hardware PCNT is 13us",
[CONF_INTERNAL_FILTER],
)
if (
CORE.is_esp32
and use_pcnt
and value.get(CONF_INTERNAL_FILTER).total_microseconds > 13
):
raise cv.Invalid(
"Maximum internal filter value when using ESP32 hardware PCNT is 13us",
[CONF_INTERNAL_FILTER],
)
return value