mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Migrate Geocaching to new entity naming style (#74899)
This commit is contained in:
parent
bb4b2014fc
commit
c5253d3da0
@ -91,6 +91,7 @@ class GeocachingSensor(
|
|||||||
"""Representation of a Sensor."""
|
"""Representation of a Sensor."""
|
||||||
|
|
||||||
entity_description: GeocachingSensorEntityDescription
|
entity_description: GeocachingSensorEntityDescription
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -100,9 +101,6 @@ class GeocachingSensor(
|
|||||||
"""Initialize the Geocaching sensor."""
|
"""Initialize the Geocaching sensor."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self.entity_description = description
|
self.entity_description = description
|
||||||
self._attr_name = (
|
|
||||||
f"Geocaching {coordinator.data.user.username} {description.name}"
|
|
||||||
)
|
|
||||||
self._attr_unique_id = (
|
self._attr_unique_id = (
|
||||||
f"{coordinator.data.user.reference_code}_{description.key}"
|
f"{coordinator.data.user.reference_code}_{description.key}"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user