Bump Ruff to 0.5.3 (#122167)

This commit is contained in:
Sid 2024-07-19 12:06:53 +02:00 committed by GitHub
parent 0b691f9393
commit 4620a54582
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 17 additions and 25 deletions

View File

@ -1,6 +1,6 @@
repos: repos:
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.2 rev: v0.5.3
hooks: hooks:
- id: ruff - id: ruff
args: args:

View File

@ -326,10 +326,7 @@ class PrometheusMetrics:
return "".join( return "".join(
[ [
c c
if c in string.ascii_letters if c in string.ascii_letters + string.digits + "_:"
or c in string.digits
or c == "_"
or c == ":"
else f"u{hex(ord(c))}" else f"u{hex(ord(c))}"
for c in metric for c in metric
] ]

View File

@ -149,8 +149,7 @@ class RokuMediaPlayer(RokuEntity, MediaPlayerEntity):
return None return None
if ( if (
self.coordinator.data.app.name == "Power Saver" self.coordinator.data.app.name in {"Power Saver", "Roku"}
or self.coordinator.data.app.name == "Roku"
or self.coordinator.data.app.screensaver or self.coordinator.data.app.screensaver
): ):
return MediaPlayerState.IDLE return MediaPlayerState.IDLE

View File

@ -128,14 +128,9 @@ async def async_attach_trigger(
(prev_value, prev_value_raw, from_value), (prev_value, prev_value_raw, from_value),
(curr_value, curr_value_raw, to_value), (curr_value, curr_value_raw, to_value),
): ):
if ( if match not in (MATCH_ALL, value_to_eval, raw_value_to_eval) and not (
match != MATCH_ALL isinstance(match, list)
and value_to_eval != match and (value_to_eval in match or raw_value_to_eval in match)
and not (
isinstance(match, list)
and (value_to_eval in match or raw_value_to_eval in match)
)
and raw_value_to_eval != match
): ):
return return

View File

@ -693,7 +693,7 @@ exclude_lines = [
] ]
[tool.ruff] [tool.ruff]
required-version = ">=0.5.2" required-version = ">=0.5.3"
[tool.ruff.lint] [tool.ruff.lint]
select = [ select = [

View File

@ -1,5 +1,5 @@
# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit # Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit
codespell==2.3.0 codespell==2.3.0
ruff==0.5.2 ruff==0.5.3
yamllint==1.35.1 yamllint==1.35.1

View File

@ -35,15 +35,16 @@ CAMERA_SWITCHES_BASIC = [
for d in CAMERA_SWITCHES for d in CAMERA_SWITCHES
if ( if (
not d.name.startswith("Detections:") not d.name.startswith("Detections:")
and d.name != "SSH enabled" and d.name
and d.name != "Color night vision" not in {"SSH enabled", "Color night vision", "Tracking: person", "HDR mode"}
and d.name != "Tracking: person"
and d.name != "HDR mode"
) )
or d.name == "Detections: motion" or d.name
or d.name == "Detections: person" in {
or d.name == "Detections: vehicle" "Detections: motion",
or d.name == "Detections: animal" "Detections: person",
"Detections: vehicle",
"Detections: animal",
}
] ]
CAMERA_SWITCHES_NO_EXTRA = [ CAMERA_SWITCHES_NO_EXTRA = [
d d