diff --git a/custom_components/trakt_tv/sensor.py b/custom_components/trakt_tv/sensor.py index d60eed7..185c7a8 100644 --- a/custom_components/trakt_tv/sensor.py +++ b/custom_components/trakt_tv/sensor.py @@ -217,7 +217,11 @@ def name(self): @property def unit_of_measurement(self): """Return the unit of measurement of this entity""" - return self.title.split("_")[-1] + units = ["ratings", "minutes", "comments", "friends", "followers", "following", "episodes", "movies", "shows", "seasons"] + for unit in units: + if unit in self.title.lower(): + return unit + return None async def async_update(self): """Request coordinator to update data."""