// SPDX-License-Identifier: GPL-3.0-or-later /* * Qt mutizone MQTT thermostat * * Copyright (C) 2019 Richard Genoud * */ #ifndef SETTINGS_H #define SETTINGS_H #include #include #include #include #define MAX_NB_ZONES 4 #define FORCE_OFF (-256) #define FORCE_ON (99) enum power_states { OFF, ON, AUTO, MAX_POWER_STATES }; struct Heater { QString ctrl_topic; }; struct Program { double temperature; uint8_t DoW; QTime start_time; QTime end_time; }; struct Room { QString name; QString sensor_topic; QString availability_topic; double default_temperature; QVector heaters; QVector progs; }; struct Brocker { QString address; int port; }; class Settings : public QSettings { Q_OBJECT public: static Settings *getInstance(void); int nbZones(void); QVector m_rooms; struct Brocker m_broker; enum power_states m_state; QDateTime m_end_holiday; private: explicit Settings(QObject *parent = Q_NULLPTR); ~Settings(void); static Settings *_singleton; void set_rooms_default_config(void); int read_config(void); }; #endif // SETTINGS_H /* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */