-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfiguration.html
More file actions
257 lines (247 loc) · 17.8 KB
/
configuration.html
File metadata and controls
257 lines (247 loc) · 17.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Configuration — Playhouse 0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Playhouse 0.1 documentation" href="index.html" />
<link rel="up" title="Web server" href="frontend.html" />
<link rel="next" title="Game API" href="games.html" />
<link rel="prev" title="Web server" href="frontend.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="http-routingtable.html" title="HTTP Routing Table"
>routing table</a> |</li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="games.html" title="Game API"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="frontend.html" title="Web server"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Playhouse 0.1 documentation</a> »</li>
<li><a href="frontend.html" accesskey="U">Web server</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="configuration">
<span id="config"></span><h1>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h1>
<p>The configuration interface can be reach as a webpage on <tt class="docutils literal"><span class="pre">http://localhost:<config_port>/config</span></tt> where the default port is <tt class="docutils literal"><span class="pre">8081</span></tt>.</p>
<p>There are six source files directly associated with this module, which can be
found in the relevant directories:</p>
<ol class="arabic simple">
<li><tt class="docutils literal"><span class="pre">src/config.py</span></tt>: the main module source code, responsible for handling all requests in the configuration interface</li>
<li><tt class="docutils literal"><span class="pre">templates/config_base.html</span></tt>: base template file</li>
<li><tt class="docutils literal"><span class="pre">templates/config_setup.html</span></tt>: template file for Setup</li>
<li><tt class="docutils literal"><span class="pre">templates/config_game.html</span></tt>: template file for Settings</li>
<li><tt class="docutils literal"><span class="pre">templates/game/*</span></tt>: template files for game settings</li>
<li><tt class="docutils literal"><span class="pre">templates/config_bridges.html</span></tt> template file for Bridges</li>
</ol>
<div class="section" id="the-configuration-interface">
<h2>The configuration interface<a class="headerlink" href="#the-configuration-interface" title="Permalink to this headline">¶</a></h2>
<p>The configuration interface helps you configure your installation, without having to change the configuration file.</p>
<div class="section" id="setup">
<span id="id1"></span><h3>Setup<a class="headerlink" href="#setup" title="Permalink to this headline">¶</a></h3>
<p>This page contains settings for connections and external services. Some of settings may that the server is restarted.</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">Status</span></tt> Show the current connection status to the lamp server.</li>
<li><tt class="docutils literal"><span class="pre">Lamp</span> <span class="pre">server</span></tt> Address to the lamp server and what port to connect to. (default: <tt class="docutils literal"><span class="pre">localhost:4711</span></tt>)</li>
<li><tt class="docutils literal"><span class="pre">Game</span> <span class="pre">server</span> <span class="pre">port</span></tt> This is the port the web server that serves the game interface will listen on. (default: <tt class="docutils literal"><span class="pre">8080</span></tt>)</li>
<li><tt class="docutils literal"><span class="pre">Config</span> <span class="pre">server</span> <span class="pre">port</span></tt> This is the port the web server that serves the configuration interface will listen on. (default: <tt class="docutils literal"><span class="pre">8081</span></tt>)</li>
<li><tt class="docutils literal"><span class="pre">Embed</span> <span class="pre">code</span></tt> The content in this text area will be inserted in the game interface and is primarily for embedding a live stream player.</li>
</ul>
<p>Note: Do not use the same port for game and config or the game interface will not be able to start.</p>
</div>
<div class="section" id="settings">
<span id="id2"></span><h3>Settings<a class="headerlink" href="#settings" title="Permalink to this headline">¶</a></h3>
<p>This page is used to change game and game settings.</p>
<p>All games found in the game paths is listed to the left and the current game can
be changed directly by clicking on any of the listed games. Note: Changing game
paths has to be done by editing <tt class="docutils literal"><span class="pre">game_paths</span></tt> in the config file.</p>
<p>Game settings are shown on the right and will show the config template specified
by <tt class="docutils literal"><span class="pre">config_file</span></tt> in the the running game module. For more information, see the
documentation on game settings for each module.</p>
</div>
<div class="section" id="bridges">
<h3>Bridges<a class="headerlink" href="#bridges" title="Permalink to this headline">¶</a></h3>
<p>This menu handles all the Hue bridges that are used. It lists all bridges the
lightserver knows about, sorted by their MAC-address.</p>
<p>The table shows several properties for each added bridge.</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">#</span></tt> A number for the bridge. No real use.</li>
<li><tt class="docutils literal"><span class="pre">Select</span></tt> A checkbox to select this bridge. Used together with some of the buttons described below.</li>
<li><tt class="docutils literal"><span class="pre">MAC</span></tt> The MAC-address for the bridge.</li>
<li><tt class="docutils literal"><span class="pre">IP</span></tt> The IP-address for the bridge.</li>
<li><tt class="docutils literal"><span class="pre">valid_username</span></tt> Shows if the bridge has a valid username. This is a link, by pressing on it you can generate a new username for the bridge.</li>
<li><tt class="docutils literal"><span class="pre">#</span> <span class="pre">Lights</span></tt> The number of Hue Lamps that are associated with this bridge.</li>
</ul>
<p>You can use the buttons to do stuff.</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">Identify</span> <span class="pre">Selected</span></tt> Makes the selected bridges do a breathe-cycle (turn on and off).</li>
<li><tt class="docutils literal"><span class="pre">Add</span> <span class="pre">Bridge</span></tt> Tries to add a bridge with a specifed IP in the textfield.</li>
<li><tt class="docutils literal"><span class="pre">Remove</span> <span class="pre">Selected</span></tt> Removes the selected bridges.</li>
<li><tt class="docutils literal"><span class="pre">Refresh</span> <span class="pre">List</span></tt> Forces a refresh of the cached list.</li>
<li><tt class="docutils literal"><span class="pre">Search</span> <span class="pre">Bridges</span></tt> Instructs the lighthserver to search for new bridges.
It will do a network broadcast and poll Philips website. The search will take about 20 seconds, and you <strong>must</strong> click the button <tt class="docutils literal"><span class="pre">Refresh</span> <span class="pre">List</span></tt> after that time.</li>
</ul>
</div>
<div class="section" id="grid">
<h3>Grid<a class="headerlink" href="#grid" title="Permalink to this headline">¶</a></h3>
<p>This menu helps you manage your lamps. After you placed the lamps, you will need a way to tell the lightserver which lamp corresponds to which coordinate.</p>
<ol class="arabic simple">
<li>Enter your grid-size in the textfield and press <tt class="docutils literal"><span class="pre">Change</span> <span class="pre">Size</span></tt></li>
<li>Click <tt class="docutils literal"><span class="pre">Turn</span> <span class="pre">Off</span></tt> to turn off all Hue-lamps.</li>
<li>One Hue-lamp should be blue, press on the corresponding cell in the grid in your browser.</li>
<li>Continue until all lights have been configured.</li>
<li><strong>Press Save</strong></li>
</ol>
<p>If you miss-click, you can press the cell again to remove it, and the lamp is scheduled
for reconfiguration. You may skip lamps by pressing the button <tt class="docutils literal"><span class="pre">Skip</span> <span class="pre">Lamps</span></tt>.</p>
<p>Actions:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">Skip</span> <span class="pre">Lamp</span></tt> Skips the current lamp and proceeds with the next one.</li>
<li><tt class="docutils literal"><span class="pre">Place</span> <span class="pre">Lamp</span></tt> Places the lamp in the given coordinates instead of clicking on the cell.</li>
<li><tt class="docutils literal"><span class="pre">Save</span></tt> Saves and use the grid on the lamp server.</li>
<li><tt class="docutils literal"><span class="pre">Refresh</span></tt> Discard the local grid and request the one currently used on the lamp server.</li>
<li><tt class="docutils literal"><span class="pre">Clear</span></tt> Clear the grid from placed lamps.</li>
<li><tt class="docutils literal"><span class="pre">Turn</span> <span class="pre">Off</span></tt> Cancel any running game and turn off all lamps.</li>
<li><tt class="docutils literal"><span class="pre">Run</span> <span class="pre">Diagnostics</span></tt> Run diagnostics to test the grid on the lamp server.</li>
</ul>
<p>Errors:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">No</span> <span class="pre">activated</span> <span class="pre">lamp</span></tt> there is either no more lamps available that isn’t already placed</li>
<li><tt class="docutils literal"><span class="pre">Invalid</span> <span class="pre">position</span></tt> the position were in an incorrect format and couldn’t be parsed be the server</li>
<li><tt class="docutils literal"><span class="pre">Invalid</span> <span class="pre">size</span></tt> the size were in an incorrect format and couldn’t be parsed be the server</li>
<li><tt class="docutils literal"><span class="pre">Invalid</span> <span class="pre">lamp</span></tt> the placed lamp is no longer valid and can’t be placed</li>
<li><tt class="docutils literal"><span class="pre">Saving</span> <span class="pre">failed</span></tt> given when the lamp server couldn’t save the grid</li>
</ul>
</div>
</div>
<div class="section" id="the-configuration-file">
<h2>The configuration file<a class="headerlink" href="#the-configuration-file" title="Permalink to this headline">¶</a></h2>
<p>Everything under <a class="reference internal" href="#setup"><em>Setup</em></a> and <a class="reference internal" href="#settings"><em>Settings</em></a> can also be changed manually in <tt class="docutils literal"><span class="pre">config.json</span></tt>.</p>
<div class="section" id="attributes">
<h3>Attributes<a class="headerlink" href="#attributes" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">game_name</span></tt> - name of initial game module to start (default: <tt class="docutils literal"><span class="pre">"default"</span></tt>)</li>
<li><tt class="docutils literal"><span class="pre">game_path</span></tt> - list of paths to where games can be found (default: <tt class="docutils literal"><span class="pre">["src/games"]</span></tt>)</li>
<li><tt class="docutils literal"><span class="pre">lampdest</span></tt> - address to lamp server (default: <tt class="docutils literal"><span class="pre">"localhost"</span></tt>)</li>
<li><tt class="docutils literal"><span class="pre">lampport</span></tt>- port to connect to lamp server (default: <tt class="docutils literal"><span class="pre">4711</span></tt>)</li>
<li><tt class="docutils literal"><span class="pre">serverport</span></tt> - port the game server will listen on (default: <tt class="docutils literal"><span class="pre">8080</span></tt>)</li>
<li><tt class="docutils literal"><span class="pre">configport</span></tt> - port the config server will listen on (default: <tt class="docutils literal"><span class="pre">8081</span></tt>)</li>
<li><tt class="docutils literal"><span class="pre">stream_embedcode</span></tt> - HTML string with stream embed code (default: <tt class="docutils literal"><span class="pre">""</span></tt>)</li>
<li><tt class="docutils literal"><span class="pre">light_ssl</span></tt> - set to <tt class="docutils literal"><span class="pre">true</span></tt> to connect to the lamp server with HTTPS</li>
<li><tt class="docutils literal"><span class="pre">light_certfile</span></tt> - only needed if <tt class="docutils literal"><span class="pre">light_ssl</span></tt> is <tt class="docutils literal"><span class="pre">true</span></tt></li>
<li><tt class="docutils literal"><span class="pre">light_pwd</span></tt> - password used to authorize with the lamp server</li>
<li><tt class="docutils literal"><span class="pre">config_ssl</span></tt> - when <tt class="docutils literal"><span class="pre">true</span></tt>, run config interface on a HTTPS server</li>
<li><tt class="docutils literal"><span class="pre">config_certfile</span></tt> - only needed if <tt class="docutils literal"><span class="pre">config_ssl</span></tt> is <tt class="docutils literal"><span class="pre">true</span></tt></li>
<li><tt class="docutils literal"><span class="pre">config_keyfile</span></tt> - only needed if <tt class="docutils literal"><span class="pre">config_ssl</span></tt> is <tt class="docutils literal"><span class="pre">true</span></tt></li>
<li><tt class="docutils literal"><span class="pre">config_pwd</span></tt> - when set, password needed to access config</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Configuration</a><ul>
<li><a class="reference internal" href="#the-configuration-interface">The configuration interface</a><ul>
<li><a class="reference internal" href="#setup">Setup</a></li>
<li><a class="reference internal" href="#settings">Settings</a></li>
<li><a class="reference internal" href="#bridges">Bridges</a></li>
<li><a class="reference internal" href="#grid">Grid</a></li>
</ul>
</li>
<li><a class="reference internal" href="#the-configuration-file">The configuration file</a><ul>
<li><a class="reference internal" href="#attributes">Attributes</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="frontend.html"
title="previous chapter">Web server</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="games.html"
title="next chapter">Game API</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/configuration.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="http-routingtable.html" title="HTTP Routing Table"
>routing table</a> |</li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="games.html" title="Game API"
>next</a> |</li>
<li class="right" >
<a href="frontend.html" title="Web server"
>previous</a> |</li>
<li><a href="index.html">Playhouse 0.1 documentation</a> »</li>
<li><a href="frontend.html" >Web server</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2014, John Eriksson, Arvid Fahlström Myrman, Jonas Höglund, Hannes Leskelä, Christian Lidström, Mattias Palo, Markus Videll, Tomas Wickman, Emil Öhman.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>