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.

51 lines
831 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 BACKGROUNDLOOP_H
  9. #define BACKGROUNDLOOP_H
  10. #include <QThread>
  11. #include "mqttclient.h"
  12. enum power_states {
  13. OFF,
  14. ON,
  15. AUTO,
  16. MAX_POWER_STATES
  17. };
  18. class BackgroundLoop : public QThread
  19. {
  20. Q_OBJECT
  21. public:
  22. BackgroundLoop();
  23. ~BackgroundLoop();
  24. public slots:
  25. void onNewPowerState(enum power_states state);
  26. private:
  27. void run() override;
  28. void allHeatersOn(bool on);
  29. MQTTClient *m_mqtt;
  30. enum power_states m_pwr_state;
  31. signals:
  32. void new_temperature(int idx, double val);
  33. void new_hygro(int idx, double val);
  34. void new_battery(int idx, double val);
  35. void new_availability(int idx, bool ok);
  36. };
  37. #endif // BACKGROUNDLOOP_H
  38. /* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */