refactor: fix typo

This commit is contained in:
Yurii
2025-12-09 21:10:23 +03:00
parent 0038a200ca
commit eafb33cb6a

View File

@@ -149,7 +149,7 @@ public:
static int16_t getIdByName(const char* name) { static int16_t getIdByName(const char* name) {
if (settings == nullptr) { if (settings == nullptr) {
return 0; return -1;
} }
for (uint8_t id = 0; id <= getMaxSensorId(); id++) { for (uint8_t id = 0; id <= getMaxSensorId(); id++) {
@@ -163,7 +163,7 @@ public:
static int16_t getIdByObjectId(const char* objectId) { static int16_t getIdByObjectId(const char* objectId) {
if (settings == nullptr) { if (settings == nullptr) {
return 0; return -1;
} }
String refObjectId; String refObjectId;
@@ -329,12 +329,12 @@ public:
static float getMeanValueByPurpose(Purpose purpose, const ValueType valueType, bool onlyConnected = true) { static float getMeanValueByPurpose(Purpose purpose, const ValueType valueType, bool onlyConnected = true) {
if (settings == nullptr || results == nullptr) { if (settings == nullptr || results == nullptr) {
return 0; return 0.0f;
} }
uint8_t valueId = (uint8_t) valueType; uint8_t valueId = (uint8_t) valueType;
if (!isValidValueId(valueId)) { if (!isValidValueId(valueId)) {
return 0; return 0.0f;
} }
float value = 0.0f; float value = 0.0f;
@@ -363,7 +363,7 @@ public:
static bool existsConnectedSensorsByPurpose(Purpose purpose) { static bool existsConnectedSensorsByPurpose(Purpose purpose) {
if (settings == nullptr || results == nullptr) { if (settings == nullptr || results == nullptr) {
return 0; return false;
} }
for (uint8_t id = 0; id <= getMaxSensorId(); id++) { for (uint8_t id = 0; id <= getMaxSensorId(); id++) {