Adds global version and switches start/stop to buttons
This commit is contained in:
@@ -7,12 +7,28 @@
|
||||
<div class="text-center"><h1>CONTROL</h1></div>
|
||||
<div class="row row-flex">
|
||||
<div class='col-xs-6 text-center box-me'>
|
||||
<h2>Start Command</h2>
|
||||
<input type="toggle" data-checkedValue="1" data-uncheckedValue="0" data-valueupdate="startcommand" data-channelId='<%= channels["ipp.startcommand"].channelId %>' data-techName='<%=channels["ipp.startcommand"].techName %>' data-name='ipp.startcommand' id="<%= channels["ipp.startcommand"].channelId %>" name="<%= channels["ipp.startcommand"].channelId %>">
|
||||
<a href="#"
|
||||
data-refreshpause="1"
|
||||
data-staticsend="1"
|
||||
data-channelId="<%= channels["ipp.startcommand"].channelId %>"
|
||||
data-techname="<%=channels["ipp.startcommand"].techName %>"
|
||||
data-name="<%= channels["ipp.startcommand"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["ipp.startcommand"].nodechannelcurrentId %>"
|
||||
id="<%= channels["ipp.startcommand"].channelId %>"
|
||||
class="btn btn-large btn-block btn-theme animated setstatic mqtt">
|
||||
<i class="icon-repeat icon-white mqtt" ></i>Start Command</a>
|
||||
</div>
|
||||
<div class='col-xs-6 text-center box-me'>
|
||||
<h2>Stop Command</h2>
|
||||
<input type="toggle" data-checkedValue="1" data-uncheckedValue="0" data-valueupdate="stopcommand" data-channelId='<%= channels["ipp.stopcommand"].channelId %>' data-techName='<%=channels["ipp.stopcommand"].techName %>' data-name='ipp.stopcommand' id="<%= channels["ipp.stopcommand"].channelId %>" name="<%= channels["ipp.stopcommand"].channelId %>">
|
||||
<a href="#"
|
||||
data-refreshpause="1"
|
||||
data-staticsend="1"
|
||||
data-channelId="<%= channels["ipp.stopcommand"].channelId %>"
|
||||
data-techname="<%=channels["ipp.stopcommand"].techName %>"
|
||||
data-name="<%= channels["ipp.stopcommand"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["ipp.stopcommand"].nodechannelcurrentId %>"
|
||||
id="<%= channels["ipp.stopcommand"].channelId %>"
|
||||
class="btn btn-large btn-block btn-theme animated setstatic mqtt">
|
||||
<i class="icon-repeat icon-white mqtt" ></i>Stop Command</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center"><h1>VFD CONFIGURATION</h1></div>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import threading
|
||||
import traceback
|
||||
import time
|
||||
from device_base import deviceBase
|
||||
import micro800 as u800
|
||||
|
||||
addr = '10.20.4.5'
|
||||
channels = {}
|
||||
version = "3"
|
||||
|
||||
|
||||
e300_current = {
|
||||
@@ -382,17 +384,21 @@ class start(threading.Thread, deviceBase):
|
||||
}
|
||||
|
||||
def __init__(self, name=None, number=None, mac=None, Q=None, mcu=None, companyId=None, offset=None, mqtt=None, Nodes=None):
|
||||
global addr
|
||||
global addr, version
|
||||
threading.Thread.__init__(self)
|
||||
deviceBase.__init__(self, name=name, number=number, mac=mac, Q=Q, mcu=mcu, companyId=companyId, offset=offset, mqtt=mqtt, Nodes=Nodes)
|
||||
|
||||
self.daemon = True
|
||||
self.version = "3"
|
||||
self.version = version
|
||||
self.device_address = addr
|
||||
self.finished = threading.Event()
|
||||
threading.Thread.start(self)
|
||||
self.sendtodbJSON("device_address", self.device_address, 0)
|
||||
self.setupChannels()
|
||||
try:
|
||||
self.setupChannels()
|
||||
except:
|
||||
print("Unable to initialize channels...")
|
||||
traceback.print_exc()
|
||||
self.e300_warning = ""
|
||||
self.e300_trip = ""
|
||||
# self.updateGPS()
|
||||
|
||||
Reference in New Issue
Block a user