diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 0f1766dc1967935dee4a3ef361cd1ecc3790d914..0e44d5ff402a18a3a6903b14752e59ab6c98adb1 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
 repos:
   - repo: https://github.com/astral-sh/ruff-pre-commit
-    rev: v0.5.2
+    rev: v0.5.3
     hooks:
       - id: ruff
         args:
diff --git a/homeassistant/components/prometheus/__init__.py b/homeassistant/components/prometheus/__init__.py
index 7c7cdd7d3665cfd5e251b8491ecdd265918a0e22..f7037a685a6fabfc2d297e9842322c3f5560a85b 100644
--- a/homeassistant/components/prometheus/__init__.py
+++ b/homeassistant/components/prometheus/__init__.py
@@ -326,10 +326,7 @@ class PrometheusMetrics:
         return "".join(
             [
                 c
-                if c in string.ascii_letters
-                or c in string.digits
-                or c == "_"
-                or c == ":"
+                if c in string.ascii_letters + string.digits + "_:"
                 else f"u{hex(ord(c))}"
                 for c in metric
             ]
diff --git a/homeassistant/components/roku/media_player.py b/homeassistant/components/roku/media_player.py
index 881dda38f15288c5b12dc2835937d67ffd542e9c..5b15253068e051cf13e06b6da02ad4403b617b8b 100644
--- a/homeassistant/components/roku/media_player.py
+++ b/homeassistant/components/roku/media_player.py
@@ -149,8 +149,7 @@ class RokuMediaPlayer(RokuEntity, MediaPlayerEntity):
             return None
 
         if (
-            self.coordinator.data.app.name == "Power Saver"
-            or self.coordinator.data.app.name == "Roku"
+            self.coordinator.data.app.name in {"Power Saver", "Roku"}
             or self.coordinator.data.app.screensaver
         ):
             return MediaPlayerState.IDLE
diff --git a/homeassistant/components/zwave_js/triggers/value_updated.py b/homeassistant/components/zwave_js/triggers/value_updated.py
index 4814eba07575ef6160a22c230f9fd83f05cb5b45..d8c5702ce5ddb71b87cb273982b1945e88803eb4 100644
--- a/homeassistant/components/zwave_js/triggers/value_updated.py
+++ b/homeassistant/components/zwave_js/triggers/value_updated.py
@@ -128,14 +128,9 @@ async def async_attach_trigger(
             (prev_value, prev_value_raw, from_value),
             (curr_value, curr_value_raw, to_value),
         ):
-            if (
-                match != MATCH_ALL
-                and value_to_eval != 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
+            if match not in (MATCH_ALL, value_to_eval, raw_value_to_eval) and not (
+                isinstance(match, list)
+                and (value_to_eval in match or raw_value_to_eval in match)
             ):
                 return
 
diff --git a/pyproject.toml b/pyproject.toml
index 298f6a427da4d58d997edcdad76098bda83af691..6d3bdcab7e6416d55cde72d1969d8f04feae651d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -693,7 +693,7 @@ exclude_lines = [
 ]
 
 [tool.ruff]
-required-version = ">=0.5.2"
+required-version = ">=0.5.3"
 
 [tool.ruff.lint]
 select = [
diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt
index 80add9a50eec6d2bb4b69ec11b817c2c11ac98bb..3c4da0141cdeff38d16806477f07f5e17cc95fc1 100644
--- a/requirements_test_pre_commit.txt
+++ b/requirements_test_pre_commit.txt
@@ -1,5 +1,5 @@
 # Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit
 
 codespell==2.3.0
-ruff==0.5.2
+ruff==0.5.3
 yamllint==1.35.1
diff --git a/tests/components/unifiprotect/test_switch.py b/tests/components/unifiprotect/test_switch.py
index 6e5c83ef2374663e5577b32d9ce670862c99e933..9e0e9efa0ce43e389955d16a1710fb1cc89bc0bc 100644
--- a/tests/components/unifiprotect/test_switch.py
+++ b/tests/components/unifiprotect/test_switch.py
@@ -35,15 +35,16 @@ CAMERA_SWITCHES_BASIC = [
     for d in CAMERA_SWITCHES
     if (
         not d.name.startswith("Detections:")
-        and d.name != "SSH enabled"
-        and d.name != "Color night vision"
-        and d.name != "Tracking: person"
-        and d.name != "HDR mode"
+        and d.name
+        not in {"SSH enabled", "Color night vision", "Tracking: person", "HDR mode"}
     )
-    or d.name == "Detections: motion"
-    or d.name == "Detections: person"
-    or d.name == "Detections: vehicle"
-    or d.name == "Detections: animal"
+    or d.name
+    in {
+        "Detections: motion",
+        "Detections: person",
+        "Detections: vehicle",
+        "Detections: animal",
+    }
 ]
 CAMERA_SWITCHES_NO_EXTRA = [
     d