I want to ask how you can read the current status of the PWM outputs of the LW-12 through the i2c interface?
To find out the status of a DALI device on the network, I have to submit an address request to each device. This takes a lot of time and loads the network. Is there another way to monitor the status of devices on the network through LW-14, for example, by reading through the i2c interface? Or perhaps there is a command for LW-14 to poll the status of all devices on the network?
And I think there is a bug in the function ReadQuery(), in the program lw14_class.py.
The command i2c.write_byte(self.i2c_bus, defs.LW14_REG_COMMAND) is missing here.
I think the function ReadQuery() should look like this
Code: Select all
#Read data from DALI device
def ReadQuery(self, value):
data = [self.dali_adr, value]
self._i2c_write(data)
res = self.WaitForValidReply()
if res == defs.RET_SUCCESS:
i2c.write_byte(self.i2c_bus, defs.LW14_REG_COMMAND)
sleep(0.001)
read = self._i2c_read(defs.LW14_REG_COMMAND)
#Clear command register
self._i2c_read(defs.LW14_REG_COMMAND)
return read
else:
#print ("WaitForValidReply: %d" % res)
return res #errorcode < 0