Getting Started¶
Installation¶
Installing with Pip¶
pip install volux
Congratulations, you’ve just installed Volux!
Note
If you would rather build the module yourself, see “Installing from source”
Next, let’s try running the ‘bar’ demo.
Running Demos¶
Bar Demo¶
Once volux is finished installing, you can run the bar demo like so:
volux demo bar
You should now see a transparent bar at the bottom of your screen.
Bar Demo Explained¶
In different modes, performing identical actions on the bar produce different results.
Below, you’ll see a table of representing the result of performing certain actions on the bar in a given mode.
Bar Color | Action | Result |
---|---|---|
Any | Right-click Double right-click |
Change bar mode Exit demo |
Green | Scroll up Scroll down Middle-click |
Increase volume Decrease volume Mute |
Red | Scroll up Scroll down Middle-click |
Increase volume Decrease volume Unmute |
Blue | Scroll up Scroll down Middle-click |
Increase bulb brightness Decrease bulb brightness Toggle bulb power |
Examples¶
Classes¶
VoluxLight¶
Warning
This section is a work-in-progress
Adding New Lights¶
from voluxlight import VoluxLight
vlight = VoluxLight(<label>)
<operator instance>.add_module(vlight)
<label>
must be a string. This is the name you’ve set via your mobile for a LIFX bulb on your network.
In the bar demo, we have a bulb with the label 'Demo Bulb'
,
so we set <label> to match it accordingly.
Installing from source¶
Warning
If any of the code below looks unfamiliar or scary to you, building from source is not a good idea. It is highly recommended to install volux from pip or at least via the latest wheel release on pypi.
git clone https://github.com/DrTexx/Volux.git
cd Volux
python3 -m venv venv
source venv/bin/activate
pip install -r volux/demos/demo_volbar_requirements.txt
pip install wheel setuptools --upgrade
python3 setup.py bdist_wheel
cd dist
pip install volux-*.whl
Writing your own modules¶
Warning
This section is a work-in-progress
Example Module¶
from volux import VoluxModule
class DecoyVoluxModule(VoluxModule):
def __init__(self, *args, **kwargs):
super().__init__(
module_name="Decoy Module",
module_attr="decoy",
module_get=self.get,
module_set=self.set,
)
self.val = 0
def get(self):
return self.val
def set(self, new_val):
self.val = new_val
module_name
is the human-readable name for your volux module.
module_attr
is the attribute which will be added to the VoluxOperator object.
module_get
is the class method for getting the modules generic data
module_set
is the class method for setting the modules generic data