1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 14:08:21 +00:00

Use literal string interpolation in integrations H-J (f-strings) (#26380)

This commit is contained in:
Franck Nijhof
2019-09-03 17:27:14 +02:00
committed by Pascal Vizeli
parent 13bb2ea35a
commit f9edec19ad
59 changed files with 128 additions and 139 deletions

View File

@@ -42,8 +42,8 @@ class HiveWaterHeater(WaterHeaterDevice):
self.node_name = hivedevice["Hive_NodeName"]
self.device_type = hivedevice["HA_DeviceType"]
self.session = hivesession
self.data_updatesource = "{}.{}".format(self.device_type, self.node_id)
self._unique_id = "{}-{}".format(self.node_id, self.device_type)
self.data_updatesource = f"{self.device_type}.{self.node_id}"
self._unique_id = f"{self.node_id}-{self.device_type}"
self._unit_of_measurement = TEMP_CELSIUS
@property
@@ -63,7 +63,7 @@ class HiveWaterHeater(WaterHeaterDevice):
def handle_update(self, updatesource):
"""Handle the new update request."""
if "{}.{}".format(self.device_type, self.node_id) not in updatesource:
if f"{self.device_type}.{self.node_id}" not in updatesource:
self.schedule_update_ha_state()
@property