Skip to content

Commit

Permalink
Avoid linear search of MQTT SUPPORTED_COMPONENTS (home-assistant#99459)
Browse files Browse the repository at this point in the history
By making this a set we avoid the linear search in async_discovery_message_received
  • Loading branch information
bdraco committed Sep 1, 2023
1 parent cf59ea3 commit 09f4566
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/mqtt/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
r"?(?P<object_id>[a-zA-Z0-9_-]+)/config"
)

SUPPORTED_COMPONENTS = [
SUPPORTED_COMPONENTS = {
"alarm_control_panel",
"binary_sensor",
"button",
Expand All @@ -75,7 +75,7 @@
"update",
"vacuum",
"water_heater",
]
}

MQTT_DISCOVERY_UPDATED = "mqtt_discovery_updated_{}"
MQTT_DISCOVERY_NEW = "mqtt_discovery_new_{}_{}"
Expand Down

0 comments on commit 09f4566

Please sign in to comment.