mirror of
https://github.com/home-assistant/core.git
synced 2025-12-26 14:08:21 +00:00
Fix integrations.json creation, make iot_standards a list (#80945)
This commit is contained in:
@@ -113,6 +113,10 @@ def _populate_brand_integrations(
|
||||
metadata["config_flow"] = integration.config_flow
|
||||
if integration.iot_class:
|
||||
metadata["iot_class"] = integration.iot_class
|
||||
if integration.supported_by:
|
||||
metadata["supported_by"] = integration.supported_by
|
||||
if integration.iot_standards:
|
||||
metadata["iot_standards"] = integration.iot_standards
|
||||
if integration.translated_name:
|
||||
integration_data["translated_name"].add(domain)
|
||||
else:
|
||||
@@ -185,8 +189,8 @@ def _generate_integrations(
|
||||
if integration.integration_type == "virtual":
|
||||
if integration.supported_by:
|
||||
metadata["supported_by"] = integration.supported_by
|
||||
if integration.iot_standard:
|
||||
metadata["iot_standard"] = integration.iot_standard
|
||||
if integration.iot_standards:
|
||||
metadata["iot_standards"] = integration.iot_standards
|
||||
else:
|
||||
metadata["config_flow"] = integration.config_flow
|
||||
if integration.iot_class:
|
||||
|
||||
@@ -263,9 +263,9 @@ VIRTUAL_INTEGRATION_MANIFEST_SCHEMA = vol.Schema(
|
||||
vol.Required("domain"): str,
|
||||
vol.Required("name"): str,
|
||||
vol.Required("integration_type"): "virtual",
|
||||
vol.Exclusive("iot_standard", "virtual_integration"): vol.Any(
|
||||
"homekit", "zigbee", "zwave"
|
||||
),
|
||||
vol.Exclusive("iot_standards", "virtual_integration"): [
|
||||
vol.Any("homekit", "zigbee", "zwave")
|
||||
],
|
||||
vol.Exclusive("supported_by", "virtual_integration"): str,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -186,9 +186,9 @@ class Integration:
|
||||
return self.manifest.get("iot_class")
|
||||
|
||||
@property
|
||||
def iot_standard(self) -> str:
|
||||
def iot_standards(self) -> list[str]:
|
||||
"""Return the IoT standard supported by this virtual integration."""
|
||||
return self.manifest.get("iot_standard", {})
|
||||
return self.manifest.get("iot_standards", [])
|
||||
|
||||
def add_error(self, *args: Any, **kwargs: Any) -> None:
|
||||
"""Add an error."""
|
||||
|
||||
Reference in New Issue
Block a user