Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions homeassistant/components/camera/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ record:
description: (Optional) Target lookback period (in seconds) to include in addition to duration. Only available if there is currently an active HLS stream.
example: 4

local_file_update_file_path:
description: Update the file_path for a local_file camera.
fields:
entity_id:
description: Name(s) of entities to update.
example: 'camera.local_file'
file_path:
description: Path to the new image file.
example: '/images/newimage.jpg'

onvif_ptz:
description: Pan/Tilt/Zoom service for ONVIF camera.
fields:
Expand Down
14 changes: 8 additions & 6 deletions homeassistant/components/local_file/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@
CAMERA_SERVICE_SCHEMA,
PLATFORM_SCHEMA,
)
from homeassistant.components.camera.const import DOMAIN
from homeassistant.helpers import config_validation as cv

_LOGGER = logging.getLogger(__name__)
from .const import (
CONF_FILE_PATH,
DATA_LOCAL_FILE,
DEFAULT_NAME,
DOMAIN,
SERVICE_UPDATE_FILE_PATH,
)

CONF_FILE_PATH = "file_path"
DATA_LOCAL_FILE = "local_file_cameras"
DEFAULT_NAME = "Local File"
SERVICE_UPDATE_FILE_PATH = "local_file_update_file_path"
_LOGGER = logging.getLogger(__name__)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{
Expand Down
6 changes: 6 additions & 0 deletions homeassistant/components/local_file/const.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Constants for the Local File Camera component."""
DOMAIN = "local_file"
SERVICE_UPDATE_FILE_PATH = "update_file_path"
CONF_FILE_PATH = "file_path"
DATA_LOCAL_FILE = "local_file_cameras"
DEFAULT_NAME = "Local File"
2 changes: 1 addition & 1 deletion homeassistant/components/local_file/services.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local_file_update_file_path:
update_file_path:
description: Use this service to change the file displayed by the camera.
fields:
entity_id:
Expand Down
3 changes: 1 addition & 2 deletions tests/components/local_file/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import asyncio
from unittest import mock

from homeassistant.components.camera.const import DOMAIN
from homeassistant.components.local_file.camera import SERVICE_UPDATE_FILE_PATH
from homeassistant.components.local_file.const import DOMAIN, SERVICE_UPDATE_FILE_PATH
from homeassistant.setup import async_setup_component

from tests.common import mock_registry
Expand Down