1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Use literal string interpolation in integrations H-J (f-strings) (#26380)

This commit is contained in:
Franck Nijhof
2019-09-03 17:27:14 +02:00
committed by Pascal Vizeli
parent 13bb2ea35a
commit f9edec19ad
59 changed files with 128 additions and 139 deletions

View File

@@ -174,9 +174,9 @@ class IndexSensor(IQVIAEntity):
index = idx + 1
self._attrs.update(
{
"{0}_{1}".format(ATTR_ALLERGEN_GENUS, index): attrs["Genus"],
"{0}_{1}".format(ATTR_ALLERGEN_NAME, index): attrs["Name"],
"{0}_{1}".format(ATTR_ALLERGEN_TYPE, index): attrs["PlantType"],
f"{ATTR_ALLERGEN_GENUS}_{index}": attrs["Genus"],
f"{ATTR_ALLERGEN_NAME}_{index}": attrs["Name"],
f"{ATTR_ALLERGEN_TYPE}_{index}": attrs["PlantType"],
}
)
elif self._type in (TYPE_ASTHMA_TODAY, TYPE_ASTHMA_TOMORROW):
@@ -184,8 +184,8 @@ class IndexSensor(IQVIAEntity):
index = idx + 1
self._attrs.update(
{
"{0}_{1}".format(ATTR_ALLERGEN_NAME, index): attrs["Name"],
"{0}_{1}".format(ATTR_ALLERGEN_AMOUNT, index): attrs["PPM"],
f"{ATTR_ALLERGEN_NAME}_{index}": attrs["Name"],
f"{ATTR_ALLERGEN_AMOUNT}_{index}": attrs["PPM"],
}
)
elif self._type == TYPE_DISEASE_TODAY: