Use literal string interpolation in integrations B-D (f-strings) (#26378)
This commit is contained in:
1 parent
105461edb5
commit
6a24d893c8
52 files changed
+116
-126
No files matched your search
@@ -65,7 +65,7 @@ class DdWrtDeviceScanner(DeviceScanner):
|
||||
self.mac2name = {}
|
||||
|
||||
# Test the router is accessible
|
||||
url = "{}://{}/Status_Wireless.live.asp".format(self.protocol, self.host)
|
||||
url = f"{self.protocol}://{self.host}/Status_Wireless.live.asp"
|
||||
data = self.get_ddwrt_data(url)
|
||||
if not data:
|
||||
raise ConnectionError("Cannot connect to DD-Wrt router")
|
||||
@@ -80,7 +80,7 @@ class DdWrtDeviceScanner(DeviceScanner):
|
||||
"""Return the name of the given device or None if we don't know."""
|
||||
# If not initialised and not already scanned and not found.
|
||||
if device not in self.mac2name:
|
||||
url = "{}://{}/Status_Lan.live.asp".format(self.protocol, self.host)
|
||||
url = f"{self.protocol}://{self.host}/Status_Lan.live.asp"
|
||||
data = self.get_ddwrt_data(url)
|
||||
|
||||
if not data:
|
||||
@@ -115,7 +115,7 @@ class DdWrtDeviceScanner(DeviceScanner):
|
||||
_LOGGER.info("Checking ARP")
|
||||
|
||||
endpoint = "Wireless" if self.wireless_only else "Lan"
|
||||
url = "{}://{}/Status_{}.live.asp".format(self.protocol, self.host, endpoint)
|
||||
url = f"{self.protocol}://{self.host}/Status_{endpoint}.live.asp"
|
||||
data = self.get_ddwrt_data(url)
|
||||
|
||||
if not data:
|
||||
|
||||
Reference in new issue
Block a user