Use f-strings in integrations starting with "H" - "L" (#32265)

* Use f-strings in integrations starting with "H"

* Use f-strings in integrations starting with "I"

* Use f-strings in integrations starting with "J"

* Use f-strings in integrations starting with "K"

* Use f-strings in integrations starting with "L"

* Fix lint error

* Use join instead of f-string in homekit_controller

* Use local variables with f-strings

* Fix lint error

* Escape the characters in f-string

* Sort imports with isort in homeworks light

* Fix pylint error

* Fix broken tests

* Fix broken tests v2
This commit is contained in:
springstan 2020-02-28 12:39:29 +01:00 committed by GitHub
parent 7714160f4c
commit 157f972d72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
77 changed files with 158 additions and 246 deletions

View file

@ -102,9 +102,7 @@ def validate_entity_config(values):
domain, _ = split_entity_id(entity)
if not isinstance(config, dict):
raise vol.Invalid(
"The configuration for {} must be a dictionary.".format(entity)
)
raise vol.Invalid(f"The configuration for {entity} must be a dictionary.")
if domain in ("alarm_control_panel", "lock"):
config = CODE_SCHEMA(config)
@ -212,8 +210,8 @@ def show_setup_message(hass, pincode):
pin = pincode.decode()
_LOGGER.info("Pincode: %s", pin)
message = (
"To set up Home Assistant in the Home App, enter the "
"following code:\n### {}".format(pin)
f"To set up Home Assistant in the Home App, enter the "
f"following code:\n### {pin}"
)
hass.components.persistent_notification.create(
message, "HomeKit Setup", HOMEKIT_NOTIFY_ID