Skip to content

Commit

Permalink
fix: entity ids and naming (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptk authored Jul 31, 2023
1 parent 6eb02b1 commit 84f8e93
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions custom_components/omnilogic_local/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

class OmniLogicEntity(CoordinatorEntity, Generic[EntityIndexTypeVar]):
_attr_has_entity_name = True
_attr_name: str | None = None

data: EntityIndexTypeVar
coordinator: OmniLogicCoordinator
Expand Down Expand Up @@ -115,7 +114,7 @@ def extra_state_attributes(self) -> dict[str, str | int]:

@property
def name(self) -> Any:
return self._attr_name if self._attr_name is not None else self.data.msp_config.name
return self._attr_name if hasattr(self, "_attr_name") else self.data.msp_config.name

@property
def unique_id(self) -> str | None:
Expand Down

0 comments on commit 84f8e93

Please sign in to comment.