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

Classes

class  WiLightValvePauseSwitch
 
class  WiLightValveSwitch
 

Functions

None async_setup_entry (HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)
 
tuple[Any] entities_from_discovered_wilight (PyWiLightDevice api_device)
 
int hass_to_wilight_pause_time (int value)
 
int wilight_to_hass_pause_time (int value)
 

Variables

string ATTR_PAUSE_TIME = "pause_time"
 
string ATTR_TRIGGER = "trigger"
 
string ATTR_TRIGGER_1 = "trigger_1"
 
string ATTR_TRIGGER_1_DESC = "trigger_1_description"
 
string ATTR_TRIGGER_2 = "trigger_2"
 
string ATTR_TRIGGER_2_DESC = "trigger_2_description"
 
string ATTR_TRIGGER_3 = "trigger_3"
 
string ATTR_TRIGGER_3_DESC = "trigger_3_description"
 
string ATTR_TRIGGER_4 = "trigger_4"
 
string ATTR_TRIGGER_4_DESC = "trigger_4_description"
 
string ATTR_TRIGGER_INDEX = "trigger_index"
 
string ATTR_WATERING_TIME = "watering_time"
 
string DESC_PAUSE = "pause"
 
string DESC_WATERING = "watering"
 
int RANGE_PAUSE_TIME = 24
 
int RANGE_TRIGGER_INDEX = 4
 
int RANGE_WATERING_TIME = 1800
 
string SERVICE_SET_PAUSE_TIME = "set_pause_time"
 
string SERVICE_SET_TRIGGER = "set_trigger"
 
string SERVICE_SET_WATERING_TIME = "set_watering_time"
 
 VALID_PAUSE_TIME = vol.All(vol.Coerce(int), vol.Range(min=1, max=RANGE_PAUSE_TIME))
 
 VALID_TRIGGER_INDEX
 
 VALID_WATERING_TIME
 

Detailed Description

Support for WiLight switches.

Function Documentation

◆ async_setup_entry()

None homeassistant.components.wilight.switch.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry,
AddEntitiesCallback   async_add_entities 
)
Set up WiLight switches from a config entry.

Definition at line 77 of file switch.py.

◆ entities_from_discovered_wilight()

tuple[Any] homeassistant.components.wilight.switch.entities_from_discovered_wilight ( PyWiLightDevice  api_device)
Parse configuration and add WiLight switch entities.

Definition at line 62 of file switch.py.

◆ hass_to_wilight_pause_time()

int homeassistant.components.wilight.switch.hass_to_wilight_pause_time ( int  value)
Convert hass pause_time hours to wilight seconds.

Definition at line 141 of file switch.py.

◆ wilight_to_hass_pause_time()

int homeassistant.components.wilight.switch.wilight_to_hass_pause_time ( int  value)
Convert wilight pause_time seconds to hass hour.

Definition at line 136 of file switch.py.

Variable Documentation

◆ ATTR_PAUSE_TIME

string homeassistant.components.wilight.switch.ATTR_PAUSE_TIME = "pause_time"

Definition at line 24 of file switch.py.

◆ ATTR_TRIGGER

string homeassistant.components.wilight.switch.ATTR_TRIGGER = "trigger"

Definition at line 35 of file switch.py.

◆ ATTR_TRIGGER_1

string homeassistant.components.wilight.switch.ATTR_TRIGGER_1 = "trigger_1"

Definition at line 25 of file switch.py.

◆ ATTR_TRIGGER_1_DESC

string homeassistant.components.wilight.switch.ATTR_TRIGGER_1_DESC = "trigger_1_description"

Definition at line 29 of file switch.py.

◆ ATTR_TRIGGER_2

string homeassistant.components.wilight.switch.ATTR_TRIGGER_2 = "trigger_2"

Definition at line 26 of file switch.py.

◆ ATTR_TRIGGER_2_DESC

string homeassistant.components.wilight.switch.ATTR_TRIGGER_2_DESC = "trigger_2_description"

Definition at line 30 of file switch.py.

◆ ATTR_TRIGGER_3

string homeassistant.components.wilight.switch.ATTR_TRIGGER_3 = "trigger_3"

Definition at line 27 of file switch.py.

◆ ATTR_TRIGGER_3_DESC

string homeassistant.components.wilight.switch.ATTR_TRIGGER_3_DESC = "trigger_3_description"

Definition at line 31 of file switch.py.

◆ ATTR_TRIGGER_4

string homeassistant.components.wilight.switch.ATTR_TRIGGER_4 = "trigger_4"

Definition at line 28 of file switch.py.

◆ ATTR_TRIGGER_4_DESC

string homeassistant.components.wilight.switch.ATTR_TRIGGER_4_DESC = "trigger_4_description"

Definition at line 32 of file switch.py.

◆ ATTR_TRIGGER_INDEX

string homeassistant.components.wilight.switch.ATTR_TRIGGER_INDEX = "trigger_index"

Definition at line 36 of file switch.py.

◆ ATTR_WATERING_TIME

string homeassistant.components.wilight.switch.ATTR_WATERING_TIME = "watering_time"

Definition at line 23 of file switch.py.

◆ DESC_PAUSE

string homeassistant.components.wilight.switch.DESC_PAUSE = "pause"

Definition at line 59 of file switch.py.

◆ DESC_WATERING

string homeassistant.components.wilight.switch.DESC_WATERING = "watering"

Definition at line 58 of file switch.py.

◆ RANGE_PAUSE_TIME

int homeassistant.components.wilight.switch.RANGE_PAUSE_TIME = 24

Definition at line 45 of file switch.py.

◆ RANGE_TRIGGER_INDEX

int homeassistant.components.wilight.switch.RANGE_TRIGGER_INDEX = 4

Definition at line 46 of file switch.py.

◆ RANGE_WATERING_TIME

int homeassistant.components.wilight.switch.RANGE_WATERING_TIME = 1800

Definition at line 44 of file switch.py.

◆ SERVICE_SET_PAUSE_TIME

string homeassistant.components.wilight.switch.SERVICE_SET_PAUSE_TIME = "set_pause_time"

Definition at line 40 of file switch.py.

◆ SERVICE_SET_TRIGGER

string homeassistant.components.wilight.switch.SERVICE_SET_TRIGGER = "set_trigger"

Definition at line 41 of file switch.py.

◆ SERVICE_SET_WATERING_TIME

string homeassistant.components.wilight.switch.SERVICE_SET_WATERING_TIME = "set_watering_time"

Definition at line 39 of file switch.py.

◆ VALID_PAUSE_TIME

homeassistant.components.wilight.switch.VALID_PAUSE_TIME = vol.All(vol.Coerce(int), vol.Range(min=1, max=RANGE_PAUSE_TIME))

Definition at line 52 of file switch.py.

◆ VALID_TRIGGER_INDEX

homeassistant.components.wilight.switch.VALID_TRIGGER_INDEX
Initial value:
1 = vol.All(
2  vol.Coerce(int), vol.Range(min=1, max=RANGE_TRIGGER_INDEX)
3 )

Definition at line 53 of file switch.py.

◆ VALID_WATERING_TIME

homeassistant.components.wilight.switch.VALID_WATERING_TIME
Initial value:
1 = vol.All(
2  vol.Coerce(int), vol.Range(min=1, max=RANGE_WATERING_TIME)
3 )

Definition at line 49 of file switch.py.