Welcome to AppLamp Python API’s documentation!¶
Contents:
AppLamp Python API¶
AppLamp Python API is a library for controlling AppLamp lighting from your Python code.
Installation¶
Install using pip:
sudo pip install applamp
Or download the repository and install with setup.py:
sudo python setup.py install
Examples & Documentation¶
Controlling white light bulbs:
from applamp import WhiteLight
light = WhiteLight()
light.on()
light.warmer()
light.fade_out()
light.night_mode(group=1)
Controlling RGB light bulbs:
from applamp import RgbLight
light = RgbLight()
light.fade_in()
light.hue(100) # changing color
light.next_effect()
You can see a list of all methods and their descriptions in the reference documentation.
White Lights¶
-
class
applamp.
WhiteLight
(ip='192.168.1.100', port=50000)¶ Create an object for controlling white AppLamp light bulbs. Optional attributes ip and port allow for a custom AppLamp Wifi Box setup. By default those values are 192.168.1.100 and 50000.
White AppLamp bulbs have a “group” future, allowing for partitioning of light sources into multiple groups. Most methods of this class supports this feature via an optional group attribute. The default value of 0 means the method will be applied to all light sources in all groups. Values between 1 and 4 will be interpreted as group identifiers, and the method will be applied only to light sources within a given group.
-
bright_down
(group=0)¶ Makes the light less bright.
-
bright_up
(group=0)¶ Makes the light brighter.
-
cooler
(group=0)¶ Makes the light less warm.
-
fade_in
(duration=3, group=0)¶ Turns on the light by gradually fading it in. The optional duration parameter allows for control of the fade in duration (in seconds)
-
fade_out
(duration=3, group=0)¶ Turns off the light by gradually fading it out. The optional duration parameter allows for control of the fade out duration (in seconds)
-
full_brightness
(group=0)¶ Sets brightness to 100%.
-
night_mode
(group=0)¶ Switches the lights into night mode (very low brightness).
-
off
(group=0)¶ Turns the lights off.
-
on
(group=0)¶ Turns the lights on.
-
warmer
(group=0)¶ Makes the light warmer.
-
RGB Lights¶
-
class
applamp.
RgbLight
(ip='192.168.1.100', port=50000)¶ Create an object for controlling RGB AppLamp light bulbs. Optional attributes ip and port allow for a custom AppLamp Wifi Box setup. By default those values are 192.168.1.100 and 50000.
-
bright_down
()¶ Makes the light less bright.
-
bright_up
()¶ Makes the light brighter.
-
fade_in
(duration=3)¶ Turns on the light by gradually fading it in. The optional duration parameter allows for control of the fade in duration (in seconds)
-
fade_out
(duration=3)¶ Turns off the light by gradually fading it out. The optional duration parameter allows for control of the fade out duration (in seconds)
-
faster_effect
()¶ Makes the current built-in light effect faster
-
hue
(value)¶ Changes the light color to value, which must be a hue value (a number between 0 and 255)
-
next_effect
()¶ Switches to a next built-in light effect
-
off
()¶ Turns the lights off.
-
on
()¶ Turns the lights on.
-
previous_effect
()¶ Switches to a previous built-in light effect
-
slower_effect
()¶ Makes the current built-in light effect slower
-