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

@@ -28,7 +28,7 @@ def no_application_protocol(value):
"""Validate that value is without the application protocol."""
protocol_separator = "://"
if not value or protocol_separator in value:
raise vol.Invalid("Invalid host, {} is not allowed".format(protocol_separator))
raise vol.Invalid(f"Invalid host, {protocol_separator} is not allowed")
return value
@@ -52,7 +52,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
password = config.get(CONF_PASSWORD)
host = config.get(CONF_HOST)
url = "http://{}".format(host)
url = f"http://{host}"
ialarm = IAlarmPanel(name, code, username, password, url)
add_entities([ialarm], True)