Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.amcrest.AmcrestChecker Class Reference
Inheritance diagram for homeassistant.components.amcrest.AmcrestChecker:
[legend]
Collaboration diagram for homeassistant.components.amcrest.AmcrestChecker:
[legend]

Public Member Functions

None __init__ (self, HomeAssistant hass, str name, str host, int port, str user, str password)
 
asyncio.Event async_available_flag (self)
 
httpx.Response async_command (self, *Any args, **Any kwargs)
 
AsyncIterator[httpx.Response] async_stream_command (self, *Any args, **Any kwargs)
 
bool available (self)
 
threading.Event available_flag (self)
 
Any command (self, *Any args, **Any kwargs)
 

Private Member Functions

AsyncIterator[None] _async_command_wrapper (self)
 
None _async_handle_error (self)
 
None _async_handle_offline (self, Exception ex)
 
None _async_set_online (self)
 
None _async_signal_online (self)
 
None _async_start_recovery (self)
 
None _handle_error (self)
 
bool _handle_error_thread_safe (self)
 
None _handle_offline (self, Exception ex)
 
bool _handle_offline_thread_safe (self, Exception ex)
 
None _set_online (self)
 
bool _set_online_thread_safe (self)
 
None _wrap_test_online (self, datetime now)
 

Private Attributes

 _async_wrap_event_flag
 
 _async_wrap_lock
 
 _hass
 
 _unsub_recheck
 
 _wrap_errors
 
 _wrap_event_flag
 
 _wrap_lock
 
 _wrap_login_err
 
 _wrap_name
 

Detailed Description

amcrest.ApiWrapper wrapper for catching errors.

Definition at line 132 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.amcrest.AmcrestChecker.__init__ (   self,
HomeAssistant  hass,
str  name,
str  host,
int  port,
str  user,
str  password 
)
Initialize.

Definition at line 135 of file __init__.py.

Member Function Documentation

◆ _async_command_wrapper()

AsyncIterator[None] homeassistant.components.amcrest.AmcrestChecker._async_command_wrapper (   self)
private

Definition at line 221 of file __init__.py.

◆ _async_handle_error()

None homeassistant.components.amcrest.AmcrestChecker._async_handle_error (   self)
private
Handle camera error status from the event loop.

Definition at line 278 of file __init__.py.

◆ _async_handle_offline()

None homeassistant.components.amcrest.AmcrestChecker._async_handle_offline (   self,
Exception  ex 
)
private

Definition at line 254 of file __init__.py.

◆ _async_set_online()

None homeassistant.components.amcrest.AmcrestChecker._async_set_online (   self)
private
Set camera online status from the event loop.

Definition at line 301 of file __init__.py.

◆ _async_signal_online()

None homeassistant.components.amcrest.AmcrestChecker._async_signal_online (   self)
private
Signal that camera is back online.

Definition at line 307 of file __init__.py.

◆ _async_start_recovery()

None homeassistant.components.amcrest.AmcrestChecker._async_start_recovery (   self)
private

Definition at line 181 of file __init__.py.

◆ _handle_error()

None homeassistant.components.amcrest.AmcrestChecker._handle_error (   self)
private
Handle camera error status from a thread.

Definition at line 271 of file __init__.py.

◆ _handle_error_thread_safe()

bool homeassistant.components.amcrest.AmcrestChecker._handle_error_thread_safe (   self)
private
Handle camera error status shared between threads and event loop.

Returns if the camera was online and is now offline as
a bool.

Definition at line 258 of file __init__.py.

◆ _handle_offline()

None homeassistant.components.amcrest.AmcrestChecker._handle_offline (   self,
Exception  ex 
)
private
Handle camera offline status from a thread.

Definition at line 248 of file __init__.py.

◆ _handle_offline_thread_safe()

bool homeassistant.components.amcrest.AmcrestChecker._handle_offline_thread_safe (   self,
Exception  ex 
)
private
Handle camera offline status shared between threads and event loop.

Returns if the camera was online as a bool.

Definition at line 235 of file __init__.py.

◆ _set_online()

None homeassistant.components.amcrest.AmcrestChecker._set_online (   self)
private
Set camera online status from a thread.

Definition at line 295 of file __init__.py.

◆ _set_online_thread_safe()

bool homeassistant.components.amcrest.AmcrestChecker._set_online_thread_safe (   self)
private
Set camera online status shared between threads and event loop.

Returns if the camera was offline as a bool.

Definition at line 284 of file __init__.py.

◆ _wrap_test_online()

None homeassistant.components.amcrest.AmcrestChecker._wrap_test_online (   self,
datetime  now 
)
private
Test if camera is back online.

Definition at line 319 of file __init__.py.

◆ async_available_flag()

asyncio.Event homeassistant.components.amcrest.AmcrestChecker.async_available_flag (   self)
Return event flag that indicates if camera's API is responding.

Definition at line 176 of file __init__.py.

◆ async_command()

httpx.Response homeassistant.components.amcrest.AmcrestChecker.async_command (   self,
*Any  args,
**Any  kwargs 
)
amcrest.ApiWrapper.command wrapper to catch errors.

Definition at line 204 of file __init__.py.

◆ async_stream_command()

AsyncIterator[httpx.Response] homeassistant.components.amcrest.AmcrestChecker.async_stream_command (   self,
*Any  args,
**Any   kwargs 
)
amcrest.ApiWrapper.command wrapper to catch errors.

Definition at line 210 of file __init__.py.

◆ available()

bool homeassistant.components.amcrest.AmcrestChecker.available (   self)
Return if camera's API is responding.

Definition at line 166 of file __init__.py.

◆ available_flag()

threading.Event homeassistant.components.amcrest.AmcrestChecker.available_flag (   self)
Return event flag that indicates if camera's API is responding.

Definition at line 171 of file __init__.py.

◆ command()

Any homeassistant.components.amcrest.AmcrestChecker.command (   self,
*Any  args,
**Any  kwargs 
)
amcrest.ApiWrapper.command wrapper to catch errors.

Definition at line 191 of file __init__.py.

Member Data Documentation

◆ _async_wrap_event_flag

homeassistant.components.amcrest.AmcrestChecker._async_wrap_event_flag
private

Definition at line 153 of file __init__.py.

◆ _async_wrap_lock

homeassistant.components.amcrest.AmcrestChecker._async_wrap_lock
private

Definition at line 149 of file __init__.py.

◆ _hass

homeassistant.components.amcrest.AmcrestChecker._hass
private

Definition at line 145 of file __init__.py.

◆ _unsub_recheck

homeassistant.components.amcrest.AmcrestChecker._unsub_recheck
private

Definition at line 187 of file __init__.py.

◆ _wrap_errors

homeassistant.components.amcrest.AmcrestChecker._wrap_errors
private

Definition at line 147 of file __init__.py.

◆ _wrap_event_flag

homeassistant.components.amcrest.AmcrestChecker._wrap_event_flag
private

Definition at line 151 of file __init__.py.

◆ _wrap_lock

homeassistant.components.amcrest.AmcrestChecker._wrap_lock
private

Definition at line 148 of file __init__.py.

◆ _wrap_login_err

homeassistant.components.amcrest.AmcrestChecker._wrap_login_err
private

Definition at line 150 of file __init__.py.

◆ _wrap_name

homeassistant.components.amcrest.AmcrestChecker._wrap_name
private

Definition at line 146 of file __init__.py.


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