Skip to content

Commit

Permalink
Fix SQL sensor name (#134414)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjohansson-ST authored Jan 2, 2025
1 parent dc5bfba commit 877d162
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion homeassistant/components/sql/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,16 @@ def __init__(
entry_type=DeviceEntryType.SERVICE,
identifiers={(DOMAIN, unique_id)},
manufacturer="SQL",
name=self.name,
name=self._rendered.get(CONF_NAME),
)

@property
def name(self) -> str | None:
"""Name of the entity."""
if self.has_entity_name:
return self._attr_name
return self._rendered.get(CONF_NAME)

async def async_added_to_hass(self) -> None:
"""Call when entity about to be added to hass."""
await super().async_added_to_hass()
Expand Down

0 comments on commit 877d162

Please sign in to comment.