Migrate Geocaching to new entity naming style (#74899)

This commit is contained in:
Franck Nijhof 2022-07-10 22:05:00 +02:00 committed by GitHub
parent bb4b2014fc
commit c5253d3da0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,6 +91,7 @@ class GeocachingSensor(
"""Representation of a Sensor."""
entity_description: GeocachingSensorEntityDescription
_attr_has_entity_name = True
def __init__(
self,
@ -100,9 +101,6 @@ class GeocachingSensor(
"""Initialize the Geocaching sensor."""
super().__init__(coordinator)
self.entity_description = description
self._attr_name = (
f"Geocaching {coordinator.data.user.username} {description.name}"
)
self._attr_unique_id = (
f"{coordinator.data.user.reference_code}_{description.key}"
)