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

Classes

class  ValveControllerSwitch
 
class  ValveControllerSwitchDescription
 

Functions

None _async_close_valve (Client client)
 
None _async_disable_ap (Client client)
 
None _async_enable_ap (Client client)
 
None _async_open_valve (Client client)
 
None async_setup_entry (HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)
 
bool is_open (dict[str, Any] data)
 

Variables

string ATTR_AVG_CURRENT = "average_current"
 
string ATTR_CONNECTED_CLIENTS = "connected_clients"
 
string ATTR_INST_CURRENT = "instantaneous_current"
 
string ATTR_INST_CURRENT_DDT = "instantaneous_current_ddt"
 
string ATTR_STATION_CONNECTED = "station_connected"
 
string ATTR_TRAVEL_COUNT = "travel_count"
 
string SWITCH_KIND_ONBOARD_AP = "onboard_ap"
 
string SWITCH_KIND_VALVE = "valve"
 
tuple VALVE_CONTROLLER_DESCRIPTIONS
 

Detailed Description

Switches for the Elexa Guardian integration.

Function Documentation

◆ _async_close_valve()

None homeassistant.components.guardian.switch._async_close_valve ( Client  client)
private
Close the valve.

Definition at line 58 of file switch.py.

◆ _async_disable_ap()

None homeassistant.components.guardian.switch._async_disable_ap ( Client  client)
private
Disable the onboard AP.

Definition at line 46 of file switch.py.

◆ _async_enable_ap()

None homeassistant.components.guardian.switch._async_enable_ap ( Client  client)
private
Enable the onboard AP.

Definition at line 52 of file switch.py.

◆ _async_open_valve()

None homeassistant.components.guardian.switch._async_open_valve ( Client  client)
private
Open the valve.

Definition at line 64 of file switch.py.

◆ async_setup_entry()

None homeassistant.components.guardian.switch.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry,
AddEntitiesCallback   async_add_entities 
)
Set up Guardian switches based on a config entry.

Definition at line 112 of file switch.py.

◆ is_open()

bool homeassistant.components.guardian.switch.is_open ( dict[str, Any]  data)
Return if the valve is opening.

Definition at line 71 of file switch.py.

Variable Documentation

◆ ATTR_AVG_CURRENT

string homeassistant.components.guardian.switch.ATTR_AVG_CURRENT = "average_current"

Definition at line 23 of file switch.py.

◆ ATTR_CONNECTED_CLIENTS

string homeassistant.components.guardian.switch.ATTR_CONNECTED_CLIENTS = "connected_clients"

Definition at line 24 of file switch.py.

◆ ATTR_INST_CURRENT

string homeassistant.components.guardian.switch.ATTR_INST_CURRENT = "instantaneous_current"

Definition at line 25 of file switch.py.

◆ ATTR_INST_CURRENT_DDT

string homeassistant.components.guardian.switch.ATTR_INST_CURRENT_DDT = "instantaneous_current_ddt"

Definition at line 26 of file switch.py.

◆ ATTR_STATION_CONNECTED

string homeassistant.components.guardian.switch.ATTR_STATION_CONNECTED = "station_connected"

Definition at line 27 of file switch.py.

◆ ATTR_TRAVEL_COUNT

string homeassistant.components.guardian.switch.ATTR_TRAVEL_COUNT = "travel_count"

Definition at line 28 of file switch.py.

◆ SWITCH_KIND_ONBOARD_AP

string homeassistant.components.guardian.switch.SWITCH_KIND_ONBOARD_AP = "onboard_ap"

Definition at line 30 of file switch.py.

◆ SWITCH_KIND_VALVE

string homeassistant.components.guardian.switch.SWITCH_KIND_VALVE = "valve"

Definition at line 31 of file switch.py.

◆ VALVE_CONTROLLER_DESCRIPTIONS

tuple homeassistant.components.guardian.switch.VALVE_CONTROLLER_DESCRIPTIONS
Initial value:
1 = (
2  ValveControllerSwitchDescription(
3  key=SWITCH_KIND_ONBOARD_AP,
4  translation_key="onboard_access_point",
5  entity_category=EntityCategory.CONFIG,
6  extra_state_attributes_fn=lambda data: {
7  ATTR_CONNECTED_CLIENTS: data.get("ap_clients"),
8  ATTR_STATION_CONNECTED: data["station_connected"],
9  },
10  api_category=API_WIFI_STATUS,
11  is_on_fn=lambda data: data["ap_enabled"],
12  off_fn=_async_disable_ap,
13  on_fn=_async_enable_ap,
14  ),
15  ValveControllerSwitchDescription(
16  key=SWITCH_KIND_VALVE,
17  translation_key="valve_controller",
18  api_category=API_VALVE_STATUS,
19  extra_state_attributes_fn=lambda data: {
20  ATTR_AVG_CURRENT: data["average_current"],
21  ATTR_INST_CURRENT: data["instantaneous_current"],
22  ATTR_INST_CURRENT_DDT: data["instantaneous_current_ddt"],
23  ATTR_TRAVEL_COUNT: data["travel_count"],
24  },
25  is_on_fn=is_open,
26  off_fn=_async_close_valve,
27  on_fn=_async_open_valve,
28  ),
29 )

Definition at line 81 of file switch.py.