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

Public Member Functions

None __init__ (self, ZabbixSender zabbix_sender, Callable[[Event, set[str], set[str]], list[ZabbixMetric]|None] event_to_metrics)
 
tuple[int, list[ZabbixMetric]] get_metrics (self)
 
None run (self)
 
None setup (self, HomeAssistant hass)
 
None write_to_zabbix (self, list[ZabbixMetric] metrics)
 

Public Attributes

 event_to_metrics
 
 shutdown
 
 write_errors
 
 zabbix_sender
 

Static Public Attributes

int MAX_TRIES = 3
 

Private Member Functions

None _event_listener (self, Event[EventStateChangedData] event)
 
None _shutdown (self, Event event)
 

Detailed Description

A threaded event handler class.

Definition at line 171 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.zabbix.ZabbixThread.__init__ (   self,
ZabbixSender  zabbix_sender,
Callable[ [Event, set[str], set[str]], list[ZabbixMetric] | None ]  event_to_metrics 
)
Initialize the listener.

Definition at line 176 of file __init__.py.

Member Function Documentation

◆ _event_listener()

None homeassistant.components.zabbix.ZabbixThread._event_listener (   self,
Event[EventStateChangedData event 
)
private
Listen for new messages on the bus and queue them for Zabbix.

Definition at line 206 of file __init__.py.

◆ _shutdown()

None homeassistant.components.zabbix.ZabbixThread._shutdown (   self,
Event  event 
)
private
Shut down the thread.

Definition at line 200 of file __init__.py.

◆ get_metrics()

tuple[int, list[ZabbixMetric]] homeassistant.components.zabbix.ZabbixThread.get_metrics (   self)
Return a batch of events formatted for writing.

Definition at line 211 of file __init__.py.

◆ run()

None homeassistant.components.zabbix.ZabbixThread.run (   self)
Process incoming events.

Definition at line 267 of file __init__.py.

◆ setup()

None homeassistant.components.zabbix.ZabbixThread.setup (   self,
HomeAssistant  hass 
)
Set up the thread and start it.

Definition at line 193 of file __init__.py.

◆ write_to_zabbix()

None homeassistant.components.zabbix.ZabbixThread.write_to_zabbix (   self,
list[ZabbixMetric]  metrics 
)
Write preprocessed events to zabbix, with retry.

Definition at line 246 of file __init__.py.

Member Data Documentation

◆ event_to_metrics

homeassistant.components.zabbix.ZabbixThread.event_to_metrics

Definition at line 187 of file __init__.py.

◆ MAX_TRIES

int homeassistant.components.zabbix.ZabbixThread.MAX_TRIES = 3
static

Definition at line 174 of file __init__.py.

◆ shutdown

homeassistant.components.zabbix.ZabbixThread.shutdown

Definition at line 189 of file __init__.py.

◆ write_errors

homeassistant.components.zabbix.ZabbixThread.write_errors

Definition at line 188 of file __init__.py.

◆ zabbix_sender

homeassistant.components.zabbix.ZabbixThread.zabbix_sender

Definition at line 186 of file __init__.py.


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