예제 #1
0
	def __init__(self, id, power, network, address, resolution=256, channels=64):
		"""
		Constructor for a Renard SSR board object:
			RenardControllerUnit(id, power, network, address, [resolution], [channels])

		Specify the correct PowerSource object for this unit and
		the unit address (0-127).  (We will call the first unit address 0,
		even though behind the scenes the address byte's MSB will be sent
		when transmitted (so unit address 0 transmits as 0x80, address 1
		transmits as 0x81, etc.)  The number of channels defaults to 64, but there
		are known Renard implementations with 8, 16, 24, 32 and 64 channels and
		probably others.  This sets the upper bound for channel IDs on this
		controller unit, and also the packet size which will always be sent
		when pending changes are flushed out to the hardware.

		The resolution probably won't ever need to be changed.  The Renards
		use 256 dimmer levels, so that's the default for that parameter.
		"""

		ControllerUnit.__init__(self, id, power, network, resolution)
		self.address = int(address)
		self.type = 'Renard SSR Controller (%d channels)' % channels
		self.channels = [None] * channels
		self.update_pending = False
		self.iter_channels = self._iter_non_null_channel_list

		if not 0 <= self.address < 127:
			raise ValueError("Address %d out of range for a Renard SSR Controller" % self.address)
예제 #2
0
    def add_channel(self, id, name=None, load=None, dimmer=True, warm=None, resolution=None, power=None):
        try:
            id = int(id)
            assert 0 <= id <= 47
        except:
            raise ValueError, "Lumos 48SSR channel IDs must be integers from 0-47"

        if resolution is not None:
            resolution = int(resolution)
        else:
            resolution=self.resolution

        ControllerUnit.add_channel(self, id, name, load, dimmer, warm, resolution, power)
예제 #3
0
    def add_channel(self, id, name=None, load=None, dimmer=True, warm=None, resolution=None, power=None):
        try:
            id = int(id)
            assert 0 <= id < len(self.channels)
        except:
            raise ValueError("%d-channel FireGod channel IDs must be integers from 0-%d"
                % (len(self.channels), len(self.channels)-1))
                
        if resolution is not None:
            resolution = int(resolution)
        else:
            resolution=self.resolution

        ControllerUnit.add_channel(self, id, name, load, dimmer, warm, resolution, power)
예제 #4
0
    def add_channel(self, id, name=None, load=None, dimmer=True, warm=None, resolution=None, power=None):
        try:
            id = self.channel_id_from_string(id)
            assert('A' <= id[0] <= 'P')
            assert(1 <= int(id[1:]) <= 16)
        except:
            raise ValueError, "X-10 channels must be 'A1'..'P16'"

        if resolution is not None:
            resolution = int(resolution)
        else:
            resolution = self.resolution

        ControllerUnit.add_channel(self, id, name, load, dimmer, warm, resolution, power)
예제 #5
0
    def __init__(self, id, power, network, address, resolution=32):
        """
        Constructor for a 48-Channel SSR board object:
            LumosControllerUnit(id, power, address, [resolution])

        Specify the correct PowerSource object for this unit and
        the unit address (0-15).  The resolution defaults to 32,
        which is correct for the 3.1 revision of the boards.
        """

        ControllerUnit.__init__(self, id, power, network, resolution)
        self.address = int(address)
        self.type = 'Lumos 48-Channel SSR Controller'
        self.iter_channels = self._iter_non_null_channel_list
        if not 0 <= self.address <= 15:
            raise ValueError, "Address %d out of range for Lumos 48-Channel SSR Controller" % self.address
예제 #6
0
    def __init__(self, id, power, network, address, resolution=32):
        """
        Constructor for a 48-Channel SSR board object:
            LumosControllerUnit(id, power, address, [resolution])

        Specify the correct PowerSource object for this unit and
        the unit address (0-15).  The resolution defaults to 32,
        which is correct for the 3.1 revision of the boards.
        """

        ControllerUnit.__init__(self, id, power, network, resolution)
        self.address = int(address)
        self.type = 'Lumos 48-Channel SSR Controller'
        self.iter_channels = self._iter_non_null_channel_list
        if not 0 <= self.address <= 15:
            raise ValueError, "Address %d out of range for Lumos 48-Channel SSR Controller" % self.address
예제 #7
0
    def __init__(self, id, power, network, channels=64):
        """
        Constructor for an Olsen 595/Grinch controller object:
            Olsen595ControllerUnit(power, network, [channels])

        Specify the correct PowerSource object for this unit,
        the network this board (or chained set of boards) talks
        through.  Also specify the number of channels implemented
        on this (set of) controller(s).  The default is 64.  Lumos
        will transmit that many bits on each update.
        """

        ControllerUnit.__init__(self, id, power, network)
        self.type = 'Olsen595 Controller'
        self.channels = [0] * channels
        self.needs_update = False
