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
@@ -84,7 +84,7 @@ def _validate_schema(config):
|
||||
LOCATIONS_MSG = "Set '{}' to one of: {}".format(
|
||||
CONF_LOCATION, ", ".join(sorted(LOCATIONS))
|
||||
)
|
||||
XOR_MSG = "Specify exactly one of '{}' or '{}'".format(CONF_ID, CONF_LOCATION)
|
||||
XOR_MSG = f"Specify exactly one of '{CONF_ID}' or '{CONF_LOCATION}'"
|
||||
|
||||
PLATFORM_SCHEMA = vol.All(
|
||||
PLATFORM_SCHEMA.extend(
|
||||
@@ -106,7 +106,7 @@ PLATFORM_SCHEMA = vol.All(
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up BOM radar-loop camera component."""
|
||||
location = config.get(CONF_LOCATION) or "ID {}".format(config.get(CONF_ID))
|
||||
name = config.get(CONF_NAME) or "BOM Radar Loop - {}".format(location)
|
||||
name = config.get(CONF_NAME) or f"BOM Radar Loop - {location}"
|
||||
args = [
|
||||
config.get(x)
|
||||
for x in (CONF_LOCATION, CONF_ID, CONF_DELTA, CONF_FRAMES, CONF_OUTFILE)
|
||||
|
||||
Reference in new issue
Block a user