// SPDX-License-Identifier: GPL-3.0-or-later /* * Qt mutizone MQTT thermostat * * Copyright (C) 2019 Richard Genoud * */ #ifndef MQTTCLIENT_H #define MQTTCLIENT_H #include #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(unsigned idx, double val); void new_hygro(unsigned idx, double val); void new_battery(unsigned idx, double val); void new_availability(unsigned idx, bool ok); }; #endif /* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */