1896 if (unit->mqtt_flag) { |
1896 if (unit->mqtt_flag) { |
1897 if (unit->mqtt_flag & MQTT_FLAG_BIRTH) { |
1897 if (unit->mqtt_flag & MQTT_FLAG_BIRTH) { |
1898 publishDBirth(unit); |
1898 publishDBirth(unit); |
1899 unit->mqtt_flag &= ~MQTT_FLAG_BIRTH; |
1899 unit->mqtt_flag &= ~MQTT_FLAG_BIRTH; |
1900 } else { |
1900 } else { |
1901 publishDData(unit); |
1901 if (unit->mode != UNITMODE_OFF) { |
|
1902 publishDData(unit); |
|
1903 } |
1902 unit->mqtt_flag &= ~MQTT_FLAG_DATA; |
1904 unit->mqtt_flag &= ~MQTT_FLAG_DATA; |
1903 } |
1905 } |
1904 if (unit->mqtt_flag & MQTT_FLAG_DEATH) { |
1906 if (unit->mqtt_flag & MQTT_FLAG_DEATH) { |
1905 publishDDeath(unit); |
1907 publishDDeath(unit); |
1906 unit->mqtt_flag &= ~MQTT_FLAG_DEATH; |
1908 unit->mqtt_flag &= ~MQTT_FLAG_DEATH; |