Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.nut.device_action Namespace Reference

Functions

str _get_command_name (str device_action_name)
 
str _get_device_action_name (str command_name)
 
NutRuntimeData|None _get_runtime_data_from_device_id (HomeAssistant hass, str device_id)
 
None async_call_action_from_config (HomeAssistant hass, ConfigType config, TemplateVarsType variables, Context|None context)
 
list[dict[str, str]] async_get_actions (HomeAssistant hass, str device_id)
 

Variables

 ACTION_SCHEMA
 
dictionary ACTION_TYPES = {cmd.replace(".", "_") for cmd in INTEGRATION_SUPPORTED_COMMANDS}
 

Detailed Description

Provides device actions for Network UPS Tools (NUT).

Function Documentation

◆ _get_command_name()

str homeassistant.components.nut.device_action._get_command_name ( str  device_action_name)
private

Definition at line 64 of file device_action.py.

◆ _get_device_action_name()

str homeassistant.components.nut.device_action._get_device_action_name ( str  command_name)
private

Definition at line 60 of file device_action.py.

◆ _get_runtime_data_from_device_id()

NutRuntimeData | None homeassistant.components.nut.device_action._get_runtime_data_from_device_id ( HomeAssistant  hass,
str   device_id 
)
private

Definition at line 68 of file device_action.py.

◆ async_call_action_from_config()

None homeassistant.components.nut.device_action.async_call_action_from_config ( HomeAssistant  hass,
ConfigType  config,
TemplateVarsType  variables,
Context | None  context 
)
Execute a device action.

Definition at line 42 of file device_action.py.

◆ async_get_actions()

list[dict[str, str]] homeassistant.components.nut.device_action.async_get_actions ( HomeAssistant  hass,
str   device_id 
)
List device actions for Network UPS Tools (NUT) devices.

Definition at line 26 of file device_action.py.

Variable Documentation

◆ ACTION_SCHEMA

homeassistant.components.nut.device_action.ACTION_SCHEMA
Initial value:
1 = cv.DEVICE_ACTION_BASE_SCHEMA.extend(
2  {
3  vol.Required(CONF_TYPE): vol.In(ACTION_TYPES),
4  }
5 )

Definition at line 19 of file device_action.py.

◆ ACTION_TYPES

dictionary homeassistant.components.nut.device_action.ACTION_TYPES = {cmd.replace(".", "_") for cmd in INTEGRATION_SUPPORTED_COMMANDS}

Definition at line 17 of file device_action.py.