mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Simplify and speed up mqtt_config_entry_enabled check (#117886)
This commit is contained in:
parent
5f7b84caea
commit
1800a60a6d
@ -84,9 +84,9 @@ async def async_forward_entry_setup_and_setup_discovery(
|
|||||||
|
|
||||||
def mqtt_config_entry_enabled(hass: HomeAssistant) -> bool | None:
|
def mqtt_config_entry_enabled(hass: HomeAssistant) -> bool | None:
|
||||||
"""Return true when the MQTT config entry is enabled."""
|
"""Return true when the MQTT config entry is enabled."""
|
||||||
if not bool(hass.config_entries.async_entries(DOMAIN)):
|
return hass.config_entries.async_has_entries(
|
||||||
return None
|
DOMAIN, include_disabled=False, include_ignore=False
|
||||||
return not bool(hass.config_entries.async_entries(DOMAIN)[0].disabled_by)
|
)
|
||||||
|
|
||||||
|
|
||||||
async def async_wait_for_mqtt_client(hass: HomeAssistant) -> bool:
|
async def async_wait_for_mqtt_client(hass: HomeAssistant) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user