Thermostat pour piloter jusqu'à 4 radiateurs avec fil pilote
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
809 B

  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. /*
  3. * Qt mutizone MQTT thermostat
  4. *
  5. * Copyright (C) 2019 Richard Genoud
  6. *
  7. */
  8. #ifndef SETTINGS_H
  9. #define SETTINGS_H
  10. #include <QSettings>
  11. #include <QVector>
  12. #define MAX_NB_ZONES 4
  13. struct Heater {
  14. QString ctrl_topic;
  15. };
  16. struct Room {
  17. QString name;
  18. QString sensor_topic;
  19. QString availability_topic;
  20. QVector<struct Heater> heaters;
  21. };
  22. struct Brocker {
  23. QString address;
  24. int port;
  25. };
  26. class Settings : public QSettings
  27. {
  28. Q_OBJECT
  29. public:
  30. static Settings *getInstance(void);
  31. int nbZones(void);
  32. QVector<struct Room> m_rooms;
  33. struct Brocker m_broker;
  34. private:
  35. explicit Settings(QObject *parent = Q_NULLPTR);
  36. ~Settings(void);
  37. static Settings *_singleton;
  38. };
  39. #endif // SETTINGS_H
  40. /* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */