-
Notifications
You must be signed in to change notification settings - Fork 5
/
relay_board.html
64 lines (58 loc) · 3.4 KB
/
relay_board.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
$def with(m_vals)
<meta http-equiv="Context-Type" content="text/html; charset=US-ASCII">
$var title: $_('OSPi - Relay Board Settings')
$var page: plugins
<script>
// Initialize behaviors
jQuery(document).ready(function(){
jQuery("#cSubmit").click(function() {
jQuery("#pluginForm").submit();
});
jQuery("button#cCancel").click(function(){
window.location="/";
});
jQuery("button#docButton").click(function(){
window.open("https://github.com/KanyonKris/sprinkler-weather/wiki/relay_board-Documentation", "_blank"); //Edit: replace "proto-docs.html"
})
});
</script>
<div id="plugin">
<div class="title">$_('Relay Board Settings')
<button class="execute" id="docButton" type="button" >$_('Help')</button>
</div>
<p>$_('A plugin for using relay boards to control sprinkler valves.')
</p>
<br>
<form id="pluginForm" action="/rbu" method="get">
<div class='option' title='Number of relays connected to the Raspberry Pi (relay boards are commonly 2, 4, 8)'><span class='label'>$_('Relay channels'):</span>
<select name="relays">
<option value="1" ${" selected" if m_vals[u"relays"]==1 else ""}>1</option>
<option value="2" ${" selected" if m_vals[u"relays"]==2 else ""}>2</option>
<option value="3" ${" selected" if m_vals[u"relays"]==3 else ""}>3</option>
<option value="4" ${" selected" if m_vals[u"relays"]==4 else ""}>4</option>
<option value="5" ${" selected" if m_vals[u"relays"]==5 else ""}>5</option>
<option value="6" ${" selected" if m_vals[u"relays"]==6 else ""}>6</option>
<option value="7" ${" selected" if m_vals[u"relays"]==7 else ""}>7</option>
<option value="8" ${" selected" if m_vals[u"relays"]==8 else ""}>8</option>
<option value="9" ${" selected" if m_vals[u"relays"]==9 else ""}>9</option>
<option value="10" ${" selected" if m_vals[u"relays"]==10 else ""}>10</option>
<option value="11" ${" selected" if m_vals[u"relays"]==11 else ""}>11</option>
<option value="12" ${" selected" if m_vals[u"relays"]==12 else ""}>12</option>
</select>
<span class='tooltip'>$_('Number of relays connected to the Raspberry Pi /(relay boards are commonly 2, 4, 8/)')</span>
</div>
<div class='option' title='Active low means the relay turns on when the input is low and turns off when the input is high. Active high does the opposite.'><span class='label'>$_('Active'):</span>
<input type="radio" name="active" value="low" ${" checked" if m_vals[u"active"]==u"low" else ""}>Low
<input type="radio" name="active" value="high" ${" checked" if m_vals[u"active"]==u"high" else ""}>High
<span class='tooltip'>$_('Active low means the relay turns on when the input is low and turns off when the input is high. Active high does the opposite.')</span>
</div>
<br>
<p><b>$_('IMPORTANT'):</b> $_('If') <b>$_('Active')</b> $_('is changed'), <b>$_('Relay channels')</b> $_('will be set to') <b>1</b> $_('to prevent all the relays being switched on, and possibly damaging the power supply.')
$_('After verifying that the first relay is off, return to this page and set') <b>$_('Relay channels')</b> $_('to the correct number.')
</p>
</form>
</div>
<div id="controls">
<button id="cSubmit" class="submit"><b>$_('Submit')</b></button>
<button id="cCancel" class="cancel danger">$_('Cancel')</button>
</div>