Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.ubus.device_tracker.UbusDeviceScanner Class Reference
Inheritance diagram for homeassistant.components.ubus.device_tracker.UbusDeviceScanner:
[legend]
Collaboration diagram for homeassistant.components.ubus.device_tracker.UbusDeviceScanner:
[legend]

Public Member Functions

def __init__ (self, config)
 
dict[str, str] async_get_extra_attributes (self, str device)
 
def get_device_name (self, device)
 
def scan_devices (self)
 

Public Attributes

 host
 
 hostapd
 
 last_results
 
 mac2name
 
 parse_api_pattern
 
 password
 
 success_init
 
 ubus
 
 url
 
 username
 

Private Member Functions

def _generate_mac2name (self)
 
def _update_info (self)
 

Detailed Description

Class which queries a wireless router running OpenWrt firmware.

Adapted from Tomato scanner.

Definition at line 73 of file device_tracker.py.

Constructor & Destructor Documentation

◆ __init__()

def homeassistant.components.ubus.device_tracker.UbusDeviceScanner.__init__ (   self,
  config 
)
Initialize the scanner.

Reimplemented in homeassistant.components.ubus.device_tracker.DnsmasqUbusDeviceScanner.

Definition at line 79 of file device_tracker.py.

Member Function Documentation

◆ _generate_mac2name()

def homeassistant.components.ubus.device_tracker.UbusDeviceScanner._generate_mac2name (   self)
private
Return empty MAC to name dict. Overridden if DHCP server is set.

Reimplemented in homeassistant.components.ubus.device_tracker.OdhcpdUbusDeviceScanner, and homeassistant.components.ubus.device_tracker.DnsmasqUbusDeviceScanner.

Definition at line 99 of file device_tracker.py.

◆ _update_info()

def homeassistant.components.ubus.device_tracker.UbusDeviceScanner._update_info (   self)
private
Ensure the information from the router is up to date.

Returns boolean if scanning successful.

Definition at line 118 of file device_tracker.py.

◆ async_get_extra_attributes()

dict[str, str] homeassistant.components.ubus.device_tracker.UbusDeviceScanner.async_get_extra_attributes (   self,
str  device 
)
Return the host to distinguish between multiple routers.

Definition at line 113 of file device_tracker.py.

◆ get_device_name()

def homeassistant.components.ubus.device_tracker.UbusDeviceScanner.get_device_name (   self,
  device 
)
Return the name of the given device or None if we don't know.

Definition at line 104 of file device_tracker.py.

◆ scan_devices()

def homeassistant.components.ubus.device_tracker.UbusDeviceScanner.scan_devices (   self)
Scan for new devices and return a list with found device IDs.

Definition at line 94 of file device_tracker.py.

Member Data Documentation

◆ host

homeassistant.components.ubus.device_tracker.UbusDeviceScanner.host

Definition at line 81 of file device_tracker.py.

◆ hostapd

homeassistant.components.ubus.device_tracker.UbusDeviceScanner.hostapd

Definition at line 90 of file device_tracker.py.

◆ last_results

homeassistant.components.ubus.device_tracker.UbusDeviceScanner.last_results

Definition at line 86 of file device_tracker.py.

◆ mac2name

homeassistant.components.ubus.device_tracker.UbusDeviceScanner.mac2name

Definition at line 91 of file device_tracker.py.

◆ parse_api_pattern

homeassistant.components.ubus.device_tracker.UbusDeviceScanner.parse_api_pattern

Definition at line 85 of file device_tracker.py.

◆ password

homeassistant.components.ubus.device_tracker.UbusDeviceScanner.password

Definition at line 83 of file device_tracker.py.

◆ success_init

homeassistant.components.ubus.device_tracker.UbusDeviceScanner.success_init

Definition at line 92 of file device_tracker.py.

◆ ubus

homeassistant.components.ubus.device_tracker.UbusDeviceScanner.ubus

Definition at line 89 of file device_tracker.py.

◆ url

homeassistant.components.ubus.device_tracker.UbusDeviceScanner.url

Definition at line 87 of file device_tracker.py.

◆ username

homeassistant.components.ubus.device_tracker.UbusDeviceScanner.username

Definition at line 82 of file device_tracker.py.


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