From 1208ab4c76ad3b1390f3e0e4681826d67910256e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 12 Nov 2019 12:28:34 +0100 Subject: [PATCH] Upgrade discogs_client to 2.2.2 (#28723) --- homeassistant/components/discogs/manifest.json | 2 +- homeassistant/components/discogs/sensor.py | 12 +++--------- requirements_all.txt | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/discogs/manifest.json b/homeassistant/components/discogs/manifest.json index 18282f07781..5a1c670508a 100644 --- a/homeassistant/components/discogs/manifest.json +++ b/homeassistant/components/discogs/manifest.json @@ -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": [ diff --git a/homeassistant/components/discogs/sensor.py b/homeassistant/components/discogs/sensor.py index b3f29fbe75b..b5e488cc19c 100644 --- a/homeassistant/components/discogs/sensor.py +++ b/homeassistant/components/discogs/sensor.py @@ -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.""" diff --git a/requirements_all.txt b/requirements_all.txt index aebf0c92b22..c907fd879a2 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -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