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.

39 lines
850 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 MQTTCLIENT_H
  9. #define MQTTCLIENT_H
  10. #include <QHostAddress>
  11. #include "qmqtt.h"
  12. class MQTTSubcriber: public QMQTT::Client
  13. {
  14. Q_OBJECT
  15. public:
  16. explicit MQTTSubcriber(const QHostAddress& host = QHostAddress::LocalHost,
  17. const quint16 port = 1883,
  18. QObject* parent = NULL);
  19. virtual ~MQTTSubcriber();
  20. public slots:
  21. void onConnected();
  22. void onSubscribed(const QString& topic);
  23. void onReceived(const QMQTT::Message& message);
  24. signals:
  25. void new_temperature(unsigned idx, double val);
  26. void new_hygro(unsigned idx, double val);
  27. void new_battery(unsigned idx, double val);
  28. void new_availability(unsigned idx, bool ok);
  29. };
  30. #endif
  31. /* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */