mirror of
https://github.com/elisspace/core.git
synced 2026-09-29 13:59:54 +00:00
Use literal string interpolation in integrations R-S (f-strings) (#26392)
This commit is contained in:
committed by
Pascal Vizeli
parent
7203027cbf
commit
445c741b30
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user