mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Remove service and config schemas from foscam (#45154)
This commit is contained in:
parent
9dbf14188a
commit
2e42a862b0
@ -1,8 +1,6 @@
|
||||
"""The foscam component."""
|
||||
import asyncio
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
@ -10,8 +8,6 @@ from .const import DOMAIN, SERVICE_PTZ
|
||||
|
||||
PLATFORMS = ["camera"]
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema({DOMAIN: vol.Schema({})}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
async def async_setup(hass: HomeAssistant, config: dict):
|
||||
"""Set up the foscam component."""
|
||||
|
@ -7,7 +7,6 @@ import voluptuous as vol
|
||||
from homeassistant.components.camera import PLATFORM_SCHEMA, SUPPORT_STREAM, Camera
|
||||
from homeassistant.config_entries import SOURCE_IMPORT
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID,
|
||||
CONF_HOST,
|
||||
CONF_NAME,
|
||||
CONF_PASSWORD,
|
||||
@ -56,26 +55,6 @@ ATTR_MOVEMENT = "movement"
|
||||
ATTR_TRAVELTIME = "travel_time"
|
||||
|
||||
|
||||
SERVICE_PTZ_SCHEMA = vol.Schema(
|
||||
{
|
||||
vol.Required(ATTR_ENTITY_ID): cv.entity_ids,
|
||||
vol.Required(ATTR_MOVEMENT): vol.In(
|
||||
[
|
||||
DIR_UP,
|
||||
DIR_DOWN,
|
||||
DIR_LEFT,
|
||||
DIR_RIGHT,
|
||||
DIR_TOPLEFT,
|
||||
DIR_TOPRIGHT,
|
||||
DIR_BOTTOMLEFT,
|
||||
DIR_BOTTOMRIGHT,
|
||||
]
|
||||
),
|
||||
vol.Optional(ATTR_TRAVELTIME, default=DEFAULT_TRAVELTIME): cv.small_float,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||
"""Set up a Foscam IP Camera."""
|
||||
LOGGER.warning(
|
||||
@ -102,7 +81,23 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
"""Add a Foscam IP camera from a config entry."""
|
||||
platform = entity_platform.current_platform.get()
|
||||
platform.async_register_entity_service(
|
||||
SERVICE_PTZ, SERVICE_PTZ_SCHEMA, "async_perform_ptz"
|
||||
SERVICE_PTZ,
|
||||
{
|
||||
vol.Required(ATTR_MOVEMENT): vol.In(
|
||||
[
|
||||
DIR_UP,
|
||||
DIR_DOWN,
|
||||
DIR_LEFT,
|
||||
DIR_RIGHT,
|
||||
DIR_TOPLEFT,
|
||||
DIR_TOPRIGHT,
|
||||
DIR_BOTTOMLEFT,
|
||||
DIR_BOTTOMRIGHT,
|
||||
]
|
||||
),
|
||||
vol.Optional(ATTR_TRAVELTIME, default=DEFAULT_TRAVELTIME): cv.small_float,
|
||||
},
|
||||
"async_perform_ptz",
|
||||
)
|
||||
|
||||
camera = FoscamCamera(
|
||||
|
Loading…
x
Reference in New Issue
Block a user