Example #1
0
def DAE_thread():
    dae = SimpleParser(
        url="http://supremesports.ddns.net:8082/current_state.xml?pw=abcd1234")
    while True:
        dae.reload()
        pooltemp = dae.get("AnalogInput4", "Value") / 7.64
        pooltemp = "%0.1f" % pooltemp
        data = dict(daePoolTempState=pooltemp)
        #print "dict="+str(data)
        socketio.emit('DAE', data)
Example #2
0
def TED_thread():
    ted = SimpleParser()
    while True:
        ted.reload()
        powernow = ted.get("Power", "Total", "PowerNow") / 1000
        powernow = "%0.3f" % powernow
        voltagenow = ted.get("Voltage", "Total", "VoltageNow") / 10
        voltagenow = "%0.1f" % voltagenow
        costnow = ted.get("Cost", "Total", "CostNow") / 100
        costnow = "%0.2f" % costnow
        costtdy = ted.get("Cost", "Total", "CostTDY") / 100
        costtdy = "%0.2f" % costtdy
        #Display.ChangeDisplay(powernow, voltagenow, costnow, costtdy)
        data = dict(tedPowerState=powernow,
                    tedVoltageState=voltagenow,
                    tedCostState=costnow,
                    tedCosttdyState=costtdy)
        #print "dict="+str(data)
        socketio.emit('TED', data)