mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-02-07 00:48:12 +00:00
Fixed buffer issues and ESP8266 HA reboot issue"
This commit is contained in:
@@ -23,24 +23,24 @@ bool HomeAssistantMqttHandler::publish(AmsData* data, AmsData* previousState, En
|
||||
if(time(nullptr) < FirmwareVersion::BuildEpoch)
|
||||
return false;
|
||||
|
||||
if(data->getListType() >= 3) { // publish energy counts
|
||||
publishList3(data, ea);
|
||||
loop();
|
||||
}
|
||||
// if(data->getListType() >= 3) { // publish energy counts
|
||||
// publishList3(data, ea);
|
||||
// loop();
|
||||
// }
|
||||
|
||||
if(data->getListType() == 1) { // publish power counts
|
||||
publishList1(data, ea);
|
||||
} else if(data->getListType() <= 3) { // publish power counts and volts/amps
|
||||
publishList2(data, ea);
|
||||
} else if(data->getListType() == 4) { // publish power counts and volts/amps/phase power and PF
|
||||
publishList4(data, ea);
|
||||
}
|
||||
// if(data->getListType() == 1) { // publish power counts
|
||||
// publishList1(data, ea);
|
||||
// } else if(data->getListType() <= 3) { // publish power counts and volts/amps
|
||||
// publishList2(data, ea);
|
||||
// } else if(data->getListType() == 4) { // publish power counts and volts/amps/phase power and PF
|
||||
// publishList4(data, ea);
|
||||
// }
|
||||
loop();
|
||||
|
||||
if(ea->isInitialized()) {
|
||||
publishRealtime(data, ea, eapi);
|
||||
loop();
|
||||
}
|
||||
// if(ea->isInitialized()) {
|
||||
// publishRealtime(data, ea, eapi);
|
||||
// loop();
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ bool HomeAssistantMqttHandler::publishPrices(EntsoeApi* eapi) {
|
||||
bool HomeAssistantMqttHandler::publishSystem(HwTools* hw, EntsoeApi* eapi, EnergyAccounting* ea) {
|
||||
if(topic.isEmpty() || !mqtt.connected())
|
||||
return false;
|
||||
|
||||
|
||||
publishSystemSensors();
|
||||
if(hw->getTemperature() > -50) publishTemperatureSensor(0, "");
|
||||
|
||||
@@ -337,7 +337,7 @@ bool HomeAssistantMqttHandler::publishSystem(HwTools* hw, EntsoeApi* eapi, Energ
|
||||
return ret;
|
||||
}
|
||||
|
||||
void HomeAssistantMqttHandler::publishSensor(const HomeAssistantSensor& sensor) {
|
||||
void HomeAssistantMqttHandler::publishSensor(const HomeAssistantSensor sensor) {
|
||||
String uid = String(sensor.path);
|
||||
uid.replace(".", "");
|
||||
uid.replace("[", "");
|
||||
|
||||
Reference in New Issue
Block a user