feat: Add functions to create MilquetoastClient and MilquetoastJsonClient instances

This commit is contained in:
2025-06-08 09:01:12 -07:00
parent e8b4d67f34
commit 16f23cb6da

View File

@@ -137,3 +137,14 @@
(if-let [msg (get-topic! client topic opts)]
msg
nil)))
(defn create-client
"Creates a new MilquetoastClient instance with the provided MQTT client and options."
[mqtt-client & {:keys [verbose]
:or {verbose false}}]
(MilquetoastClient. mqtt-client (atom []) verbose))
(defn create-json-client
"Creates a new MilquetoastJsonClient instance with the provided MQTT client."
[mqtt-client]
(MilquetoastJsonClient. mqtt-client))