示例#1
0
from CommonDataTypes import HeepIPAddress
from ActionOpCodeParser import ActionOpCodeParser
from OpCodeUtilities import OpCodeUtilities


def CheckEquality(first, second, testName):
    if first == second:
        return testName + ': Success'
    return testName + ': Failed******   Received: ' + str(
        first) + ' ****  Expected:' + str(second)


# Create Controls and Devices
otherDevice = Device()
otherDevice.DeviceID = 1523
otherDevice.DeviceName = 'Sloppy'
Control1 = ControlValue()
Control1.ControlName = 'Forge'
Control2 = ControlValue()
Control2.ControlName = 'Fast'
otherDevice.ControlList.append(Control1)
otherDevice.ControlList.append(Control2)
print CheckEquality(otherDevice.DeviceName, 'Sloppy', 'DeviceNameSetTest')

# Extract, Create, and Update Queued Commands
firstCtrl = otherDevice.ControlList[1]
firstCtrl.CurCtrlValue = 40
otherDevice.QueueControl(firstCtrl)
curCtrl = otherDevice.ControlList[0]
curCtrl.CurCtrlValue = 3
otherDevice.QueueControl(curCtrl)