TechInc Powerbars
Python HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
configs
init
templates
README
bar.py
bar9p.py
barconfig.py
httpbar.py
reset.py
server.py
spacebar.py
switch.py
vbar.py
wtibar.py

README

= Powerbars for TechInc =

We have multiple powerbars, controllable over serial. Each of these bars has
power sockets that can be turned on/off individually. The plan is to use these
throughout to space to be able to remotely control the lights and other
machinery.

== Design ==

Since we don't care about where the bars are and how many we have, the most
basic component we consider in a socket. A socket can be turned on or off.
A socket can be part of a group. As such, a group consists of a set of sockets.
Groups can be turned on or off as a whole. Finally, there will be presets,
which consist of a two sets of groups, one set that needs to be turned off,
one that needs to be turned on.


=== Bars ===

Each powerbar has a number of sockets.

=== Sockets ===

Each socket can be turned off and on individually.

=== Groups ===

Each group contains a set of sockets and thus allows turning off or on a set of
sockets.

=== Prefixes ===

A preset contains a set of groups to turn off and a set of groups to turn on.

== Security ==

The plan is to use serial cables to connect the bars together,
but optionally we can put a cheap device with serial in front of
every powerbar and have them communicate over HTTPS.
The inter-device communication (where required) will happen over HTTPS, using
certificates for authentication.

ACL's will be used, to "secure" certain groups if deemed necessary.

The main supported API is listed below. Some other interfaces (with possibly
access to all components) will follow.

== API ==

export MLP_HOST=10.0.20.30
export MLP_PORT=5000

a BAR and SOCKET are number, a group and a preset are strings

=== Sockets ===

    curl -d state=$STATE http://$MLP_HOST:$MLP_PORT/$BAR/$SOCKET

Concere:

    curl -d state=Off http://$MLP_HOST:$MLP_PORT/AUX/W_LIGHT_TABLE



=== Groups ===

    curl -d state=Off http://$MLP_HOST:$MLP_PORT/group/table


=== Prefix ===

    curl -d "" http://$MLP_HOST:$MLP_PORT/preset/alloff

== Examples ==

Check barconfig.py