예제 #8
0
    def __init__(self, id, power, network, channels=64):
        """
        Constructor for an Olsen 595/Grinch controller object:
            Olsen595ControllerUnit(power, network, [channels])

        Specify the correct PowerSource object for this unit,
        the network this board (or chained set of boards) talks
        through.  Also specify the number of channels implemented
        on this (set of) controller(s).  The default is 64.  Lumos
        will transmit that many bits on each update.
        """

        ControllerUnit.__init__(self, id, power, network)
        self.type = 'Olsen595 Controller'
        self.channels = [0] * channels
        self.needs_update = False
예제 #9
0
    def add_channel(self,
                    id,
                    name=None,
                    load=None,
                    dimmer=True,
                    warm=None,
                    resolution=None,
                    power=None):
        try:
            id = int(id)
            assert 0 <= id <= 47
        except:
            raise ValueError, "Lumos 48SSR channel IDs must be integers from 0-47"

        if resolution is not None:
            resolution = int(resolution)
        else:
            resolution = self.resolution

        ControllerUnit.add_channel(self, id, name, load, dimmer, warm,
                                   resolution, power)
예제 #10
0
    def add_channel(self,
                    id,
                    name=None,
                    load=None,
                    dimmer=True,
                    warm=None,
                    resolution=None,
                    power=None):
        try:
            id = int(id)
            assert 0 <= id < len(self.channels)
        except:
            raise ValueError(
                "%d-channel Renard channel IDs must be integers from 0-%d" %
                (len(self.channels), len(self.channels) - 1))

        if resolution is not None:
            resolution = int(resolution)
        else:
            resolution = self.resolution

        ControllerUnit.add_channel(self, id, name, load, dimmer, warm,
                                   resolution, power)
예제 #11
0
    def __init__(self,
                 id,
                 power,
                 network,
                 address,
                 resolution=256,
                 channels=64):
        """
		Constructor for a Renard SSR board object:
			RenardControllerUnit(id, power, network, address, [resolution], [channels])

		Specify the correct PowerSource object for this unit and
		the unit address (0-127).  (We will call the first unit address 0,
		even though behind the scenes the address byte's MSB will be sent
		when transmitted (so unit address 0 transmits as 0x80, address 1
		transmits as 0x81, etc.)  The number of channels defaults to 64, but there
		are known Renard implementations with 8, 16, 24, 32 and 64 channels and
		probably others.  This sets the upper bound for channel IDs on this
		controller unit, and also the packet size which will always be sent
		when pending changes are flushed out to the hardware.

		The resolution probably won't ever need to be changed.  The Renards
		use 256 dimmer levels, so that's the default for that parameter.
		"""

        ControllerUnit.__init__(self, id, power, network, resolution)
        self.address = int(address)
        self.type = 'Renard SSR Controller (%d channels)' % channels
        self.channels = [None] * channels
        self.update_pending = False
        self.iter_channels = self._iter_non_null_channel_list

        if not 0 <= self.address < 127:
            raise ValueError(
                "Address %d out of range for a Renard SSR Controller" %
                self.address)
예제 #12
0
    def __init__(self, id, power, network, address, resolution=101, channels=32):
        """
        Constructor for a FireGod dimmable 128-channel SSR board object:
            FireGodControllerUnit(power, id, network, address, [resolution], [channels])

        Specify the correct PowerSource object for this unit and
        the module address (1-4).  The number of channels defaults to 32, but this
        can be changed if you have a controller which implements a different number
        of channels per module.  This will change the number of levels transmitted
        in the command packets.  

        The resolution probably won't ever need to be changed.  The FireGod units
        use 101 dimmer levels (0%-100%), so that's the default for that parameter.
        """

        ControllerUnit.__init__(self, id, power, network, resolution)
        self.address = int(address)
        self.type = 'FireGod SSR Controller (%d channels)' % channels
        self.channels = [None] * channels
        self.update_pending = False
        self.iter_channels = self._iter_non_null_channel_list

        if not 1 <= self.address <= 4:
            raise ValueError("Address %d out of range for a FireGod SSR Controller Module" % self.address)
예제 #13
0
 def __init__(self, id, power, network, resolution=16):
     ControllerUnit.__init__(self, id, power, network, resolution)
     self.type = 'X-10 Controller'