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

Namespaces

 config_flow
 
 const
 
 entity
 
 errors
 
 switch
 

Functions

bool async_setup (HomeAssistant hass, ConfigType config)
 
bool async_setup_entry (HomeAssistant hass, ConfigEntry entry)
 
bool async_unload_entry (HomeAssistant hass, ConfigEntry entry)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 CONFIG_SCHEMA
 
string DATA_DEVICE_LISTENER = "hlk_sw16_device_listener"
 
string DATA_DEVICE_REGISTER = "hlk_sw16_device_register"
 
list PLATFORMS = [Platform.SWITCH]
 
 RELAY_ID
 
 SWITCH_SCHEMA = vol.Schema({vol.Optional(CONF_NAME): cv.string})
 

Detailed Description

Support for HLK-SW16 relay switches.

Function Documentation

◆ async_setup()

bool homeassistant.components.hlk_sw16.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Component setup, do nothing.

Definition at line 56 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.hlk_sw16.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Set up the HLK-SW16 switch.

Definition at line 73 of file __init__.py.

◆ async_unload_entry()

bool homeassistant.components.hlk_sw16.async_unload_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Unload a config entry.

Definition at line 119 of file __init__.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 23 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.hlk_sw16.CONFIG_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  DOMAIN: vol.Schema(
4  {
5  cv.string: vol.Schema(
6  {
7  vol.Required(CONF_HOST): cv.string,
8  vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
9  vol.Required(CONF_SWITCHES): vol.Schema(
10  {RELAY_ID: SWITCH_SCHEMA}
11  ),
12  }
13  )
14  }
15  )
16  },
17  extra=vol.ALLOW_EXTRA,
18 )

Definition at line 36 of file __init__.py.

◆ DATA_DEVICE_LISTENER

string homeassistant.components.hlk_sw16.DATA_DEVICE_LISTENER = "hlk_sw16_device_listener"

Definition at line 28 of file __init__.py.

◆ DATA_DEVICE_REGISTER

string homeassistant.components.hlk_sw16.DATA_DEVICE_REGISTER = "hlk_sw16_device_register"

Definition at line 27 of file __init__.py.

◆ PLATFORMS

list homeassistant.components.hlk_sw16.PLATFORMS = [Platform.SWITCH]

Definition at line 25 of file __init__.py.

◆ RELAY_ID

homeassistant.components.hlk_sw16.RELAY_ID
Initial value:
1 = vol.All(
2  vol.Any(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", "d", "e", "f"), vol.Coerce(str)
3 )

Definition at line 32 of file __init__.py.

◆ SWITCH_SCHEMA

homeassistant.components.hlk_sw16.SWITCH_SCHEMA = vol.Schema({vol.Optional(CONF_NAME): cv.string})

Definition at line 30 of file __init__.py.