diff --git a/src/main.cpp b/src/main.cpp index 79cc23d..0812bd1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,6 +34,8 @@ int main(int argc, char* argv[]) { std::string services_path_str = "/etc/thrawn"; std::string mqttServerURI = "tcp://chimaera:1883"; mqttpp::LastWill last_will {"dev/thrawn/status", "0"}; + std::string version_topic = "dev/thrawn/version"; + std::string version_topic_value = std::to_string(THRAWN_MAJOR_VERSION) + "." + std::to_string(THRAWN_MINOR_VERSION) + "." + std::to_string(THRAWN_PATCH_VERSION); std::string lastWillConnected = "1"; @@ -65,6 +67,7 @@ int main(int argc, char* argv[]) { } mqtt.publish(last_will.topic, lastWillConnected); + mqtt.publish(version_topic, version_topic_value); mqtt.subscribe("#", [&] (const char* topic, const std::string& msg) { LuaEngine::get_instance().cache.set_topic_value(topic, msg);