Add MQTT integration discovery (#41332)
* Add MQTT integration discovery * Add script/hassfest/mqtt.py * Unsubscribe if config entry exists * Add homeassistant/generated/mqtt.py * Fix bad loop * Improve tests * Improve tests * Apply suggestions from code review Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch> * Prevent initiating multiple config flows Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
This commit is contained in:
parent
3f263d5cbe
commit
343e5d64b8
21 changed files with 400 additions and 24 deletions
|
@ -33,6 +33,11 @@ def validate_integration(config: Config, integration: Integration):
|
|||
"config_flow",
|
||||
"HomeKit information in a manifest requires a config flow to exist",
|
||||
)
|
||||
if integration.manifest.get("mqtt"):
|
||||
integration.add_error(
|
||||
"config_flow",
|
||||
"MQTT information in a manifest requires a config flow to exist",
|
||||
)
|
||||
if integration.manifest.get("ssdp"):
|
||||
integration.add_error(
|
||||
"config_flow",
|
||||
|
@ -51,6 +56,7 @@ def validate_integration(config: Config, integration: Integration):
|
|||
"async_step_discovery" in config_flow
|
||||
or "async_step_hassio" in config_flow
|
||||
or "async_step_homekit" in config_flow
|
||||
or "async_step_mqtt" in config_flow
|
||||
or "async_step_ssdp" in config_flow
|
||||
or "async_step_zeroconf" in config_flow
|
||||
)
|
||||
|
@ -91,6 +97,7 @@ def generate_and_validate(integrations: Dict[str, Integration], config: Config):
|
|||
if not (
|
||||
integration.manifest.get("config_flow")
|
||||
or integration.manifest.get("homekit")
|
||||
or integration.manifest.get("mqtt")
|
||||
or integration.manifest.get("ssdp")
|
||||
or integration.manifest.get("zeroconf")
|
||||
):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue