Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.azure_event_hub.AzureEventHub Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, ConfigEntry entry, EntityFilter entities_filter)
 
None async_listen (self, Event event)
 
None async_send (self, _)
 
None async_start (self)
 
None async_stop (self)
 
None async_test_connection (self)
 
EventDataBatch fill_batch (self, EventHubProducerClient client)
 
None update_options (self, MappingProxyType[str, Any] new_options)
 

Public Attributes

 hass
 

Private Member Functions

tuple[EventData|None, int] _parse_event (self, datetime time_fired, State|None state, int dropped)
 
None _schedule_next_send (self)
 

Private Attributes

 _client
 
 _entities_filter
 
 _entry
 
 _listener_remover
 
 _max_delay
 
 _next_send_remover
 
 _send_interval
 
 _shutdown
 

Detailed Description

A event handler class for Azure Event Hub.

Definition at line 132 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.azure_event_hub.AzureEventHub.__init__ (   self,
HomeAssistant  hass,
ConfigEntry  entry,
EntityFilter  entities_filter 
)
Initialize the listener.

Definition at line 135 of file __init__.py.

Member Function Documentation

◆ _parse_event()

tuple[EventData | None, int] homeassistant.components.azure_event_hub.AzureEventHub._parse_event (   self,
datetime  time_fired,
State | None  state,
int   dropped 
)
private
Parse event by checking if it needs to be sent, and format it.

Definition at line 246 of file __init__.py.

◆ _schedule_next_send()

None homeassistant.components.azure_event_hub.AzureEventHub._schedule_next_send (   self)
private
Schedule the next send.

Definition at line 190 of file __init__.py.

◆ async_listen()

None homeassistant.components.azure_event_hub.AzureEventHub.async_listen (   self,
Event  event 
)
Listen for new messages on the bus and queue them for AEH.

Definition at line 197 of file __init__.py.

◆ async_send()

None homeassistant.components.azure_event_hub.AzureEventHub.async_send (   self,
  _ 
)
Write preprocessed events to eventhub, with retry.

Definition at line 202 of file __init__.py.

◆ async_start()

None homeassistant.components.azure_event_hub.AzureEventHub.async_start (   self)
Start the hub.

This suppresses logging and register the listener and
schedules the first send.

Suppress the INFO and below logging on the underlying packages,
they are very verbose, even at INFO.

Definition at line 157 of file __init__.py.

◆ async_stop()

None homeassistant.components.azure_event_hub.AzureEventHub.async_stop (   self)
Shut down the AEH by queueing None, calling send, join queue.

Definition at line 172 of file __init__.py.

◆ async_test_connection()

None homeassistant.components.azure_event_hub.AzureEventHub.async_test_connection (   self)
Test the connection to the event hub.

Definition at line 186 of file __init__.py.

◆ fill_batch()

EventDataBatch homeassistant.components.azure_event_hub.AzureEventHub.fill_batch (   self,
EventHubProducerClient  client 
)
Return a batch of events formatted for sending to Event Hub.

Uses get_nowait instead of await get, because the functions batches and
doesn't wait for each single event.

Throws ValueError on add to batch when the EventDataBatch object reaches
max_size. Put the item back in the queue and the next batch will include
it.

Definition at line 214 of file __init__.py.

◆ update_options()

None homeassistant.components.azure_event_hub.AzureEventHub.update_options (   self,
MappingProxyType[str, Any]  new_options 
)
Update options.

Definition at line 182 of file __init__.py.

Member Data Documentation

◆ _client

homeassistant.components.azure_event_hub.AzureEventHub._client
private

Definition at line 146 of file __init__.py.

◆ _entities_filter

homeassistant.components.azure_event_hub.AzureEventHub._entities_filter
private

Definition at line 144 of file __init__.py.

◆ _entry

homeassistant.components.azure_event_hub.AzureEventHub._entry
private

Definition at line 143 of file __init__.py.

◆ _listener_remover

homeassistant.components.azure_event_hub.AzureEventHub._listener_remover
private

Definition at line 167 of file __init__.py.

◆ _max_delay

homeassistant.components.azure_event_hub.AzureEventHub._max_delay
private

Definition at line 148 of file __init__.py.

◆ _next_send_remover

homeassistant.components.azure_event_hub.AzureEventHub._next_send_remover
private

Definition at line 193 of file __init__.py.

◆ _send_interval

homeassistant.components.azure_event_hub.AzureEventHub._send_interval
private

Definition at line 147 of file __init__.py.

◆ _shutdown

homeassistant.components.azure_event_hub.AzureEventHub._shutdown
private

Definition at line 150 of file __init__.py.

◆ hass

homeassistant.components.azure_event_hub.AzureEventHub.hass

Definition at line 142 of file __init__.py.


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