Skip to content

Commit

Permalink
Ignore disabled entities
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed Nov 27, 2024
1 parent 5e87918 commit 426f794
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions zha/zigbee/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 426f794

Please sign in to comment.