|
|
- // SPDX-License-Identifier: GPL-3.0-or-later
- /*
- * Qt mutizone MQTT thermostat
- *
- * Copyright (C) 2019 Richard Genoud
- *
- */
-
- #ifndef MQTTCLIENT_H
- #define MQTTCLIENT_H
-
- #include <QHostAddress>
-
- #include "qmqtt.h"
-
- class MQTTSubcriber: public QMQTT::Client
- {
- Q_OBJECT
- public:
- explicit MQTTSubcriber(const QHostAddress& host = QHostAddress::LocalHost,
- const quint16 port = 1883,
- QObject* parent = NULL);
- virtual ~MQTTSubcriber();
-
- public slots:
- void onConnected();
- void onSubscribed(const QString& topic);
- void onReceived(const QMQTT::Message& message);
-
- signals:
- void new_temperature(int idx, double val);
- void new_hygro(int idx, double val);
- void new_battery(int idx, double val);
- void new_availability(int idx, bool ok);
- };
-
- #endif
-
- /* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */
|