Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
Fix integrations.json creation, make iot_standards a list (home-a…
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored Oct 25, 2022
1 parent 64eb316 commit 36bb0bb
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions homeassistant/components/ultraloq/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Virtual integration: Ultraloq."""
2 changes: 1 addition & 1 deletion homeassistant/components/ultraloq/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"domain": "ultraloq",
"name": "Ultraloq",
"integration_type": "virtual",
"iot_standard": "zwave"
"iot_standards": ["zwave"]
}
4 changes: 4 additions & 0 deletions homeassistant/generated/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2368,6 +2368,7 @@
"integrations": {
"symfonisk": {
"integration_type": "virtual",
"supported_by": "sonos",
"name": "IKEA SYMFONISK"
},
"tradfri": {
Expand Down Expand Up @@ -5607,6 +5608,9 @@
"integrations": {
"ultraloq": {
"integration_type": "virtual",
"iot_standards": [
"zwave"
],
"name": "Ultraloq"
}
}
Expand Down
8 changes: 6 additions & 2 deletions script/hassfest/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions script/hassfest/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ def verify_wildcard(value: str):
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,
}
)
Expand Down
4 changes: 2 additions & 2 deletions script/hassfest/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ def iot_class(self) -> str | None:
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."""
Expand Down

0 comments on commit 36bb0bb

Please sign in to comment.