Upgrade discogs_client to 2.2.2 (#28723)

This commit is contained in:
Fabian Affolter 2019-11-12 12:28:34 +01:00 committed by GitHub
parent e8348221d4
commit 1208ab4c76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 11 deletions

View file

@ -3,7 +3,7 @@
"name": "Discogs",
"documentation": "https://www.home-assistant.io/integrations/discogs",
"requirements": [
"discogs_client==2.2.1"
"discogs_client==2.2.2"
],
"dependencies": [],
"codeowners": [

View file

@ -66,7 +66,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Discogs sensor."""
token = config[CONF_TOKEN]
name = config[CONF_NAME]
@ -104,7 +103,7 @@ class DiscogsSensor(Entity):
@property
def name(self):
"""Return the name of the sensor."""
return "{} {}".format(self._name, SENSORS[self._type]["name"])
return f"{self._name} {SENSORS[self._type]['name']}"
@property
def state(self):
@ -136,10 +135,7 @@ class DiscogsSensor(Entity):
return {
"cat_no": self._attrs["labels"][0]["catno"],
"cover_image": self._attrs["cover_image"],
"format": "{} ({})".format(
self._attrs["formats"][0]["name"],
self._attrs["formats"][0]["descriptions"][0],
),
"format": f"{self._attrs['formats'][0]['name']} ({self._attrs['formats'][0]['descriptions'][0]})",
"label": self._attrs["labels"][0]["name"],
"released": self._attrs["year"],
ATTR_ATTRIBUTION: ATTRIBUTION,
@ -154,9 +150,7 @@ class DiscogsSensor(Entity):
random_record = collection.releases[random_index].release
self._attrs = random_record.data
return "{} - {}".format(
random_record.data["artists"][0]["name"], random_record.data["title"]
)
return f"{random_record.data['artists'][0]['name']} - {random_record.data['title']}"
def update(self):
"""Set state to the amount of records in user's collection."""

View file

@ -414,7 +414,7 @@ denonavr==0.7.10
directpy==0.5
# homeassistant.components.discogs
discogs_client==2.2.1
discogs_client==2.2.2
# homeassistant.components.discord
discord.py==1.2.4