Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.unifi.switch Namespace Reference

Classes

class  UnifiSwitchEntity
 
class  UnifiSwitchEntityDescription
 

Functions

bool async_block_client_allowed_fn (UnifiHub hub, str obj_id)
 
None async_block_client_control_fn (UnifiHub hub, str obj_id, bool target)
 
None async_dpi_group_control_fn (UnifiHub hub, str obj_id, bool target)
 
DeviceInfo async_dpi_group_device_info_fn (UnifiHub hub, str obj_id)
 
bool async_dpi_group_is_on_fn (UnifiHub hub, DPIRestrictionGroup dpi_group)
 
None async_outlet_control_fn (UnifiHub hub, str obj_id, bool target)
 
bool async_outlet_switching_supported_fn (UnifiHub hub, str obj_id)
 
None async_poe_port_control_fn (UnifiHub hub, str obj_id, bool target)
 
None async_port_forward_control_fn (UnifiHub hub, str obj_id, bool target)
 
None async_setup_entry (HomeAssistant hass, UnifiConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 
None async_traffic_rule_control_fn (UnifiHub hub, str obj_id, bool target)
 
DeviceInfo async_unifi_network_device_info_fn (UnifiHub hub, str obj_id)
 
None async_update_unique_id (HomeAssistant hass, UnifiConfigEntry config_entry)
 
None async_wlan_control_fn (UnifiHub hub, str obj_id, bool target)
 

Variables

tuple CLIENT_BLOCKED = (EventKey.WIRED_CLIENT_BLOCKED, EventKey.WIRELESS_CLIENT_BLOCKED)
 
tuple CLIENT_UNBLOCKED = (EventKey.WIRED_CLIENT_UNBLOCKED, EventKey.WIRELESS_CLIENT_UNBLOCKED)
 

Detailed Description

Switch platform for UniFi Network integration.

Support for controlling power supply of clients which are powered over Ethernet (POE).
Support for controlling network access of clients selected in option flow.
Support for controlling deep packet inspection (DPI) restriction groups.
Support for controlling WLAN availability.

Function Documentation

◆ async_block_client_allowed_fn()

bool homeassistant.components.unifi.switch.async_block_client_allowed_fn ( UnifiHub  hub,
str  obj_id 
)
Check if client is allowed.

Definition at line 68 of file switch.py.

◆ async_block_client_control_fn()

None homeassistant.components.unifi.switch.async_block_client_control_fn ( UnifiHub  hub,
str  obj_id,
bool   target 
)
Control network access of client.

Definition at line 112 of file switch.py.

◆ async_dpi_group_control_fn()

None homeassistant.components.unifi.switch.async_dpi_group_control_fn ( UnifiHub  hub,
str  obj_id,
bool  target 
)
Enable or disable DPI group.

Definition at line 119 of file switch.py.

◆ async_dpi_group_device_info_fn()

DeviceInfo homeassistant.components.unifi.switch.async_dpi_group_device_info_fn ( UnifiHub  hub,
str  obj_id 
)
Create device registry entry for DPI group.

Definition at line 87 of file switch.py.

◆ async_dpi_group_is_on_fn()

bool homeassistant.components.unifi.switch.async_dpi_group_is_on_fn ( UnifiHub  hub,
DPIRestrictionGroup  dpi_group 
)
Calculate if all apps are enabled.

Definition at line 76 of file switch.py.

◆ async_outlet_control_fn()

None homeassistant.components.unifi.switch.async_outlet_control_fn ( UnifiHub  hub,
str  obj_id,
bool  target 
)
Control outlet relay.

Definition at line 137 of file switch.py.

◆ async_outlet_switching_supported_fn()

bool homeassistant.components.unifi.switch.async_outlet_switching_supported_fn ( UnifiHub  hub,
str  obj_id 
)
Determine if an outlet supports switching.

Definition at line 131 of file switch.py.

◆ async_poe_port_control_fn()

None homeassistant.components.unifi.switch.async_poe_port_control_fn ( UnifiHub  hub,
str  obj_id,
bool  target 
)
Control poe state.

Definition at line 146 of file switch.py.

◆ async_port_forward_control_fn()

None homeassistant.components.unifi.switch.async_port_forward_control_fn ( UnifiHub  hub,
str  obj_id,
bool   target 
)
Control port forward state.

Definition at line 155 of file switch.py.

◆ async_setup_entry()

None homeassistant.components.unifi.switch.async_setup_entry ( HomeAssistant  hass,
UnifiConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Set up switches for UniFi Network integration.

Definition at line 327 of file switch.py.

◆ async_traffic_rule_control_fn()

None homeassistant.components.unifi.switch.async_traffic_rule_control_fn ( UnifiHub  hub,
str  obj_id,
bool   target 
)
Control traffic rule state.

Definition at line 163 of file switch.py.

◆ async_unifi_network_device_info_fn()

DeviceInfo homeassistant.components.unifi.switch.async_unifi_network_device_info_fn ( UnifiHub  hub,
str  obj_id 
)
Create device registry entry for the UniFi Network application.

Definition at line 99 of file switch.py.

◆ async_update_unique_id()

None homeassistant.components.unifi.switch.async_update_unique_id ( HomeAssistant  hass,
UnifiConfigEntry  config_entry 
)
Normalize switch unique ID to have a prefix rather than midfix.

Introduced with release 2023.12.

Definition at line 298 of file switch.py.

◆ async_wlan_control_fn()

None homeassistant.components.unifi.switch.async_wlan_control_fn ( UnifiHub  hub,
str  obj_id,
bool  target 
)
Control outlet relay.

Definition at line 173 of file switch.py.

Variable Documentation

◆ CLIENT_BLOCKED

tuple homeassistant.components.unifi.switch.CLIENT_BLOCKED = (EventKey.WIRED_CLIENT_BLOCKED, EventKey.WIRELESS_CLIENT_BLOCKED)

Definition at line 63 of file switch.py.

◆ CLIENT_UNBLOCKED

tuple homeassistant.components.unifi.switch.CLIENT_UNBLOCKED = (EventKey.WIRED_CLIENT_UNBLOCKED, EventKey.WIRELESS_CLIENT_UNBLOCKED)

Definition at line 64 of file switch.py.