Use f-strings in integrations starting with "F"and"G" (#32150)
* Use f-strings in integrations starting with F * Use f-strings in tests for integrations starting with F * Use f-strings in integrations starting with G * Use f-strings in tests for integrations starting with G * Fix pylint error * Fix broken test
This commit is contained in:
1 parent
496bd3dddf
commit
ad102b3840
59 files changed
+219
-344
No files matched your search
@@ -168,7 +168,7 @@ class FlicButton(BinarySensorDevice):
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of the device."""
|
||||
return "flic_{}".format(self.address.replace(":", ""))
|
||||
return f"flic_{self.address.replace(':', '')}"
|
||||
|
||||
@property
|
||||
def address(self):
|
||||
@@ -192,9 +192,7 @@ class FlicButton(BinarySensorDevice):
|
||||
|
||||
def _queued_event_check(self, click_type, time_diff):
|
||||
"""Generate a log message and returns true if timeout exceeded."""
|
||||
time_string = "{:d} {}".format(
|
||||
time_diff, "second" if time_diff == 1 else "seconds"
|
||||
)
|
||||
time_string = f"{time_diff:d} {'second' if time_diff == 1 else 'seconds'}"
|
||||
|
||||
if time_diff > self._timeout:
|
||||
_LOGGER.warning(
|
||||
|
||||
Reference in new issue
Block a user