Skip to content

Commit a641e4d

Browse files
committed
fixed co-pilot findings and removed outdated todo
1 parent e8d2d5b commit a641e4d

File tree

3 files changed

+3
-4
lines changed
  • include
  • src/solarcharger/smartbufferbatteries

3 files changed

+3
-4
lines changed

include/battery/zendure/Stats.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class Stats : public ::Batteries::SmartBufferStats {
170170
}
171171

172172
void setHwVersion(String&& version) {
173-
_hwversion = _device.value_or("UNKOWN");
173+
_hwversion = _device.value_or("UNKNOWN");
174174

175175
if (!version.isEmpty()) {
176176
_hwversion += " (" + std::move(version) + ")";

include/solarcharger/smartbufferbatteries/Stats.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ friend class Provider;
3333
// no need to republish values received via mqtt
3434
void mqttPublishSensors(const boolean forcePublish) const final {}
3535

36-
// ToDo @vaterlangen: rework battery interface for pushing updates
3736
std::optional<uint32_t> addDevice(std::optional<String> const& manufacture, std::optional<String> const& device, std::optional<String> const& serial, const size_t numMppts);
3837
bool hasDevice(std::optional<const uint32_t> id);
3938
void setMpptPower(std::optional<const uint32_t> id, const size_t num, const float power, const uint32_t updated);

src/solarcharger/smartbufferbatteries/Stats.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ std::optional<float> Stats::getOutputVoltage() const
3131
if (!getValueIfNotOutdated(mppt->_lastUpdate, mppt->_voltage).has_value()) {
3232
continue;
3333
}
34-
minimum = min(minimum, mppt->_voltage);
34+
minimum = std::min(minimum, mppt->_voltage);
3535
}
3636
}
3737

@@ -163,7 +163,7 @@ std::optional<uint32_t> Stats::addDevice(std::optional<String> const& manufactur
163163
return std::nullopt;
164164
}
165165

166-
// calculate CRC32 of device data to generate an (almost) unique idenitfier to be used as key in the map
166+
// calculate CRC32 of device data to generate an (almost) unique identifier to be used as key in the map
167167
const String name = *manufacture + *device + *serial + String(numMppts);
168168
CRC32 crc(CRC32_POLYNOME, CRC32_INITIAL, CRC32_XOR_OUT, false, false);
169169
crc.add(reinterpret_cast<const uint8_t*>(name.c_str()), name.length());

0 commit comments

Comments
 (0)