Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.amcrest.camera Namespace Reference

Classes

class  AmcrestCam
 
class  AmcrestCommandFailed
 
class  CannotSnapshot
 

Functions

None async_setup_platform (HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
 

Variables

list _ACTION = _ZOOM_ACTIONS + _MOVE_1_ACTIONS + _MOVE_2_ACTIONS
 
string _ATTR_COLOR_BW = "color_bw"
 
string _ATTR_PRESET = "preset"
 
string _ATTR_PTZ_MOV = "movement"
 
string _ATTR_PTZ_TT = "travel_time"
 
dictionary _BOOL_TO_STATE = {True: STATE_ON, False: STATE_OFF}
 
list _CBW = [_CBW_COLOR, _CBW_AUTO, _CBW_BW]
 
string _CBW_AUTO = "auto"
 
string _CBW_BW = "bw"
 
string _CBW_COLOR = "color"
 
float _DEFAULT_TT = 0.2
 
 _LOGGER = logging.getLogger(__name__)
 
list _MOV
 
list _MOVE_1_ACTIONS = ["Right", "Left", "Up", "Down"]
 
list _MOVE_2_ACTIONS = ["RightDown", "RightUp", "LeftDown", "LeftUp"]
 
string _SRV_CBW = "set_color_bw"
 
 _SRV_CBW_SCHEMA = _SRV_SCHEMA.extend({vol.Required(_ATTR_COLOR_BW): vol.In(_CBW)})
 
string _SRV_DS_AUD = "disable_audio"
 
string _SRV_DS_MOT_REC = "disable_motion_recording"
 
string _SRV_DS_REC = "disable_recording"
 
string _SRV_EN_AUD = "enable_audio"
 
string _SRV_EN_MOT_REC = "enable_motion_recording"
 
string _SRV_EN_REC = "enable_recording"
 
string _SRV_GOTO = "goto_preset"
 
 _SRV_GOTO_SCHEMA
 
string _SRV_PTZ_CTRL = "ptz_control"
 
 _SRV_PTZ_SCHEMA
 
 _SRV_SCHEMA = vol.Schema({vol.Optional(ATTR_ENTITY_ID): cv.comp_entity_ids})
 
string _SRV_TOUR_OFF = "stop_tour"
 
string _SRV_TOUR_ON = "start_tour"
 
list _ZOOM_ACTIONS = ["ZoomWide", "ZoomTele"]
 
dictionary CAMERA_SERVICES
 
 SCAN_INTERVAL = timedelta(seconds=15)
 
list STREAM_SOURCE_LIST = ["snapshot", "mjpeg", "rtsp"]
 

Detailed Description

Support for Amcrest IP cameras.

Function Documentation

◆ async_setup_platform()

None homeassistant.components.amcrest.camera.async_setup_platform ( HomeAssistant  hass,
ConfigType  config,
AddEntitiesCallback  async_add_entities,
DiscoveryInfoType | None   discovery_info = None 
)
Set up an Amcrest IP Camera.

Definition at line 126 of file camera.py.

Variable Documentation

◆ _ACTION

list homeassistant.components.amcrest.camera._ACTION = _ZOOM_ACTIONS + _MOVE_1_ACTIONS + _MOVE_2_ACTIONS
private

Definition at line 81 of file camera.py.

◆ _ATTR_COLOR_BW

string homeassistant.components.amcrest.camera._ATTR_COLOR_BW = "color_bw"
private

Definition at line 86 of file camera.py.

◆ _ATTR_PRESET

string homeassistant.components.amcrest.camera._ATTR_PRESET = "preset"
private

Definition at line 85 of file camera.py.

◆ _ATTR_PTZ_MOV

string homeassistant.components.amcrest.camera._ATTR_PTZ_MOV = "movement"
private

Definition at line 65 of file camera.py.

◆ _ATTR_PTZ_TT

string homeassistant.components.amcrest.camera._ATTR_PTZ_TT = "travel_time"
private

Definition at line 64 of file camera.py.

◆ _BOOL_TO_STATE

dictionary homeassistant.components.amcrest.camera._BOOL_TO_STATE = {True: STATE_ON, False: STATE_OFF}
private

Definition at line 123 of file camera.py.

◆ _CBW

list homeassistant.components.amcrest.camera._CBW = [_CBW_COLOR, _CBW_AUTO, _CBW_BW]
private

Definition at line 91 of file camera.py.

◆ _CBW_AUTO

string homeassistant.components.amcrest.camera._CBW_AUTO = "auto"
private

Definition at line 89 of file camera.py.

◆ _CBW_BW

string homeassistant.components.amcrest.camera._CBW_BW = "bw"
private

Definition at line 90 of file camera.py.

◆ _CBW_COLOR

string homeassistant.components.amcrest.camera._CBW_COLOR = "color"
private

Definition at line 88 of file camera.py.

◆ _DEFAULT_TT

float homeassistant.components.amcrest.camera._DEFAULT_TT = 0.2
private

Definition at line 83 of file camera.py.

◆ _LOGGER

homeassistant.components.amcrest.camera._LOGGER = logging.getLogger(__name__)
private

Definition at line 46 of file camera.py.

◆ _MOV

list homeassistant.components.amcrest.camera._MOV
private
Initial value:
1 = [
2  "zoom_out",
3  "zoom_in",
4  "right",
5  "left",
6  "up",
7  "down",
8  "right_down",
9  "right_up",
10  "left_down",
11  "left_up",
12 ]

Definition at line 66 of file camera.py.

◆ _MOVE_1_ACTIONS

list homeassistant.components.amcrest.camera._MOVE_1_ACTIONS = ["Right", "Left", "Up", "Down"]
private

Definition at line 79 of file camera.py.

◆ _MOVE_2_ACTIONS

list homeassistant.components.amcrest.camera._MOVE_2_ACTIONS = ["RightDown", "RightUp", "LeftDown", "LeftUp"]
private

Definition at line 80 of file camera.py.

◆ _SRV_CBW

string homeassistant.components.amcrest.camera._SRV_CBW = "set_color_bw"
private

Definition at line 59 of file camera.py.

◆ _SRV_CBW_SCHEMA

homeassistant.components.amcrest.camera._SRV_CBW_SCHEMA = _SRV_SCHEMA.extend({vol.Required(_ATTR_COLOR_BW): vol.In(_CBW)})
private

Definition at line 97 of file camera.py.

◆ _SRV_DS_AUD

string homeassistant.components.amcrest.camera._SRV_DS_AUD = "disable_audio"
private

Definition at line 55 of file camera.py.

◆ _SRV_DS_MOT_REC

string homeassistant.components.amcrest.camera._SRV_DS_MOT_REC = "disable_motion_recording"
private

Definition at line 57 of file camera.py.

◆ _SRV_DS_REC

string homeassistant.components.amcrest.camera._SRV_DS_REC = "disable_recording"
private

Definition at line 53 of file camera.py.

◆ _SRV_EN_AUD

string homeassistant.components.amcrest.camera._SRV_EN_AUD = "enable_audio"
private

Definition at line 54 of file camera.py.

◆ _SRV_EN_MOT_REC

string homeassistant.components.amcrest.camera._SRV_EN_MOT_REC = "enable_motion_recording"
private

Definition at line 56 of file camera.py.

◆ _SRV_EN_REC

string homeassistant.components.amcrest.camera._SRV_EN_REC = "enable_recording"
private

Definition at line 52 of file camera.py.

◆ _SRV_GOTO

string homeassistant.components.amcrest.camera._SRV_GOTO = "goto_preset"
private

Definition at line 58 of file camera.py.

◆ _SRV_GOTO_SCHEMA

homeassistant.components.amcrest.camera._SRV_GOTO_SCHEMA
private
Initial value:
1 = _SRV_SCHEMA.extend(
2  {vol.Required(_ATTR_PRESET): vol.All(vol.Coerce(int), vol.Range(min=1))}
3 )

Definition at line 94 of file camera.py.

◆ _SRV_PTZ_CTRL

string homeassistant.components.amcrest.camera._SRV_PTZ_CTRL = "ptz_control"
private

Definition at line 63 of file camera.py.

◆ _SRV_PTZ_SCHEMA

homeassistant.components.amcrest.camera._SRV_PTZ_SCHEMA
private
Initial value:
1 = _SRV_SCHEMA.extend(
2  {
3  vol.Required(_ATTR_PTZ_MOV): vol.In(_MOV),
4  vol.Optional(_ATTR_PTZ_TT, default=_DEFAULT_TT): cv.small_float,
5  }
6 )

Definition at line 98 of file camera.py.

◆ _SRV_SCHEMA

homeassistant.components.amcrest.camera._SRV_SCHEMA = vol.Schema({vol.Optional(ATTR_ENTITY_ID): cv.comp_entity_ids})
private

Definition at line 93 of file camera.py.

◆ _SRV_TOUR_OFF

string homeassistant.components.amcrest.camera._SRV_TOUR_OFF = "stop_tour"
private

Definition at line 61 of file camera.py.

◆ _SRV_TOUR_ON

string homeassistant.components.amcrest.camera._SRV_TOUR_ON = "start_tour"
private

Definition at line 60 of file camera.py.

◆ _ZOOM_ACTIONS

list homeassistant.components.amcrest.camera._ZOOM_ACTIONS = ["ZoomWide", "ZoomTele"]
private

Definition at line 78 of file camera.py.

◆ CAMERA_SERVICES

dictionary homeassistant.components.amcrest.camera.CAMERA_SERVICES
Initial value:
1 = {
2  _SRV_EN_REC: (_SRV_SCHEMA, "async_enable_recording", ()),
3  _SRV_DS_REC: (_SRV_SCHEMA, "async_disable_recording", ()),
4  _SRV_EN_AUD: (_SRV_SCHEMA, "async_enable_audio", ()),
5  _SRV_DS_AUD: (_SRV_SCHEMA, "async_disable_audio", ()),
6  _SRV_EN_MOT_REC: (_SRV_SCHEMA, "async_enable_motion_recording", ()),
7  _SRV_DS_MOT_REC: (_SRV_SCHEMA, "async_disable_motion_recording", ()),
8  _SRV_GOTO: (_SRV_GOTO_SCHEMA, "async_goto_preset", (_ATTR_PRESET,)),
9  _SRV_CBW: (_SRV_CBW_SCHEMA, "async_set_color_bw", (_ATTR_COLOR_BW,)),
10  _SRV_TOUR_ON: (_SRV_SCHEMA, "async_start_tour", ()),
11  _SRV_TOUR_OFF: (_SRV_SCHEMA, "async_stop_tour", ()),
12  _SRV_PTZ_CTRL: (
13  _SRV_PTZ_SCHEMA,
14  "async_ptz_control",
15  (_ATTR_PTZ_MOV, _ATTR_PTZ_TT),
16  ),
17 }

Definition at line 105 of file camera.py.

◆ SCAN_INTERVAL

homeassistant.components.amcrest.camera.SCAN_INTERVAL = timedelta(seconds=15)

Definition at line 48 of file camera.py.

◆ STREAM_SOURCE_LIST

list homeassistant.components.amcrest.camera.STREAM_SOURCE_LIST = ["snapshot", "mjpeg", "rtsp"]

Definition at line 50 of file camera.py.