Merge branch 'main' of github.com:elektroencefalografista/linuxSmartie
This commit is contained in:
@@ -102,11 +102,8 @@ void Application::sensorsThread(const std::stop_token& st) {
|
||||
ret += gpu::detect(&m_sensors.gpu, m_config.gpu_pciaddr);
|
||||
ret += sys::detect(&m_sensors.sys, m_config.sys_sensor);
|
||||
m_sensors.home.mountpoint = m_config.home_dir;
|
||||
if (ret < 0) {
|
||||
if (ret < 0)
|
||||
applog(LOG::ERR, "Failed to detect some sensors");
|
||||
this->Crash(ret);
|
||||
return;
|
||||
}
|
||||
|
||||
while (!st.stop_requested()) {
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
@@ -209,4 +206,4 @@ void Application::displayThread(const std::stop_token& st) {
|
||||
// goodbye msg
|
||||
lcd.writeBuf(2, 0, utils::center("Goodbye", 40));
|
||||
lcd.flushBuf();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ int detect(gpuSensors* target, const std::string& pci) {
|
||||
applog(LOG::INF, "Detected path \"{}\"", target->hwmon);
|
||||
|
||||
if (utils::fileExists(target->hwmon + rel_metrics_path)) {
|
||||
applog(LOG::INF, "found gpu_metrics");
|
||||
applog(LOG::INF, "Found gpu_metrics");
|
||||
target->hasGpuMetrics = true;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#ifdef ENABLE_HOME_ASSISTANT
|
||||
#include <libwebsockets.h>
|
||||
|
||||
#include <cstring>
|
||||
@@ -6,8 +7,6 @@
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <string>
|
||||
|
||||
#ifdef ENABLE_HOME_ASSISTANT
|
||||
|
||||
HomeAssistant::HomeAssistant(const Config& config) {
|
||||
m_config = config;
|
||||
}
|
||||
@@ -161,4 +160,4 @@ void HomeAssistant::disconnect() const {
|
||||
lws_context_destroy(context);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -70,9 +70,10 @@ int sys::detect(sysSensors* s, const std::string& platform) {
|
||||
try {
|
||||
s->hwmon = utils::getFirstDir("/sys/devices/platform/" + platform + "/hwmon");
|
||||
} catch (...) {
|
||||
applog(LOG::ERR, "Can't open sys hwmon. Module loaded? Kernel params added?");
|
||||
applog(LOG::ERR, "Can't open \"/sys/devices/platform/{}/hwmon\". Kernel params added? Module loaded?", platform);
|
||||
return -1;
|
||||
}
|
||||
applog(LOG::INF, "Found system sensors");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user