Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.reolink.host.ReolinkHost Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, Mapping[str, Any] config, Mapping[str, Any] options)
 
Host api (self)
 
None async_init (self)
 
None async_register_update_cmd (self, str cmd, int|None channel=None)
 
None async_unregister_update_cmd (self, str cmd, int|None channel=None)
 
None disconnect (self)
 
str event_connection (self)
 
None handle_webhook (self, HomeAssistant hass, str webhook_id, Request request)
 
None register_webhook (self)
 
None renew (self)
 
None stop (self, *Any _)
 
None subscribe (self)
 
str unique_id (self)
 
None unregister_webhook (self)
 
None update_states (self)
 

Public Attributes

 last_wake
 
 webhook_id
 

Private Member Functions

None _async_check_onvif (self, *Any _)
 
None _async_check_onvif_long_poll (self, *Any _)
 
None _async_check_tcp_push (self, *Any _)
 
None _async_long_polling (self, *Any _)
 
None _async_poll_all_motion (self, *Any _)
 
None _async_start_long_polling (self, bool initial=False)
 
None _async_stop_long_polling (self)
 
None _process_webhook_data (self, HomeAssistant hass, str webhook_id, bytes|None data)
 
None _renew (self, Literal[SubType.push, SubType.long_poll] sub_type)
 
None _signal_write_ha_state (self, list[int]|None channels=None)
 

Private Attributes

 _api
 
 _base_url
 
 _cancel_long_poll_check
 
 _cancel_onvif_check
 
 _cancel_poll
 
 _cancel_tcp_push_check
 
 _fast_poll_error
 
 _long_poll_error
 
 _long_poll_received
 
 _long_poll_task
 
 _lost_subscription
 
 _onvif_long_poll_supported
 
 _onvif_push_supported
 
 _poll_job
 
 _unique_id
 
 _webhook_reachable
 
 _webhook_url
 

Detailed Description

The implementation of the Reolink Host class.

Definition at line 59 of file host.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.reolink.host.ReolinkHost.__init__ (   self,
HomeAssistant  hass,
Mapping[str, Any]  config,
Mapping[str, Any]  options 
)
Initialize Reolink Host. Could be either NVR, or Camera.

Definition at line 62 of file host.py.

Member Function Documentation

◆ _async_check_onvif()

None homeassistant.components.reolink.host.ReolinkHost._async_check_onvif (   self,
*Any  _ 
)
private
Check the ONVIF subscription.

Definition at line 326 of file host.py.

◆ _async_check_onvif_long_poll()

None homeassistant.components.reolink.host.ReolinkHost._async_check_onvif_long_poll (   self,
*Any  _ 
)
private
Check if ONVIF long polling is working.

Definition at line 347 of file host.py.

◆ _async_check_tcp_push()

None homeassistant.components.reolink.host.ReolinkHost._async_check_tcp_push (   self,
*Any  _ 
)
private
Check the TCP push subscription.

Definition at line 265 of file host.py.

◆ _async_long_polling()

None homeassistant.components.reolink.host.ReolinkHost._async_long_polling (   self,
*Any  _ 
)
private
Use ONVIF long polling to immediately receive events.

Definition at line 656 of file host.py.

◆ _async_poll_all_motion()

None homeassistant.components.reolink.host.ReolinkHost._async_poll_all_motion (   self,
*Any  _ 
)
private
Poll motion and AI states until the first ONVIF push is received.

Definition at line 693 of file host.py.

◆ _async_start_long_polling()

None homeassistant.components.reolink.host.ReolinkHost._async_start_long_polling (   self,
bool   initial = False 
)
private
Start ONVIF long polling task.

Definition at line 453 of file host.py.

◆ _async_stop_long_polling()

None homeassistant.components.reolink.host.ReolinkHost._async_stop_long_polling (   self)
private
Stop ONVIF long polling task.

Definition at line 482 of file host.py.

◆ _process_webhook_data()

None homeassistant.components.reolink.host.ReolinkHost._process_webhook_data (   self,
HomeAssistant  hass,
str  webhook_id,
bytes | None   data 
)
private
Process the data from the Reolink webhook.

Definition at line 768 of file host.py.

◆ _renew()

None homeassistant.components.reolink.host.ReolinkHost._renew (   self,
Literal[SubType.push, SubType.long_poll]  sub_type 
)
private
Execute the renew of the subscription.

Definition at line 569 of file host.py.

◆ _signal_write_ha_state()

None homeassistant.components.reolink.host.ReolinkHost._signal_write_ha_state (   self,
list[int] | None   channels = None 
)
private
Update the binary sensors with async_write_ha_state.

Definition at line 798 of file host.py.

◆ api()

Host homeassistant.components.reolink.host.ReolinkHost.api (   self)
Return the API object.

Definition at line 137 of file host.py.

◆ async_init()

None homeassistant.components.reolink.host.ReolinkHost.async_init (   self)
Connect to Reolink host.

Definition at line 141 of file host.py.

◆ async_register_update_cmd()

None homeassistant.components.reolink.host.ReolinkHost.async_register_update_cmd (   self,
str  cmd,
int | None   channel = None 
)
Register the command to update the state.

