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 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

@@ -33,8 +33,8 @@ class HiveDeviceLight(Light):
self.light_device_type = hivedevice["Hive_Light_DeviceType"]
self.session = hivesession
self.attributes = {}
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.session.entities.append(self)
@property
@@ -49,7 +49,7 @@ class HiveDeviceLight(Light):
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