Adds global version and switches start/stop to buttons

This commit is contained in:
Patrick McDonagh
2016-09-07 16:43:00 -05:00
parent ad9d1cacde
commit ab5e940bf1
2 changed files with 29 additions and 7 deletions

View File

@@ -7,12 +7,28 @@
<div class="text-center"><h1>CONTROL</h1></div> <div class="text-center"><h1>CONTROL</h1></div>
<div class="row row-flex"> <div class="row row-flex">
<div class='col-xs-6 text-center box-me'> <div class='col-xs-6 text-center box-me'>
<h2>Start Command</h2> <a href="#"
<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 %>"> 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>
<div class='col-xs-6 text-center box-me'> <div class='col-xs-6 text-center box-me'>
<h2>Stop Command</h2> <a href="#"
<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 %>"> 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> </div>
<div class="text-center"><h1>VFD CONFIGURATION</h1></div> <div class="text-center"><h1>VFD CONFIGURATION</h1></div>

View File

@@ -1,12 +1,14 @@
#!/usr/bin/python #!/usr/bin/python
import threading import threading
import traceback
import time import time
from device_base import deviceBase from device_base import deviceBase
import micro800 as u800 import micro800 as u800
addr = '10.20.4.5' addr = '10.20.4.5'
channels = {} channels = {}
version = "3"
e300_current = { 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): 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) 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) 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.daemon = True
self.version = "3" self.version = version
self.device_address = addr self.device_address = addr
self.finished = threading.Event() self.finished = threading.Event()
threading.Thread.start(self) threading.Thread.start(self)
self.sendtodbJSON("device_address", self.device_address, 0) 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_warning = ""
self.e300_trip = "" self.e300_trip = ""
# self.updateGPS() # self.updateGPS()