Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.homematicip_cloud.hap.HomematicipHAP Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, ConfigEntry config_entry)
 
None async_connect (self)
 
None async_create_entity (self, *args, **kwargs)
 
None async_create_entity_lazy (self, is_device=True)
 
bool async_reset (self)
 
bool async_setup (self, int tries=0)
 
None async_update (self, *args, **kwargs)
 
AsyncHome get_hap (self, HomeAssistant hass, str|None hapid, str|None authtoken, str|None name)
 
None get_state (self)
 
None get_state_finished (self, future)
 
None set_all_to_unavailable (self)
 
None shutdown (self, event)
 
None update_all (self)
 

Public Attributes

 config_entry
 
 hass
 
 hmip_device_by_entity_id
 
 home
 

Private Attributes

 _accesspoint_connected
 
 _retry_task
 
 _tries
 
 _ws_close_requested
 

Detailed Description

Manages HomematicIP HTTP and WebSocket connection.

Definition at line 75 of file hap.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.homematicip_cloud.hap.HomematicipHAP.__init__ (   self,
HomeAssistant  hass,
ConfigEntry  config_entry 
)
Initialize HomematicIP Cloud connection.

Definition at line 80 of file hap.py.

Member Function Documentation

◆ async_connect()

None homeassistant.components.homematicip_cloud.hap.HomematicipHAP.async_connect (   self)
Start WebSocket connection.

Definition at line 183 of file hap.py.

◆ async_create_entity()

None homeassistant.components.homematicip_cloud.hap.HomematicipHAP.async_create_entity (   self,
args,
**  kwargs 
)
Create an entity or a group.

Definition at line 146 of file hap.py.

◆ async_create_entity_lazy()

None homeassistant.components.homematicip_cloud.hap.HomematicipHAP.async_create_entity_lazy (   self,
  is_device = True 
)
Delay entity creation to allow the user to enter a device name.

Definition at line 151 of file hap.py.

◆ async_reset()

bool homeassistant.components.homematicip_cloud.hap.HomematicipHAP.async_reset (   self)
Close the websocket connection.

Definition at line 217 of file hap.py.

◆ async_setup()

bool homeassistant.components.homematicip_cloud.hap.HomematicipHAP.async_setup (   self,
int   tries = 0 
)
Initialize connection.

Definition at line 92 of file hap.py.

◆ async_update()

None homeassistant.components.homematicip_cloud.hap.HomematicipHAP.async_update (   self,
args,
**  kwargs 
)
Async update the home device.

Triggered when the HMIP HOME_CHANGED event has fired.
There are several occasions for this event to happen.
1. We are interested to check whether the access point
is still connected. If not, entity state changes cannot
be forwarded to hass. So if access point is disconnected all devices
are set to unavailable.
2. We need to update home including devices and groups after a reconnect.
3. We need to update home without devices and groups in all other cases.

Definition at line 118 of file hap.py.

◆ get_hap()

AsyncHome homeassistant.components.homematicip_cloud.hap.HomematicipHAP.get_hap (   self,
HomeAssistant  hass,
str | None  hapid,
str | None  authtoken,
str | None  name 
)
Create a HomematicIP access point object.

Definition at line 241 of file hap.py.

◆ get_state()

None homeassistant.components.homematicip_cloud.hap.HomematicipHAP.get_state (   self)
Update HMIP state and tell Home Assistant.

Definition at line 157 of file hap.py.

◆ get_state_finished()

None homeassistant.components.homematicip_cloud.hap.HomematicipHAP.get_state_finished (   self,
  future 
)
Execute when get_state coroutine has finished.

Definition at line 162 of file hap.py.

◆ set_all_to_unavailable()

None homeassistant.components.homematicip_cloud.hap.HomematicipHAP.set_all_to_unavailable (   self)
Set all devices to unavailable and tell Home Assistant.

Definition at line 172 of file hap.py.

◆ shutdown()

None homeassistant.components.homematicip_cloud.hap.HomematicipHAP.shutdown (   self,
  event 
)
Wrap the call to async_reset.

Used as an argument to EventBus.async_listen_once.

Definition at line 231 of file hap.py.

◆ update_all()

None homeassistant.components.homematicip_cloud.hap.HomematicipHAP.update_all (   self)
Signal all devices to update their state.

Definition at line 178 of file hap.py.

Member Data Documentation

◆ _accesspoint_connected

homeassistant.components.homematicip_cloud.hap.HomematicipHAP._accesspoint_connected
private

Definition at line 88 of file hap.py.

◆ _retry_task

homeassistant.components.homematicip_cloud.hap.HomematicipHAP._retry_task
private

Definition at line 210 of file hap.py.

◆ _tries

homeassistant.components.homematicip_cloud.hap.HomematicipHAP._tries
private

Definition at line 87 of file hap.py.

◆ _ws_close_requested

homeassistant.components.homematicip_cloud.hap.HomematicipHAP._ws_close_requested
private

Definition at line 85 of file hap.py.

◆ config_entry

homeassistant.components.homematicip_cloud.hap.HomematicipHAP.config_entry

Definition at line 83 of file hap.py.

◆ hass

homeassistant.components.homematicip_cloud.hap.HomematicipHAP.hass

Definition at line 82 of file hap.py.

◆ hmip_device_by_entity_id

homeassistant.components.homematicip_cloud.hap.HomematicipHAP.hmip_device_by_entity_id

Definition at line 227 of file hap.py.

◆ home

homeassistant.components.homematicip_cloud.hap.HomematicipHAP.home

Definition at line 95 of file hap.py.


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