Use literal string interpolation in integrations T-W (f-strings) (#26394)

This commit is contained in:
Franck Nijhof 2019-09-03 21:12:51 +02:00 committed by Pascal Vizeli
parent cde09062c4
commit ef0e9431b6
50 changed files with 128 additions and 132 deletions

View file

@ -96,12 +96,12 @@ class WorldTidesInfoSensor(Entity):
tidetime = time.strftime(
"%I:%M %p", time.localtime(self.data["extremes"][0]["dt"])
)
return "High tide at {}".format(tidetime)
return f"High tide at {tidetime}"
if "Low" in str(self.data["extremes"][0]["type"]):
tidetime = time.strftime(
"%I:%M %p", time.localtime(self.data["extremes"][0]["dt"])
)
return "Low tide at {}".format(tidetime)
return f"Low tide at {tidetime}"
return None
return None