Let core resolve entity_id for lastfm from username (#31280)
* Sluggify user * Simplify * Remove unused import
This commit is contained in:
parent
d225fc08fe
commit
ae76b5be5a
1 changed files with 0 additions and 6 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Reference in a new issue