mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Rename mqtt platform setup method (#113042)
* Rename mqtt platform setup method * Format method to one line
This commit is contained in:
parent
405bf076b2
commit
17aa49410b
@ -144,10 +144,8 @@ async def async_start( # noqa: C901
|
|||||||
mqtt_data = get_mqtt_data(hass)
|
mqtt_data = get_mqtt_data(hass)
|
||||||
platform_setup_lock: dict[str, asyncio.Lock] = {}
|
platform_setup_lock: dict[str, asyncio.Lock] = {}
|
||||||
|
|
||||||
async def _async_jit_component_setup(
|
async def _async_component_setup(discovery_payload: MQTTDiscoveryPayload) -> None:
|
||||||
discovery_payload: MQTTDiscoveryPayload,
|
"""Perform component set up."""
|
||||||
) -> None:
|
|
||||||
"""Perform just in time components set up."""
|
|
||||||
discovery_hash = discovery_payload.discovery_data[ATTR_DISCOVERY_HASH]
|
discovery_hash = discovery_payload.discovery_data[ATTR_DISCOVERY_HASH]
|
||||||
component, discovery_id = discovery_hash
|
component, discovery_id = discovery_hash
|
||||||
platform_setup_lock.setdefault(component, asyncio.Lock())
|
platform_setup_lock.setdefault(component, asyncio.Lock())
|
||||||
@ -166,7 +164,7 @@ async def async_start( # noqa: C901
|
|||||||
|
|
||||||
mqtt_data.reload_dispatchers.append(
|
mqtt_data.reload_dispatchers.append(
|
||||||
async_dispatcher_connect(
|
async_dispatcher_connect(
|
||||||
hass, MQTT_DISCOVERY_NEW_COMPONENT, _async_jit_component_setup
|
hass, MQTT_DISCOVERY_NEW_COMPONENT, _async_component_setup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user