Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/bastgau/ha-pi-hole-v6
/ functions
Functions
133 in github.com/bastgau/ha-pi-hole-v6
⨍
Functions
133
◇
Types & classes
32
↓ 19 callers
Method
_call
Send HTTP requests with specified method, route, and data. Args: route (str): Represents the specific endpoint that you want to c
custom_components/pi_hole_v6/api.py:81
↓ 9 callers
Function
check_result
Check that the API result is a valid dictionary. If the result is not a dict, logs an error, calls logout and raises DataStructureError. Arg
custom_components/pi_hole_v6/__init__.py:68
↓ 6 callers
Function
create_entity_id_name
Create a normalized entity ID name from a raw input string. Args: input_string (str): The raw input string to transform. Returns:
custom_components/pi_hole_v6/helper.py:8
↓ 4 callers
Method
__init__
Initialize the APIError exception with the class-level message.
custom_components/pi_hole_v6/exceptions.py:13
↓ 4 callers
Method
_call_action
Execute a Pi-hole action. Args: action_name (str): Represents the action to execute. Returns: dict[str, Any]
custom_components/pi_hole_v6/api.py:983
↓ 4 callers
Method
_find_device
Find the current network device entry for this MAC address. Updates cached hostname and IP address when found. Returns:
custom_components/pi_hole_v6/device_tracker.py:347
↓ 4 callers
Method
async_turn_group
Turn on/off the group. Args: action (str): The action to perform, either "enable" or "disable". with_update (bool): I
custom_components/pi_hole_v6/switch.py:362
↓ 4 callers
Method
async_turn_switch
Turn on/off the service. Args: action (str): The action to perform, either "enable" or "disable". duration (Any): Opt
custom_components/pi_hole_v6/switch.py:209
↓ 3 callers
Method
async_turn_service
Turn on/off the Pi-hole group blocking when triggered via a service call. Args: action (str): The action to perform, either "enab
custom_components/pi_hole_v6/switch.py:427
↓ 3 callers
Method
call_logout
Drop the current session. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "data". Raises:
custom_components/pi_hole_v6/api.py:419
↓ 3 callers
Function
load_manifest
Load a component's manifest.json, or None if it has no manifest.
scripts/update_requirements.py:47
↓ 2 callers
Function
_async_add_remove_trackers
Add new devices and remove entities excluded by the current filter. Devices that Pi-hole simply stops reporting keep their entity, which then
custom_components/pi_hole_v6/device_tracker.py:193
↓ 2 callers
Method
_async_try_connect
Attempt to connect to the Pi-hole API using the current config. Returns: dict[str, str]: An empty dict on success, or a dict mapp
custom_components/pi_hole_v6/config_flow.py:199
↓ 2 callers
Method
_authentification_step
Execute the full authentication sequence for a given action. Checks current authentication status, aborts logout if not needed, and r
custom_components/pi_hole_v6/api.py:247
↓ 2 callers
Method
_create_log_message_on_api_result
Build a log message string from an HTTP response. Args: request (ClientResponse): The HTTP response object. method (s
custom_components/pi_hole_v6/api.py:207
↓ 2 callers
Function
_device_addresses
(device: dict[str, Any])
custom_components/pi_hole_v6/device_tracker.py:91
↓ 2 callers
Function
_get_data_option_schema
Build and return the voluptuous schema for the options flow form. Returns: vol.Schema: The schema to be used in the options flow form.
custom_components/pi_hole_v6/config_flow.py:234
↓ 2 callers
Function
_purge_network_devices
Remove device_tracker entities and their network devices from the registries. Removes any network device (and its device_tracker entity) already
custom_components/pi_hole_v6/device_tracker.py:99
↓ 2 callers
Method
_try_to_retrieve_json_result
Attempt to parse the JSON body from an HTTP response. Handles encoding errors gracefully and optionally redacts the session SID for privacy.
custom_components/pi_hole_v6/api.py:163
↓ 2 callers
Function
calculate_duration
Calculate the duration in seconds from a timedelta or integer value. Args: duration (Any): The duration to convert. Can be a timedelta, a
custom_components/pi_hole_v6/switch.py:491
↓ 2 callers
Function
calculate_remaining_until_blocking_mode_until_value
Calculate the remaining seconds until the blocking mode is automatically restored. Args: entity (Any): The entity holding the API cache w
custom_components/pi_hole_v6/common.py:55
↓ 2 callers
Method
call_authentification_status
Retrieve the current authentication session status. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "da
custom_components/pi_hole_v6/api.py:358
↓ 2 callers
Method
call_blocking_status
Retrieve current blocking status. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "data". Rais
custom_components/pi_hole_v6/api.py:540
↓ 2 callers
Function
expand
(component: str)
scripts/update_requirements.py:64
↓ 2 callers
Function
parse_mac_list
Parse a raw MAC address list into a normalized set. Accepts MAC addresses separated by commas, newlines, or both. Each address is lowercased
custom_components/pi_hole_v6/helper.py:30
↓ 2 callers
Method
remove_cache
Reset a specific cache entry to its default error state. Args: data_name (str): The name of the cache to reset. Currently support
custom_components/pi_hole_v6/api.py:1012
↓ 1 callers
Method
__init__
Initialize a Pi-hole V6 group switch. Args: hole_data (PiHoleV6Data): The runtime data containing the API client and coordinator.
custom_components/pi_hole_v6/switch.py:297
↓ 1 callers
Method
_abort_logout
Abort a logout call if no active session exists. Raises AbortLogoutError when a logout is requested but there is no active session to
custom_components/pi_hole_v6/api.py:338
↓ 1 callers
Function
_async_validate_input
Validate the user input from the options flow form. Args: user_input (dict[str, Any]): The input submitted by the user in the options for
custom_components/pi_hole_v6/config_flow.py:280
↓ 1 callers
Method
_authentification_step_with_lock
Execute the authentication sequence with a lock for non-auth actions. Acquires the call lock before running the authentication step to preven
custom_components/pi_hole_v6/api.py:264
↓ 1 callers
Function
_build_device_filter
Build a predicate that decides whether a network device should be tracked. Like `_build_mac_filter`, but also matches the device's current IP add
custom_components/pi_hole_v6/device_tracker.py:68
↓ 1 callers
Function
_build_mac_filter
Build a predicate that decides whether a MAC address should be tracked. Reads the whitelist/blacklist mode and address list from the config entry
custom_components/pi_hole_v6/device_tracker.py:39
↓ 1 callers
Method
_check_authentification
Verify the current session is still valid and reset it if not. Calls the authentication status endpoint and sets the SID to None if t
custom_components/pi_hole_v6/api.py:293
↓ 1 callers
Method
_create_log_message_on_api_exception
Build a log message string from an API exception and its associated HTTP response. Args: api_error (APIError): The API exception
custom_components/pi_hole_v6/api.py:226
↓ 1 callers
Function
_device_display_name
Return the best display name for a network device. Picks the first non-null hostname from the device's IP list, falling back to the MAC addre
custom_components/pi_hole_v6/device_tracker.py:136
↓ 1 callers
Function
_get_data_config_schema
Build and return the voluptuous schema for the main config flow form. Args: user_input (Any): Previously entered user input used to pre-f
custom_components/pi_hole_v6/config_flow.py:54
↓ 1 callers
Method
_request_login
Request a login if no active session exists. Triggers a login call when the action is not already a login and no session ID is curren
custom_components/pi_hole_v6/api.py:321
↓ 1 callers
Function
async_get_all_data
Fetch all required data from the Pi-hole API. Sequentially calls each API endpoint and validates the result structure. Args: api_cli
custom_components/pi_hole_v6/__init__.py:91
↓ 1 callers
Method
async_step_reauth_confirm
Handle user's reauth credentials. Args: user_input (dict[str, Any] | None): The input submitted by the user, or None when display
custom_components/pi_hole_v6/config_flow.py:150
↓ 1 callers
Method
call_action_flush_arp
Flush the network table. This includes emptying the ARP table and removing both all known devices and their associated addresses. Re
custom_components/pi_hole_v6/api.py:882
↓ 1 callers
Method
call_action_flush_logs
Flush the DNS logs. This includes emptying the DNS log file and purging the most recent 24 hours from both the database and FTL's internal me
custom_components/pi_hole_v6/api.py:898
↓ 1 callers
Method
call_action_ftl_purge_diagnosis_messages
Purge all FTL diagnosis messages. Iterates over cached messages and deletes each one via the API. Clears the local message cache afte
custom_components/pi_hole_v6/api.py:944
↓ 1 callers
Method
call_action_gravity
Run gravity. Update Pi-hole's adlists by running pihole -g. Returns: dict[str, Any]: A dictionary with the keys "code",
custom_components/pi_hole_v6/api.py:914
↓ 1 callers
Method
call_action_restartdns
Restart the pihole-FTL service. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "data". Raises
custom_components/pi_hole_v6/api.py:930
↓ 1 callers
Method
call_blocking_disabled
Disable blocking for DNS requests. Args: duration (int | None): The time duration in seconds for which blocking will be disabled.
custom_components/pi_hole_v6/api.py:597
↓ 1 callers
Method
call_blocking_enabled
Enable blocking for DNS requests. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "data". Rais
custom_components/pi_hole_v6/api.py:568
↓ 1 callers
Method
call_get_auth_sessions
Retrieve all active sessions. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "data". Raises:
custom_components/pi_hole_v6/api.py:512
↓ 1 callers
Method
call_get_configured_clients
Retrieve the configured clients. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "data". Raise
custom_components/pi_hole_v6/api.py:727
↓ 1 callers
Method
call_get_dhcp_leases
Retrieve the active DHCP leases. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "data". Raise
custom_components/pi_hole_v6/api.py:755
↓ 1 callers
Method
call_get_ftl_info_messages
Retrieve the list of FTL diagnosis messages. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "data".
custom_components/pi_hole_v6/api.py:634
↓ 1 callers
Method
call_get_ftl_info_messages_count
Retrieve the count of FTL diagnosis messages. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "data".
custom_components/pi_hole_v6/api.py:663
↓ 1 callers
Method
call_get_groups
Retrieve the list of Pi-hole groups. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "data". R
custom_components/pi_hole_v6/api.py:691
↓ 1 callers
Method
call_get_network_devices
Retrieve the list of known network devices. Args: max_devices (int): The maximum number of devices to retrieve. Defaults to MAX_N
custom_components/pi_hole_v6/api.py:783
↓ 1 callers
Method
call_group_disable
Disable a Pi-hole group. Args: group (str): The name of the group to disable. Returns: dict[str, Any]: A dic
custom_components/pi_hole_v6/api.py:814
↓ 1 callers
Method
call_group_enable
Enable a Pi-hole group. Args: group (str): The name of the group to enable. Returns: dict[str, Any]: A dicti
custom_components/pi_hole_v6/api.py:848
↓ 1 callers
Method
call_login
Authenticate against the Pi-hole API using the configured password. Returns: dict[str, Any]: A dictionary with the keys "code", "
custom_components/pi_hole_v6/api.py:384
↓ 1 callers
Method
call_padd
Retrieve the Pi-hole API Dashboard information. Args: full (bool): If True, retrieves the full dashboard data. Defaults to True.
custom_components/pi_hole_v6/api.py:481
↓ 1 callers
Method
call_summary
Retrieve an overview of Pi-hole activity. Returns: dict[str, Any]: A dictionary with the keys "code", "reason", and "data".
custom_components/pi_hole_v6/api.py:453
↓ 1 callers
Function
collect_components
Return every component reachable from default_config's dependency tree.
scripts/update_requirements.py:55
↓ 1 callers
Function
collect_requirements
Map each dependency's lowercased package name to its pinned requirement string.
scripts/update_requirements.py:82
↓ 1 callers
Function
find_components_dir
Locate the installed homeassistant.components package directory.
scripts/update_requirements.py:42
↓ 1 callers
Function
find_entity_sensor
Find a sensor entity by its key within a given context. Args: current_hass (HomeAssistant): The Home Assistant instance. key (str
custom_components/pi_hole_v6/common.py:35
↓ 1 callers
Function
find_entity_switch
Find a switch entity by its key within a given context. Args: current_hass (HomeAssistant): The Home Assistant instance. key (str
custom_components/pi_hole_v6/common.py:11
↓ 1 callers
Method
get_entity_registry_enabled_value
Determine whether the entity should be enabled in the registry by default. Returns True if the entity matches the Docker context (Docker inst
custom_components/pi_hole_v6/update.py:152
↓ 1 callers
Function
get_remaining_dates
Retrieve the remaining dates cache from the first registered switch entity. Args: hass (HomeAssistant): The Home Assistant instance.
custom_components/pi_hole_v6/common.py:78
↓ 1 callers
Function
handle_status
Raise specific exceptions based on the input status code. Args: status_code (int): Represents the status code and handles it based on the
custom_components/pi_hole_v6/exceptions.py:147
↓ 1 callers
Function
main
Regenerate requirements.txt's default_config requirements block.
scripts/update_requirements.py:106
↓ 1 callers
Method
native_remaining_until_blocking_mode
Compute the remaining seconds until blocking mode is automatically restored. Updates the cache of remaining dates based on the current blocki
custom_components/pi_hole_v6/sensor.py:275
↓ 1 callers
Function
rewrite_requirements_file
Replace the generated requirements block, keeping the pinned base requirements above it.
scripts/update_requirements.py:95
↓ 1 callers
Function
sensor_update_timer
Update the remaining blocking mode sensor state on each timer tick. Computes the remaining seconds and updates the entity state and attributes ac
custom_components/pi_hole_v6/common.py:102
↓ 1 callers
Function
switch_update_timer
Update all switch entity states related to blocking timers on each timer tick. Iterates over all remaining dates, updates attributes and remainin
custom_components/pi_hole_v6/common.py:149
Method
__init__
Initialize a Pi-hole V6 sensor. Args: api (ClientAPI): The Pi-hole API client instance. coordinator (DataUpdateCoordi
custom_components/pi_hole_v6/sensor.py:199
Method
__init__
Initialize the config flow.
custom_components/pi_hole_v6/config_flow.py:87
Method
__init__
Initialize Pi-hole API Client object with an API URL. Args: session (client.ClientSession): The aiohttp client session used to pe
custom_components/pi_hole_v6/api.py:47
Method
__init__
Initialize the ActionExecutionError exception with the class-level message.
custom_components/pi_hole_v6/exceptions.py:23
Method
__init__
Initialize the AbortLogoutError exception with the class-level message.
custom_components/pi_hole_v6/exceptions.py:35
Method
__init__
Initialize the ClientConnectorError exception, optionally appending a custom message. Args: custom_message (str): An optional add
custom_components/pi_hole_v6/exceptions.py:59
Method
__init__
Initialize the ContentTypeError exception with the class-level message.
custom_components/pi_hole_v6/exceptions.py:80
Method
__init__
Initialize a Pi-hole V6 switch. Args: api (PiholeAPI): The Pi-hole API client instance. coordinator (DataUpdateCoordi
custom_components/pi_hole_v6/switch.py:134
Method
__init__
Initialize Pi-hole V6 button. Args: api (PiholeAPI): The Pi-hole API client instance. coordinator (DataUpdateCoordina
custom_components/pi_hole_v6/button.py:100
Method
__init__
Initialize a Pi-hole V6 sensor. Args: api (PiholeAPI): The Pi-hole API client instance. coordinator (DataUpdateCoordi
custom_components/pi_hole_v6/binary_sensor.py:88
Method
__init__
Initialize a Pi-hole V6 device tracker entity. Args: api (PiholeAPI): The Pi-hole API client instance. coordinator (D
custom_components/pi_hole_v6/device_tracker.py:314
Method
__init__
Initialize a Pi-hole update entity. Args: api (ClientAPI): The Pi-hole API client instance. coordinator (DataUpdateCo
custom_components/pi_hole_v6/update.py:119
Method
__init__
Initialize a Pi-hole V6 entity. Args: api (PiholeAPI): The Pi-hole API client instance. coordinator (DataUpdateCoordi
custom_components/pi_hole_v6/entity.py:32
Function
_forget_manually_removed_device
Forget a manually removed network device so it can be recreated later. When the user removes a network device from the UI, it disappears from
custom_components/pi_hole_v6/device_tracker.py:269
Function
_schedule_add_remove_trackers
Schedule adding and removing trackers when coordinator updates. Returns: None
custom_components/pi_hole_v6/device_tracker.py:257
Method
async_get_options_flow
Get the options flow for this handler. Args: config_entry (Any): The current config entry (unused). Returns:
custom_components/pi_hole_v6/config_flow.py:187
Function
async_logout
Log out from the Pi-hole API when Home Assistant stops. Args: _ (Event): The Home Assistant stop event (unused). Returns
custom_components/pi_hole_v6/__init__.py:167
Method
async_press
Press the button. Returns: None
custom_components/pi_hole_v6/button.py:126
Function
async_remove_config_entry_device
Allow manual removal of a network device from the UI. Only network devices (identified by a MAC connection) created by the device_tracker pla
custom_components/pi_hole_v6/__init__.py:253
Method
async_service_disable
Disable the Pi-hole blocking via the service call. Args: duration (Any): Optional duration as a timedelta or int (seconds) for wh
custom_components/pi_hole_v6/switch.py:259
Method
async_service_disable
Disable the Pi-hole group blocking via the service call. Args: duration (Any): Optional duration as a timedelta or int (seconds)
custom_components/pi_hole_v6/switch.py:413
Method
async_service_enable
Enable the Pi-hole blocking via the service call. Returns: None
custom_components/pi_hole_v6/switch.py:273
Method
async_service_enable
Enable the Pi-hole group blocking via the service call. Returns: None
custom_components/pi_hole_v6/switch.py:403
Function
async_setup_entry
Set up the Pi-hole V6 sensor. Args: hass (HomeAssistant): The Home Assistant instance. entry (PiHoleV6ConfigEntry): The config en
custom_components/pi_hole_v6/sensor.py:147
Function
async_setup_entry
Set up Pi-hole V6 entry. Args: hass (HomeAssistant): The Home Assistant instance. entry (PiHoleV6ConfigEntry): The config entry t
custom_components/pi_hole_v6/__init__.py:138
Function
async_setup_entry
Set up the Pi-hole V6 switch. Args: hass (HomeAssistant): The Home Assistant instance. entry (PiHoleV6ConfigEntry): The config en
custom_components/pi_hole_v6/switch.py:43
Function
async_setup_entry
Set up the Pi-hole V6 button entities. Args: hass (HomeAssistant): The Home Assistant instance (unused). entry (PiHoleV6ConfigEnt
custom_components/pi_hole_v6/button.py:61
Function
async_setup_entry
Set up the Pi-hole V6 binary sensor. Args: hass (HomeAssistant): The Home Assistant instance (unused). entry (PiHoleV6ConfigEntry
custom_components/pi_hole_v6/binary_sensor.py:54
Function
async_setup_entry
Set up Pi-hole V6 device tracker from network devices. Creates a device tracker entity for each network device known to Pi-hole. New devices
custom_components/pi_hole_v6/device_tracker.py:156
next →
1–100 of 133, ranked by callers