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

@ -77,7 +77,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
account_name = account_config.get(account.iban)
if not account_name:
account_name = "{} - {}".format(fints_name, account.iban)
account_name = f"{fints_name} - {account.iban}"
accounts.append(FinTsAccount(client, account, account_name))
_LOGGER.debug("Creating account %s for bank %s", account.iban, fints_name)
@ -90,7 +90,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
account_name = holdings_config.get(account.accountnumber)
if not account_name:
account_name = "{} - {}".format(fints_name, account.accountnumber)
account_name = f"{fints_name} - {account.accountnumber}"
accounts.append(FinTsHoldingsAccount(client, account, account_name))
_LOGGER.debug(
"Creating holdings %s for bank %s", account.accountnumber, fints_name
@ -265,11 +265,11 @@ class FinTsHoldingsAccount(Entity):
if self._client.name:
attributes[ATTR_BANK] = self._client.name
for holding in self._holdings:
total_name = "{} total".format(holding.name)
total_name = f"{holding.name} total"
attributes[total_name] = holding.total_value
pieces_name = "{} pieces".format(holding.name)
pieces_name = f"{holding.name} pieces"
attributes[pieces_name] = holding.pieces
price_name = "{} price".format(holding.name)
price_name = f"{holding.name} price"
attributes[price_name] = holding.market_value
return attributes