If you pass data ≠0 with id = 0 to set_data(), the DMX data stream will be incorrect, because the first data byte is expected as zero.
To prevent this, the user data could start at zero like this:
def set_data(self,id,data):
self.data[id+1]=data
or something like this:
def set_data(self,id,data):
if id == 0:
return
self.data[id]=data