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:
committed by
Pascal Vizeli
parent
13bb2ea35a
commit
f9edec19ad
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user