Definition at line 118 of file host.py.

◆ async_unregister_update_cmd()

None homeassistant.components.reolink.host.ReolinkHost.async_unregister_update_cmd (   self,
str  cmd,
int | None   channel = None 
)
Unregister the command to update the state.

Definition at line 123 of file host.py.

◆ disconnect()

None homeassistant.components.reolink.host.ReolinkHost.disconnect (   self)
Disconnect from the API, so the connection will be released.

Definition at line 421 of file host.py.

◆ event_connection()

str homeassistant.components.reolink.host.ReolinkHost.event_connection (   self)
Type of connection to receive events.

Definition at line 808 of file host.py.

◆ handle_webhook()

None homeassistant.components.reolink.host.ReolinkHost.handle_webhook (   self,
HomeAssistant  hass,
str  webhook_id,
Request   request 
)
Read the incoming webhook from Reolink for inbound messages and schedule processing.

Definition at line 728 of file host.py.

◆ register_webhook()

None homeassistant.components.reolink.host.ReolinkHost.register_webhook (   self)
Register the webhook for motion events.

Definition at line 620 of file host.py.

◆ renew()

None homeassistant.components.reolink.host.ReolinkHost.renew (   self)
Renew the subscription of motion events (lease time is 15 minutes).

Definition at line 537 of file host.py.

◆ stop()

None homeassistant.components.reolink.host.ReolinkHost.stop (   self,
*Any  _ 
)
Disconnect the API.

Definition at line 498 of file host.py.

◆ subscribe()

None homeassistant.components.reolink.host.ReolinkHost.subscribe (   self)
Subscribe to motion events and register the webhook as a callback.

Definition at line 516 of file host.py.

◆ unique_id()

str homeassistant.components.reolink.host.ReolinkHost.unique_id (   self)
Create the unique ID, base for all entities.

Definition at line 132 of file host.py.

◆ unregister_webhook()

None homeassistant.components.reolink.host.ReolinkHost.unregister_webhook (   self)
Unregister the webhook for motion events.

Definition at line 648 of file host.py.

◆ update_states()

None homeassistant.components.reolink.host.ReolinkHost.update_states (   self)
Call the API of the camera device to update the internal states.

Definition at line 411 of file host.py.

Member Data Documentation

◆ _api

homeassistant.components.reolink.host.ReolinkHost._api
private

Definition at line 80 of file host.py.

◆ _base_url

homeassistant.components.reolink.host.ReolinkHost._base_url
private

Definition at line 632 of file host.py.

◆ _cancel_long_poll_check

homeassistant.components.reolink.host.ReolinkHost._cancel_long_poll_check
private

Definition at line 318 of file host.py.

◆ _cancel_onvif_check

homeassistant.components.reolink.host.ReolinkHost._cancel_onvif_check
private

Definition at line 297 of file host.py.

◆ _cancel_poll

homeassistant.components.reolink.host.ReolinkHost._cancel_poll
private

Definition at line 502 of file host.py.

◆ _cancel_tcp_push_check

homeassistant.components.reolink.host.ReolinkHost._cancel_tcp_push_check
private

Definition at line 231 of file host.py.

◆ _fast_poll_error

homeassistant.components.reolink.host.ReolinkHost._fast_poll_error
private

Definition at line 715 of file host.py.

◆ _long_poll_error

homeassistant.components.reolink.host.ReolinkHost._long_poll_error
private

Definition at line 672 of file host.py.

◆ _long_poll_received

homeassistant.components.reolink.host.ReolinkHost._long_poll_received
private

Definition at line 685 of file host.py.

◆ _long_poll_task

homeassistant.components.reolink.host.ReolinkHost._long_poll_task
private

Definition at line 480 of file host.py.

◆ _lost_subscription

homeassistant.components.reolink.host.ReolinkHost._lost_subscription
private

Definition at line 463 of file host.py.

◆ _onvif_long_poll_supported

homeassistant.components.reolink.host.ReolinkHost._onvif_long_poll_supported
private

Definition at line 163 of file host.py.

◆ _onvif_push_supported

homeassistant.components.reolink.host.ReolinkHost._onvif_push_supported
private

Definition at line 162 of file host.py.

◆ _poll_job

homeassistant.components.reolink.host.ReolinkHost._poll_job
private

Definition at line 112 of file host.py.

◆ _unique_id

homeassistant.components.reolink.host.ReolinkHost._unique_id
private

Definition at line 222 of file host.py.

◆ _webhook_reachable

homeassistant.components.reolink.host.ReolinkHost._webhook_reachable
private

Definition at line 775 of file host.py.

◆ _webhook_url

homeassistant.components.reolink.host.ReolinkHost._webhook_url
private

Definition at line 644 of file host.py.

◆ last_wake

homeassistant.components.reolink.host.ReolinkHost.last_wake

Definition at line 417 of file host.py.

◆ webhook_id

homeassistant.components.reolink.host.ReolinkHost.webhook_id

Definition at line 622 of file host.py.


The documentation for this class was generated from the following file: