Use f-strings in integrations starting with "H" - "L" (#32265)

* Use f-strings in integrations starting with "H"

* Use f-strings in integrations starting with "I"

* Use f-strings in integrations starting with "J"

* Use f-strings in integrations starting with "K"

* Use f-strings in integrations starting with "L"

* Fix lint error

* Use join instead of f-string in homekit_controller

* Use local variables with f-strings

* Fix lint error

* Escape the characters in f-string

* Sort imports with isort in homeworks light

* Fix pylint error

* Fix broken tests

* Fix broken tests v2
This commit is contained in:
springstan authored and GitHub committed 2020-02-28 12:39:29 +01:00
1 parent 7714160f4c
commit 157f972d72
77 files changed
+158 -246

No files matched your search

+2 -2
View File
@@ -30,7 +30,7 @@ class IOSSensor(Entity):
def __init__(self, sensor_type, device_name, device):
"""Initialize the sensor."""
self._device_name = device_name
self._name = "{} {}".format(device_name, SENSOR_TYPES[sensor_type][0])
self._name = f"{device_name} {SENSOR_TYPES[sensor_type][0]}"
self._device = device
self.type = sensor_type
self._state = None
@@ -56,7 +56,7 @@ class IOSSensor(Entity):
def name(self):
"""Return the name of the iOS sensor."""
device_name = self._device[ios.ATTR_DEVICE][ios.ATTR_DEVICE_NAME]
return "{} {}".format(device_name, SENSOR_TYPES[self.type][0])
return f"{device_name} {SENSOR_TYPES[self.type][0]}"
@property
def state(self):