예제 #1
0
	def lighting_group_ramp(self, source_addr, group_addr, duration, level=1.0):
		"""
		Ramps (fades) a group address to a specified lighting level.

		Note: CBus only supports a limited number of fade durations, in decreasing
		accuracy up to 17 minutes (1020 seconds).  Durations longer than this will
		throw an error.
		
		A duration of 0 will ramp "instantly" to the given level.

		:param source_addr: Source address of the event.
		:type source_addr: int

		:param group_id: The group address to ramp.
		:type group_id: int
		
		:param duration: Duration, in seconds, that the ramp should occur over.
		:type duration: int
		
		:param level: An amount between 0.0 and 1.0 indicating the brightness to set.
		:type level: float
		
		:returns: Single-byte string with code for the confirmation event.
		:rtype: string
		
		"""
		p = PointToMultipointPacket(application=APP_LIGHTING)
		p.source_address = source_addr
		p.sal.append(LightingRampSAL(p, group_addr, duration, level))
		p.checksum = self.checksum
		return self._send(p)
예제 #2
0
	def lighting_group_terminate_ramp(self, source_addr, group_addr):
		"""
		Stops ramping a group address at the current point.
		
		:param source_addr: Source address of the event.
		:type source_addr: int
		
		:param group_addr: Group address to stop ramping of.
		:type group_addr: int
		
		:returns: Single-byte string with code for the confirmation event.
		:rtype: string
		"""
		p = PointToMultipointPacket(application=APP_LIGHTING)
		p.source_address = source_addr
		p.sal.append(LightingTerminateRampSAL(p, group_addr))
		p.checksum = self.checksum
		return self._send(p)
예제 #3
0
	def lighting_group_off(self, source_addr, group_addr):
		"""
		Turns off the lights for the given group_id.
		
		:param source_addr: Source address of the event.
		:type source_addr: int	
		
		:param group_id: Group address to turn the lights on for.
		:type group_id: int
		
		:returns: Single-byte string with code for the confirmation event.
		:rtype: string
				
		"""
		p = PointToMultipointPacket(application=APP_LIGHTING)
		p.source_address = source_addr
		p.sal.append(LightingOffSAL(p, group_addr))
		p.checksum = self.checksum
		return self._send(p)