Skip to content

Commit

Permalink
Fix unit of measurement
Browse files Browse the repository at this point in the history
  • Loading branch information
downey-lv committed Jun 4, 2024
1 parent 2fa088c commit c9a5525
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/trakt_tv/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit c9a5525

Please sign in to comment.