Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.dhcp Namespace Reference

Namespaces

 const
 

Classes

class  DeviceTrackerRegisteredWatcher
 
class  DeviceTrackerWatcher
 
class  DhcpMatchers
 
class  DhcpServiceInfo
 
class  DHCPWatcher
 
class  NetworkWatcher
 
class  RediscoveryWatcher
 
class  WatcherBase
 

Functions

re.Pattern _compile_fnmatch (str pattern)
 
bool _memorized_fnmatch (str name, str pattern)
 
DhcpMatchers async_index_integration_matchers (list[DHCPMatcher] integration_matchers)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
 
 Final
 
 SCAN_INTERVAL = timedelta(minutes=60)
 

Detailed Description

The dhcp integration.

Function Documentation

◆ _compile_fnmatch()

re.Pattern homeassistant.components.dhcp._compile_fnmatch ( str  pattern)
private
Compile a fnmatch pattern.

Definition at line 471 of file __init__.py.

◆ _memorized_fnmatch()

bool homeassistant.components.dhcp._memorized_fnmatch ( str  name,
str  pattern 
)
private
Memorized version of fnmatch that has a larger lru_cache.

The default version of fnmatch only has a lru_cache of 256 entries.
With many devices we quickly reach that limit and end up compiling
the same pattern over and over again.

DHCP has its own memorized fnmatch with its own lru_cache
since the data is going to be relatively the same
since the devices will not change frequently

Definition at line 477 of file __init__.py.

◆ async_index_integration_matchers()

DhcpMatchers homeassistant.components.dhcp.async_index_integration_matchers ( list[DHCPMatcher integration_matchers)
Index the integration matchers.

We have three types of matchers:

1. Registered devices
2. Devices with no OUI - index by first char of lower() hostname
3. Devices with OUI - index by OUI

Definition at line 95 of file __init__.py.

◆ async_setup()

bool homeassistant.components.dhcp.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up the dhcp component.

Definition at line 130 of file __init__.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.dhcp._LOGGER = logging.getLogger(__name__)
private

Definition at line 74 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.dhcp.CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)

Definition at line 65 of file __init__.py.

◆ Final

homeassistant.components.dhcp.Final

Definition at line 67 of file __init__.py.

◆ SCAN_INTERVAL

homeassistant.components.dhcp.SCAN_INTERVAL = timedelta(minutes=60)

Definition at line 71 of file __init__.py.