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

Use literal string interpolation in integrations A (f-strings) (#26377)

* Use literal string interpolation in integrations A (f-strings)

* Black
This commit is contained in:
Franck Nijhof
2019-09-03 16:11:36 +02:00
committed by Andrew Sayre
parent 3534b8a977
commit ad51615718
37 changed files with 74 additions and 95 deletions

View File

@@ -150,7 +150,7 @@ class AwairSensor(Entity):
"""Initialize the sensor."""
self._uuid = device[CONF_UUID]
self._device_class = SENSOR_TYPES[sensor_type]["device_class"]
self._name = "Awair {}".format(self._device_class)
self._name = f"Awair {self._device_class}"
unit = SENSOR_TYPES[sensor_type]["unit_of_measurement"]
self._unit_of_measurement = unit
self._data = data
@@ -202,7 +202,7 @@ class AwairSensor(Entity):
@property
def unique_id(self):
"""Return the unique id of this entity."""
return "{}_{}".format(self._uuid, self._type)
return f"{self._uuid}_{self._type}"
@property
def unit_of_measurement(self):