Ejemplo n.º 1
0
 def __init__(self):
     self.errorState = False  # If an error has occured
     self.switch = None
     self.powerOn = False
     self.active = False
     self.target = 80
     self.unit = 'X'
     # self.sensor = sensors.temperaeratorSensor()
     # Set a generic sensor, later swap for same sensor as boiler.
     self.sensor = sensors.genericSensor()
Ejemplo n.º 2
0
 def __init__(self):
     self.errorState = False  # If an error has occured
     self.switch = None
     self.powerOn = False
     self.active = False
     self.target = 80
     self.unit = 'F'
     # self.sensor = sensors.temperboilerValveSensor()
     # Set a generic sensor, later swap for same sensor as boiler.
     self.sensor = sensors.genericSensor()
     self.actual = 0  # Actual measured value, ex temp
Ejemplo n.º 3
0
 def __init__(self):
     """
     Switch is not used, just to be consistent with other modules
     """
     self.errorState = False  # If an error has occured
     self.actual = 0.0
     self.target = 0.0
     self.active = False
     self.absminutes = time.localtime(time.time()).tm_sec / 60.0
     self.unit = 'min'
     self.powerOn = 'False'
     self.sensor = sensors.genericSensor()
Ejemplo n.º 4
0
 def __init__(self):
     """
     Used to hold info about the controllerinfo
     As example, this can hold controller type and name etc.
     """
     self.errorState = False  # If an error has occured
     self.actual = 0.0
     self.target = 0.0
     self.active = False
     self.unit = 'U'
     self.powerOn = 'False'
     self.sensor = sensors.genericSensor()
     
     self.equipment = {}
Ejemplo n.º 5
0
 def __init__(self):
     """
     Constructor
     multiple devices may require same switch collection
     Note, controller can run but power
     could be off, as example, heater goes
     on and off, while controller is active
     """
     self.errorState = False  # If an error has occured
     self.actual = 0  # Actual measured value, ex temp
     self.target = 0  # Target value
     self.unit = "U"  # Unit of measure
     self.powerOn = False  # If the power is on heater/pump etc
     self.active = False  # Controller is running
     self.switch = None  # Switch object. Should have method on and off
     self.sensor = sensors.genericSensor()
Ejemplo n.º 6
0
    def __init__(self, number=1):
        '''
        Constructor
        multiple devices may require same switch collection
        Note, controller can run but power
        could be off, as example, heater goes
        on and off, while controller is active
        '''
        self.errorState = False  # If an error has occured
        self.deviceNumber = number
        self.servo = str(number)
        self.actual = full       # Actual measured value, ex temp
        self.target = full       # Target value
        self.unit = 'U'       # Unit of measure
        self.powerOn = False  # If the power is on heater/pump etc
        self.active = False   # Controller is running
        self.switch = None    # Switch object. Should have method on and off
        self.sensor = sensors.genericSensor()

        try:
            ret = subprocess.call('lsusb',  stdout=open('/dev/null', 'w'),
                                  stderr=subprocess.STDOUT)
        except:
            ret = 9
        self.usbOK = (ret == 0)

        scriptdir = os.path.dirname(os.path.abspath(__file__))
        self.exe = scriptdir + '/../../UscCmd/UscCmd'

        # If multiple dispensers are added, these values can be set in
        # connectSwitch
        if number % 2 == 1:
            self.vFull = '8000'
            self.vEmpty = '4000'
        else:
            self.vFull = '4000'
            self.vEmpty = '8000'
        self.exeFull = self.exe + ' --servo ' + self.servo + ',' + self.vFull
        self.exeEmpty = self.exe + ' --servo ' + self.servo + ',' + self.vEmpty

        self.move()