Use literal string interpolation in integrations T-W (f-strings) (#26394)
This commit is contained in:
parent
cde09062c4
commit
ef0e9431b6
50 changed files with 128 additions and 132 deletions
|
@ -40,28 +40,28 @@ async def async_setup_entry(
|
|||
TwenteMilieuSensor(
|
||||
twentemilieu,
|
||||
unique_id=entry.data[CONF_ID],
|
||||
name="{} Waste Pickup".format(WASTE_TYPE_NON_RECYCLABLE),
|
||||
name=f"{WASTE_TYPE_NON_RECYCLABLE} Waste Pickup",
|
||||
waste_type=WASTE_TYPE_NON_RECYCLABLE,
|
||||
icon="mdi:delete-empty",
|
||||
),
|
||||
TwenteMilieuSensor(
|
||||
twentemilieu,
|
||||
unique_id=entry.data[CONF_ID],
|
||||
name="{} Waste Pickup".format(WASTE_TYPE_ORGANIC),
|
||||
name=f"{WASTE_TYPE_ORGANIC} Waste Pickup",
|
||||
waste_type=WASTE_TYPE_ORGANIC,
|
||||
icon="mdi:delete-empty",
|
||||
),
|
||||
TwenteMilieuSensor(
|
||||
twentemilieu,
|
||||
unique_id=entry.data[CONF_ID],
|
||||
name="{} Waste Pickup".format(WASTE_TYPE_PAPER),
|
||||
name=f"{WASTE_TYPE_PAPER} Waste Pickup",
|
||||
waste_type=WASTE_TYPE_PAPER,
|
||||
icon="mdi:delete-empty",
|
||||
),
|
||||
TwenteMilieuSensor(
|
||||
twentemilieu,
|
||||
unique_id=entry.data[CONF_ID],
|
||||
name="{} Waste Pickup".format(WASTE_TYPE_PLASTIC),
|
||||
name=f"{WASTE_TYPE_PLASTIC} Waste Pickup",
|
||||
waste_type=WASTE_TYPE_PLASTIC,
|
||||
icon="mdi:delete-empty",
|
||||
),
|
||||
|
@ -110,7 +110,7 @@ class TwenteMilieuSensor(Entity):
|
|||
@property
|
||||
def unique_id(self) -> str:
|
||||
"""Return the unique ID for this sensor."""
|
||||
return "{}_{}_{}".format(DOMAIN, self._unique_id, self._waste_type)
|
||||
return f"{DOMAIN}_{self._unique_id}_{self._waste_type}"
|
||||
|
||||
@property
|
||||
def should_poll(self) -> bool:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue