support more alarm panels (#50235)
parent
17fc962a87
commit
55050bdd2a
|
@ -61,7 +61,7 @@ from .core.const import (
|
|||
)
|
||||
from .core.group import GroupMember
|
||||
from .core.helpers import (
|
||||
async_input_cluster_exists,
|
||||
async_cluster_exists,
|
||||
async_is_bindable_target,
|
||||
convert_install_code,
|
||||
get_matched_clusters,
|
||||
|
@ -897,7 +897,7 @@ async def websocket_get_configuration(hass, connection, msg):
|
|||
|
||||
data = {"schemas": {}, "data": {}}
|
||||
for section, schema in ZHA_CONFIG_SCHEMAS.items():
|
||||
if section == ZHA_ALARM_OPTIONS and not async_input_cluster_exists(
|
||||
if section == ZHA_ALARM_OPTIONS and not async_cluster_exists(
|
||||
hass, IasAce.cluster_id
|
||||
):
|
||||
continue
|
||||
|
|
|
@ -139,14 +139,17 @@ def async_get_zha_config_value(config_entry, section, config_key, default):
|
|||
)
|
||||
|
||||
|
||||
def async_input_cluster_exists(hass, cluster_id):
|
||||
def async_cluster_exists(hass, cluster_id):
|
||||
"""Determine if a device containing the specified in cluster is paired."""
|
||||
zha_gateway = hass.data[DATA_ZHA][DATA_ZHA_GATEWAY]
|
||||
zha_devices = zha_gateway.devices.values()
|
||||
for zha_device in zha_devices:
|
||||
clusters_by_endpoint = zha_device.async_get_clusters()
|
||||
for clusters in clusters_by_endpoint.values():
|
||||
if cluster_id in clusters[CLUSTER_TYPE_IN]:
|
||||
if (
|
||||
cluster_id in clusters[CLUSTER_TYPE_IN]
|
||||
or cluster_id in clusters[CLUSTER_TYPE_OUT]
|
||||
):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
|
@ -83,7 +83,8 @@ SINGLE_INPUT_CLUSTER_DEVICE_CLASS = {
|
|||
}
|
||||
|
||||
SINGLE_OUTPUT_CLUSTER_DEVICE_CLASS = {
|
||||
zcl.clusters.general.OnOff.cluster_id: BINARY_SENSOR
|
||||
zcl.clusters.general.OnOff.cluster_id: BINARY_SENSOR,
|
||||
zcl.clusters.security.IasAce.cluster_id: ALARM,
|
||||
}
|
||||
|
||||
BINDABLE_CLUSTERS = SetRegistry()
|
||||
|
|
Loading…
Reference in New Issue