Added voltage field

This commit is contained in:
CommanderRedYT
2022-06-09 03:45:17 +02:00
parent 7bece3c32f
commit 91f2f621fe

View File

@ -448,9 +448,13 @@ void send_information()
if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage)
{
infoObject["percentage"] = fmt::format("{:.1f}%", getBatteryPercentage(*avgVoltage, BatteryCellType(configs.battery.cellType.value())));
infoObject["voltage"] = *avgVoltage;
}
else
{
infoObject["percentage"] = nullptr;
infoObject["voltage"] = nullptr;
}
std::string body;
serializeJson(doc, body);