diff --git a/zha/zigbee/device.py b/zha/zigbee/device.py index fed74bba8..f388a244f 100644 --- a/zha/zigbee/device.py +++ b/zha/zigbee/device.py @@ -1091,11 +1091,8 @@ def log(self, level: int, msg: str, *args: Any, **kwargs: Any) -> None: def _compute_primary_entity(self) -> None: """Compute the primary entity for this device.""" - candidates = sorted( - self._platform_entities.values(), - reverse=True, - key=lambda e: e.primary_weight, - ) + candidates = [e for e in self._platform_entities.values() if e.enabled] + candidates.sort(reverse=True, key=lambda e: e.primary_weight) if not candidates: return