upb_lib/links.py
def update_device_levels(self, upb_cmd, level=-1, rate=-1):
        """Update the dim level on all devices in this link."""
        LOG.debug("%s %s %s", upb_cmd.name.capitalize(), self.name, self.index)
        for device_link in self.devices:
            device = self._pim.devices.elements.get(device_link.device_id)
            if not device:
                continue

            if upb_cmd in [UpbCommand.GOTO, UpbCommand.FADE_START]:
                set_level = level
            elif upb_cmd == UpbCommand.ACTIVATE:
                set_level = device_link.device_level
            else:
                set_level = 0

            device.setattr("status", set_level)
            LOG.debug("  Updating '%s' to level %d", device.name, set_level)

        changes = {"timestamp": time()}
        changes["command"] = UPB_COMMAND_TO_ACTION_MAPPING[upb_cmd.name]
        changes["level"] = level
        changes["rate"] = rate
        self.setattr("last_change", changes)
Update the dim level on all devices in this link.
Update the dim level on all devices in this link.
Update the dim level on all devices in this link .
def update_device_levels(self, upb_cmd, level=-1, rate=-1):
        LOG.debug("%s %s %s", upb_cmd.name.capitalize(), self.name, self.index)
        for device_link in self.devices:
            device = self._pim.devices.elements.get(device_link.device_id)
            if not device:
                continue
            if upb_cmd in [UpbCommand.GOTO, UpbCommand.FADE_START]:
                set_level = level
            elif upb_cmd == UpbCommand.ACTIVATE:
                set_level = device_link.device_level
            else:
                set_level = 0
            device.setattr("status", set_level)
            LOG.debug("  Updating '%s' to level %d", device.name, set_level)
        changes = {"timestamp": time()}
        changes["command"] = UPB_COMMAND_TO_ACTION_MAPPING[upb_cmd.name]
        changes["level"] = level
        changes["rate"] = rate
        self.setattr("last_change", changes)
def update_device_levels ( self , upb_cmd , level = - 1 , rate = - 1 ) : LOG . debug ( "%s %s %s" , upb_cmd . name . capitalize ( ) , self . name , self . index ) for device_link in self . devices : device = self . _pim . devices . elements . get ( device_link . device_id ) if not device : continue if upb_cmd in [ UpbCommand . GOTO , UpbCommand . FADE_START ] : set_level = level elif upb_cmd == UpbCommand . ACTIVATE : set_level = device_link . device_level else : set_level = 0 device . setattr ( "status" , set_level ) LOG . debug ( "  Updating '%s' to level %d" , device . name , set_level ) changes = { "timestamp" : time ( ) } changes [ "command" ] = UPB_COMMAND_TO_ACTION_MAPPING [ upb_cmd . name ] changes [ "level" ] = level changes [ "rate" ] = rate self . setattr ( "last_change" , changes )
Update the dim level on all devices in this link.
Update the dim level on all devices in this link .
"""Update the dim level on all devices in this link."""
self
upb_cmd
level
rate