def set_device_id(self, dev, id):
if id < <NUM_LIT:0> or id > <NUM_LIT:255>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>com, code, ok = io.send_packet(<EOL>CMDTYPE.SETID, <NUM_LIT:1>, dev, self.baudrate, <NUM_LIT:5>, id)<EOL>if not ok:<EOL><INDENT>raise_error(code)<EOL><DEDENT>
Set device ID to new value.

        :param str dev: Serial device address/path
        :param id: Device ID to set