def set_value(self, value):
        if self.__is_value_array:
            if len(value) == self.__report_count:
                for index, item in enumerate(value):
                    self.__setitem__(index, item)
            else:
                raise ValueError("Value size should match report item size "\
                    "length" )
        else:
            self.__value = value & ((1 << self.__bit_size) - 1) #valid bits only
Set usage value within report
dataset/ETHPy150Open rene-aguirre/pywinusb/pywinusb/hid/core.py/ReportItem.set_value