Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions zha/application/platforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ class PlatformFeatureGroup(StrEnum):
# Model-specific overrides for local temperature calibration
LOCAL_TEMPERATURE_CALIBRATION = "local_temperature_calibration"

# Prefer OTA client update entities over OTA server update entities
OTA_UPDATE = "ota_update"


@dataclasses.dataclass(frozen=True)
class ClusterHandlerMatch:
Expand Down
7 changes: 5 additions & 2 deletions zha/application/platforms/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
ClusterHandlerMatch,
EntityCategory,
PlatformEntity,
PlatformFeatureGroup,
register_entity,
)
from zha.exceptions import ZHAException
Expand Down Expand Up @@ -285,7 +286,8 @@ class FirmwareUpdateEntity(BaseFirmwareUpdateEntity):
_unique_id_suffix = "firmware_update"

_cluster_handler_match = ClusterHandlerMatch(
client_cluster_handlers=frozenset({CLUSTER_HANDLER_OTA})
client_cluster_handlers=frozenset({CLUSTER_HANDLER_OTA}),
feature_priority=(PlatformFeatureGroup.OTA_UPDATE, 1),
)

def __init__(
Expand Down Expand Up @@ -335,7 +337,8 @@ class FirmwareUpdateServerEntity(BaseFirmwareUpdateEntity):

_unique_id_suffix = "firmware_update"
_cluster_handler_match = ClusterHandlerMatch(
cluster_handlers=frozenset({CLUSTER_HANDLER_OTA})
cluster_handlers=frozenset({CLUSTER_HANDLER_OTA}),
feature_priority=(PlatformFeatureGroup.OTA_UPDATE, 0),
)

def __init__(
Expand Down
Loading