mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-15 09:56:38 +02:00
isProducing readable with todo
This commit is contained in:
parent
661b559768
commit
d6dfe6dc1a
1 changed files with 11 additions and 6 deletions
|
@ -412,22 +412,27 @@ void app::processPayload(bool retransmit) {
|
|||
}
|
||||
}
|
||||
|
||||
if(iv->isProducing(mTimestamp, rec)){
|
||||
// Todo: make this section nice to read.
|
||||
snprintf(topic, 32 + MAX_NAME_LENGTH, "%s/available_text", iv->name);
|
||||
|
||||
if(iv->isProducing(mTimestamp, rec))
|
||||
{
|
||||
snprintf(val, 32, DEF_MQTT_IV_MESSAGE_INVERTER_AVAIL_AND_PRODUCED);
|
||||
mMqtt.sendMsg(topic, val);
|
||||
|
||||
snprintf(topic, 32 + MAX_NAME_LENGTH, "%s/available", iv->name);
|
||||
snprintf(val, 32, "2");
|
||||
mMqtt.sendMsg(topic, val);
|
||||
} else {
|
||||
snprintf(topic, 32 + MAX_NAME_LENGTH, "%s/available_text", iv->name);
|
||||
snprintf(val, 32, DEF_MQTT_IV_MESSAGE_INVERTER_AVAIL_AND_NOT_PRODUCED);
|
||||
mMqtt.sendMsg(topic, val);
|
||||
|
||||
snprintf(topic, 32 + MAX_NAME_LENGTH, "%s/available", iv->name);
|
||||
snprintf(val, 32, "1");
|
||||
mMqtt.sendMsg(topic, val);
|
||||
}
|
||||
|
||||
mMqtt.sendMsg(topic, val);
|
||||
|
||||
|
||||
snprintf(topic, 32 + MAX_NAME_LENGTH, "%s/last_success", iv->name);
|
||||
snprintf(val, 48, "%i", iv->getLastTs(rec) * 1000);
|
||||
mMqtt.sendMsg(topic, val);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue