Use literal string interpolation in integrations E-G (f-strings) (#26379)

This commit is contained in:
Franck Nijhof 2019-09-03 17:10:56 +02:00 committed by Pascal Vizeli
parent 6a24d893c8
commit fa79ef1220
45 changed files with 87 additions and 92 deletions

View file

@ -135,7 +135,7 @@ class EmonCmsSensor(Entity):
id_for_name = "" if str(sensorid) == "1" else sensorid
# Use the feed name assigned in EmonCMS or fall back to the feed ID
feed_name = elem.get("name") or "Feed {}".format(elem["id"])
self._name = "EmonCMS{} {}".format(id_for_name, feed_name)
self._name = f"EmonCMS{id_for_name} {feed_name}"
else:
self._name = name
self._identifier = get_id(
@ -225,7 +225,7 @@ class EmonCmsData:
def __init__(self, hass, url, apikey, interval):
"""Initialize the data object."""
self._apikey = apikey
self._url = "{}/feed/list.json".format(url)
self._url = f"{url}/feed/list.json"
self._interval = interval
self._hass = hass
self.data = None