read coils
This commit is contained in:
@@ -22,6 +22,7 @@ class MqttEventPublisher(AbstractMqttPublisher):
|
||||
continue
|
||||
|
||||
discreteInputChangeset = self.processImage.getChangedDiscreteInputs()
|
||||
coilInputChangeset = self.processImage.getChangedCoils()
|
||||
if not self.disableAnalogInputEventPublishing:
|
||||
analogInputChangeset = self.processImage.getChangedAnalogsInputs()
|
||||
|
||||
@@ -34,6 +35,15 @@ class MqttEventPublisher(AbstractMqttPublisher):
|
||||
str(discreteInputChangeItem[1][0]),
|
||||
retain=True)
|
||||
|
||||
for coilInputChangeItem in coilInputChangeset:
|
||||
logger.debug("Coil input {} changed from {} to {}"
|
||||
.format(coilInputChangeItem[0],
|
||||
coilInputChangeItem[1][1],
|
||||
coilInputChangeItem[1][0]))
|
||||
self.client.publish("{}/{}".format(self.config["coilInputTopicPrefix"], str(coilInputChangeItem[0])),
|
||||
str(coilInputChangeItem[1][0]),
|
||||
retain=True)
|
||||
|
||||
if not self.disableAnalogInputEventPublishing:
|
||||
for analogInputChangeItem in analogInputChangeset:
|
||||
logger.debug("Analog input {} changed from {} to {}"
|
||||
|
||||
Reference in New Issue
Block a user