Use literal string interpolation in integrations R-S (f-strings) (#26392)

This commit is contained in:
Franck Nijhof
2019-09-03 21:14:39 +02:00
committed by Pascal Vizeli
parent 7203027cbf
commit 445c741b30
69 changed files with 129 additions and 149 deletions
+2 -6
View File
@@ -217,9 +217,7 @@ async def async_handle_record_service(hass, call):
# Check for file access
if not hass.config.is_allowed_path(video_path):
raise HomeAssistantError(
"Can't write {}, no access to path!".format(video_path)
)
raise HomeAssistantError(f"Can't write {video_path}, no access to path!")
# Check for active stream
streams = hass.data[DOMAIN][ATTR_STREAMS]
@@ -231,9 +229,7 @@ async def async_handle_record_service(hass, call):
# Add recorder
recorder = stream.outputs.get("recorder")
if recorder:
raise HomeAssistantError(
"Stream already recording to {}!".format(recorder.video_path)
)
raise HomeAssistantError(f"Stream already recording to {recorder.video_path}!")
recorder = stream.add_provider("recorder")
recorder.video_path = video_path