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

Classes

class  FluxSwitch
 

Functions

def async_set_lights_rgb (hass, lights, rgb, transition)
 
def async_set_lights_temp (hass, lights, mired, brightness, transition)
 
def async_set_lights_xy (hass, lights, x_val, y_val, brightness, transition)
 
None async_setup_platform (HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTR_UNIQUE_ID = "unique_id"
 
string CONF_DISABLE_BRIGHTNESS_ADJUST = "disable_brightness_adjust"
 
string CONF_INTERVAL = "interval"
 
string CONF_START_CT = "start_colortemp"
 
string CONF_START_TIME = "start_time"
 
string CONF_STOP_CT = "stop_colortemp"
 
string CONF_STOP_TIME = "stop_time"
 
string CONF_SUNSET_CT = "sunset_colortemp"
 
string DEFAULT_MODE = MODE_XY
 
string MODE_MIRED = "mired"
 
string MODE_RGB = "rgb"
 
string MODE_XY = "xy"
 
 PLATFORM_SCHEMA
 

Detailed Description

Flux for Home-Assistant.

The idea was taken from https://github.com/KpaBap/hue-flux/

Function Documentation

◆ async_set_lights_rgb()

def homeassistant.components.flux.switch.async_set_lights_rgb (   hass,
  lights,
  rgb,
  transition 
)
Set color of array of lights.

Definition at line 126 of file switch.py.

◆ async_set_lights_temp()

def homeassistant.components.flux.switch.async_set_lights_temp (   hass,
  lights,
  mired,
  brightness,
  transition 
)
Set color of array of lights.

Definition at line 112 of file switch.py.

◆ async_set_lights_xy()

def homeassistant.components.flux.switch.async_set_lights_xy (   hass,
  lights,
  x_val,
  y_val,
  brightness,
  transition 
)
Set color of array of lights.

Definition at line 98 of file switch.py.

◆ async_setup_platform()

None homeassistant.components.flux.switch.async_setup_platform ( HomeAssistant  hass,
ConfigType  config,
AddEntitiesCallback  async_add_entities,
DiscoveryInfoType | None   discovery_info = None 
)
Set up the Flux switches.

Definition at line 138 of file switch.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.flux.switch._LOGGER = logging.getLogger(__name__)
private

Definition at line 51 of file switch.py.

◆ ATTR_UNIQUE_ID

string homeassistant.components.flux.switch.ATTR_UNIQUE_ID = "unique_id"

Definition at line 53 of file switch.py.

◆ CONF_DISABLE_BRIGHTNESS_ADJUST

string homeassistant.components.flux.switch.CONF_DISABLE_BRIGHTNESS_ADJUST = "disable_brightness_adjust"

Definition at line 60 of file switch.py.

◆ CONF_INTERVAL

string homeassistant.components.flux.switch.CONF_INTERVAL = "interval"

Definition at line 61 of file switch.py.

◆ CONF_START_CT

string homeassistant.components.flux.switch.CONF_START_CT = "start_colortemp"

Definition at line 57 of file switch.py.

◆ CONF_START_TIME

string homeassistant.components.flux.switch.CONF_START_TIME = "start_time"

Definition at line 55 of file switch.py.

◆ CONF_STOP_CT

string homeassistant.components.flux.switch.CONF_STOP_CT = "stop_colortemp"

Definition at line 59 of file switch.py.

◆ CONF_STOP_TIME

string homeassistant.components.flux.switch.CONF_STOP_TIME = "stop_time"

Definition at line 56 of file switch.py.

◆ CONF_SUNSET_CT

string homeassistant.components.flux.switch.CONF_SUNSET_CT = "sunset_colortemp"

Definition at line 58 of file switch.py.

◆ DEFAULT_MODE

string homeassistant.components.flux.switch.DEFAULT_MODE = MODE_XY

Definition at line 66 of file switch.py.

◆ MODE_MIRED

string homeassistant.components.flux.switch.MODE_MIRED = "mired"

Definition at line 64 of file switch.py.

◆ MODE_RGB

string homeassistant.components.flux.switch.MODE_RGB = "rgb"

Definition at line 65 of file switch.py.

◆ MODE_XY

string homeassistant.components.flux.switch.MODE_XY = "xy"

Definition at line 63 of file switch.py.

◆ PLATFORM_SCHEMA

homeassistant.components.flux.switch.PLATFORM_SCHEMA
Initial value:
1 = vol.Schema(
2  {
3  vol.Required(CONF_PLATFORM): "flux",
4  vol.Required(CONF_LIGHTS): cv.entity_ids,
5  vol.Optional(CONF_NAME, default="Flux"): cv.string,
6  vol.Optional(CONF_START_TIME): cv.time,
7  vol.Optional(CONF_STOP_TIME): cv.time,
8  vol.Optional(CONF_START_CT, default=4000): vol.All(
9  vol.Coerce(int), vol.Range(min=1000, max=40000)
10  ),
11  vol.Optional(CONF_SUNSET_CT, default=3000): vol.All(
12  vol.Coerce(int), vol.Range(min=1000, max=40000)
13  ),
14  vol.Optional(CONF_STOP_CT, default=1900): vol.All(
15  vol.Coerce(int), vol.Range(min=1000, max=40000)
16  ),
17  vol.Optional(CONF_BRIGHTNESS): vol.All(
18  vol.Coerce(int), vol.Range(min=0, max=255)
19  ),
20  vol.Optional(CONF_DISABLE_BRIGHTNESS_ADJUST): cv.boolean,
21  vol.Optional(CONF_MODE, default=DEFAULT_MODE): vol.Any(
22  MODE_XY, MODE_MIRED, MODE_RGB
23  ),
24  vol.Optional(CONF_INTERVAL, default=30): cv.positive_int,
25  vol.Optional(ATTR_TRANSITION, default=30): VALID_TRANSITION,
26  vol.Optional(ATTR_UNIQUE_ID): cv.string,
27  }
28 )

Definition at line 68 of file switch.py.