lightwave/lightwave.py
def turn_on_with_brightness(self, device_id, name, brightness):
        """Scale brightness from 0..255 to 1..32."""
        brightness_value = round((brightness * 31) / 255) + 1
        # F1 = Light on and F0 = light off. FdP[0..32] is brightness. 32 is
        # full. We want that when turning the light on.
        msg = "!%sFdP%d|Lights %d|%s" % (
            device_id, brightness_value, brightness_value, name)
        self._send_message(msg)
def turn_on_with_brightness(self, device_id, name, brightness):
        brightness_value = round((brightness * 31) / 255) + 1
        # F1 = Light on and F0 = light off. FdP[0..32] is brightness. 32 is
        # full. We want that when turning the light on.
        msg = "!%sFdP%d|Lights %d|%s" % (
            device_id, brightness_value, brightness_value, name)
        self._send_message(msg)
def turn_on_with_brightness ( self , device_id , name , brightness ) : brightness_value = round ( ( brightness * 31 ) / 255 ) + 1 # F1 = Light on and F0 = light off. FdP[0..32] is brightness. 32 is # full. We want that when turning the light on. msg = "!%sFdP%d|Lights %d|%s" % ( device_id , brightness_value , brightness_value , name ) self . _send_message ( msg )
Scale brightness from 0..255 to 1..32.
Scale brightness from 0 .. 255 to 1 .. 32 .