move hass config to main

This commit is contained in:
2026-01-03 17:37:08 +01:00
parent b8589181a7
commit 42d3d4359b
5 changed files with 47 additions and 36 deletions

View File

@@ -21,6 +21,9 @@ class Application {
std::string sys_sensor;
std::string sys_ifname;
std::string home_dir;
std::string hass_url;
std::string hass_entity;
std::string hass_token;
};
explicit Application(Config config);
@@ -30,7 +33,7 @@ class Application {
private:
struct Sensors {
sys::TimeDate td;
double avg[3] = {0.0f};
double loadavg[3] = {0.0f};
sys::Memory ram;
sys::Disk home;
sys::Network net;
@@ -38,11 +41,11 @@ class Application {
cpu::cpuSensors cpu;
gpu::gpuSensors gpu;
double hass_state = 0.0f;
std::mutex mtx; // making sure the struct isnt accessed by multiple threads at once
};
struct Control {
std::binary_semaphore display{0};
std::mutex sensors; // making sure the sensors struct isnt accessed by multiple threads at once
sigset_t sigset;
};