From ae76b5be5a9d2b039abb733a9730f3c2c2bb24f2 Mon Sep 17 00:00:00 2001 From: Malachi Soord Date: Fri, 31 Jan 2020 23:23:42 +0100 Subject: [PATCH] Let core resolve entity_id for lastfm from username (#31280) * Sluggify user * Simplify * Remove unused import --- homeassistant/components/lastfm/sensor.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/homeassistant/components/lastfm/sensor.py b/homeassistant/components/lastfm/sensor.py index 3a830b9f4e6..1a5b7a56e8e 100644 --- a/homeassistant/components/lastfm/sensor.py +++ b/homeassistant/components/lastfm/sensor.py @@ -58,7 +58,6 @@ class LastfmSensor(Entity): self._unique_id = hashlib.sha256(user.encode("utf-8")).hexdigest() self._user = lastfm_api.get_user(user) self._name = user - self._entity_id = user self._lastfm = lastfm_api self._state = "Not Scrobbling" self._playcount = None @@ -76,11 +75,6 @@ class LastfmSensor(Entity): """Return the name of the sensor.""" return self._name - @property - def entity_id(self): - """Return the entity ID.""" - return f"sensor.lastfm_{self._entity_id}" - @property def state(self): """Return the state of the sensor."""