Review components files

This commit is contained in:
Edward Firmo
2024-04-08 23:47:16 +02:00
parent 88cca0d1bf
commit 10e0a47b6f
18 changed files with 385 additions and 369 deletions

View File

@@ -0,0 +1,26 @@
// pages.cpp
#include "pages.h"
#include <cstring>
namespace nspanel_ha_blueprint {
uint8_t get_page_id(const std::string& page_name) {
for (uint8_t i = 0; i < page_names.size(); ++i) {
if (strcmp(page_names[i], page_name.c_str()) == 0) {
return i;
}
}
return UINT8_MAX;
}
bool isStringInList(const std::string& strToSearch, std::initializer_list<std::string> list) {
for (const auto& str : list) {
if (strToSearch == str) {
return true;
}
}
return false;
}
} // namespace nspanel_ha_blueprint