diff --git a/src/HAMqtt.cpp b/src/HAMqtt.cpp index 5ad3cbb..976d390 100644 --- a/src/HAMqtt.cpp +++ b/src/HAMqtt.cpp @@ -183,6 +183,11 @@ bool HAMqtt::isConnected() const return _mqtt->connected(); } +void HAMqtt::setKeepAlive(uint16_t keepAlive) +{ + _mqtt->setKeepAlive(keepAlive); +} + void HAMqtt::addDeviceType(HABaseDeviceType* deviceType) { if (_devicesTypesNb + 1 > _maxDevicesTypesNb) { diff --git a/src/HAMqtt.h b/src/HAMqtt.h index 250bd74..7819ff6 100644 --- a/src/HAMqtt.h +++ b/src/HAMqtt.h @@ -202,6 +202,11 @@ public: * Returns true if connection to the MQTT broker is established. */ bool isConnected() const; + + /** + * sets keepAlive value. + */ + void setKeepAlive(uint16_t keepAlive); /** * Adds a new device's type to the MQTT. @@ -389,4 +394,4 @@ private: bool _lastWillRetain; }; -#endif \ No newline at end of file +#endif