Revert using has_entity_name in ESPHome when friendly_name is not set (#97488)

This commit is contained in:
J. Nick Koston
2023-07-30 09:28:45 -07:00
committed by GitHub
parent 5e3bcc1224
commit afdbbefc31

View File

@@ -140,7 +140,6 @@ class EsphomeEntity(Entity, Generic[_InfoT, _StateT]):
"""Define a base esphome entity.""" """Define a base esphome entity."""
_attr_should_poll = False _attr_should_poll = False
_attr_has_entity_name = True
_static_info: _InfoT _static_info: _InfoT
_state: _StateT _state: _StateT
_has_state: bool _has_state: bool
@@ -169,6 +168,7 @@ class EsphomeEntity(Entity, Generic[_InfoT, _StateT]):
connections={(dr.CONNECTION_NETWORK_MAC, device_info.mac_address)} connections={(dr.CONNECTION_NETWORK_MAC, device_info.mac_address)}
) )
self._entry_id = entry_data.entry_id self._entry_id = entry_data.entry_id
self._attr_has_entity_name = bool(device_info.friendly_name)
async def async_added_to_hass(self) -> None: async def async_added_to_hass(self) -> None:
"""Register callbacks.""" """Register callbacks."""