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 authored and GitHub committed 2020-02-28 12:39:29 +01:00
1 parent 7714160f4c
commit 157f972d72
77 files changed
+158 -246

No files matched your search

+3 -9
View File
@@ -318,13 +318,9 @@ def humanify(hass, events):
if entity_id:
state = hass.states.get(entity_id)
name = state.name if state else entity_id
message = "send command {}/{} for {}".format(
data["request"]["namespace"], data["request"]["name"], name
)
message = f"send command {data['request']['namespace']}/{data['request']['name']} for {name}"
else:
message = "send command {}/{}".format(
data["request"]["namespace"], data["request"]["name"]
)
message = f"send command {data['request']['namespace']}/{data['request']['name']}"
yield {
"when": event.time_fired,
@@ -342,9 +338,7 @@ def humanify(hass, events):
value = data.get(ATTR_VALUE)
value_msg = f" to {value}" if value else ""
message = "send command {}{} for {}".format(
data[ATTR_SERVICE], value_msg, data[ATTR_DISPLAY_NAME]
)
message = f"send command {data[ATTR_SERVICE]}{value_msg} for {data[ATTR_DISPLAY_NAME]}"
yield {
"when": event.time_fired,