-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLights.html
89 lines (88 loc) · 3.69 KB
/
Lights.html
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
<!DOCTYPE html>
<html ng-app="testApp">
<head>
<meta charset="ISO-8859-1">
<title>Hue Lights Controller Page</title>
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="hue-proxy-client.js"></script>
<script type="text/javascript" src="app.js"></script>
<link rel="stylesheet" href="app.css" />
<link
href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"
rel="stylesheet" />
</head>
<body>
<div class="container-fluid">
<div id="content">
<ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
<li class="active"><a href="#lights" data-toggle="tab">Lights</a></li>
<li><a href="#templates" data-toggle="tab">Templates</a></li>
<li><a href="#custom" data-toggle="tab">Custom</a></li>
</ul>
<div id="my-tab-content" class="tab-content">
<div id="lights" class="tab-pane active"
ng-controller="TestController as test">
<ul>
<li ng-repeat="light in test.getLightsList()"
ng-show="light != null">
<form name="testForm" novalidate>
<h4>
ID: {{light.id}} Name: <input type="text"
value="{{light.name}}" ng-model="light.name" /> <input
type="button" value="Get State"
ng-click="test.getLightByLightId(light.id);" /> <input
type="button" value="Update State"
ng-click="test.updateLightByLightId(light.id);"
ng-disabled="!testForm.$dirty" /> <input type="button"
value="Toggle Power"
ng-click="test.toggleLightByLightId(light.id);" /> <input
type="button" value="Strobe"
ng-click="test.strobeLightByLightId(light.id);" />
</h4>
<h4 ng-show="light.state != null">
State:
<ul name="testFormState">
<li>Reachable: <input type="text"
value="{{light.state.reachable}}" ng-disabled="true" /></li>
<li>On: <input type="text" value="{{light.state.on}}"
ng-model="light.state.on" /></li>
<li>Hue: <input type="number" value="{{light.state.hue}}"
ng-model="light.state.hue" /></li>
<li>Brightness: <input type="text"
value="{{light.state.bri}}" ng-model="light.state.bri" /></li>
<li>Saturation: <input type="text"
value="{{light.state.sat}}" ng-model="light.state.sat" /></li>
<li>XY: <input type="text" value="{{light.state.xy[0]}}"
ng-model="light.state.xy[0]" /> <input type="text"
value="{{light.state.xy[1]}}" ng-model="light.state.xy[1]" /></li>
<li>ColorTemperature: <input type="text"
value="{{light.state.ct}}" ng-model="light.state.ct" /></li>
<li>ColorMode: <input type="text"
value="{{light.state.colormode}}"
ng-model="light.state.colormode" /></li>
<li>AlertMode: <input type="text"
value="{{light.state.alert}}" ng-model="light.state.alert" /></li>
<li>Effect: <input type="text"
value="{{light.state.effect}}" ng-model="light.state.effect" /></li>
</ul>
</h4>
</form>
</li>
</ul>
<input type="color" name="colorPicker" ng-model="test.colorPicker" />
<input type="button"
ng-click="test.convertRGBToHSL(test.colorPicker)"
value="Convert Color to HSL" /> <input type="button"
ng-click="test.convertRGBToLowerCaseXY(test.colorPicker)"
value="Convert Color to XY" />
</div>
<div id="templates" class="tab-pane">Templates coming soon...</div>
<div id="custom" class="tab-pane">Custom coming soon...</div>
</div>
</div>
</div>
<script src="jquery-2.0.3.js"></script>
<script
src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</body>
</html>