diff --git a/init.lua b/init.lua index 76159357994c3222666817204dcc00dd62b735ef..08c06b1bbf559a86c3a29a81a17ac8f36c708949 100644 --- a/init.lua +++ b/init.lua @@ -16,10 +16,15 @@ local mqttBaseTopic = core.settings:get("ledtree_base_topic") or "ledtree" local client = mqtt.connect(data.url, data.clientId, data.username, data.password) +mqtt.subscribe(client, "ledtree/led/1", function(topic, payload) + core.chat_send_all("Received message from topic "..topic..": "..payload) + end +) + local change_color = function(player, led_id) local formspec = "size[3,3]" .. "image_button[0,0;1,1;red.png;red;red;false;false;]" .. - "image_button[1,0;1,1;green.png;gren;green;false;false;]" .. + "image_button[1,0;1,1;green.png;green;green;false;false;]" .. "image_button[2,0;1,1;blue.png;blue;blue;false;false;]" .. "image_button[0,1;1,1;yellow.png;yellow;yellow;false;false;]" .. "image_button[1,1;1,1;cyan.png;cyan;cyan;false;false;]" .. diff --git a/settingtypes.txt b/settingtypes.txt index 6c24e52100471203c34a69aca349932a000624f2..1936607847358ffef477b8d1a2e1aaa45403480c 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -1 +1 @@ -ledtree_base_topic (Base topic (e.g. /[base_topic]/led/1)) string ledtree +ledtree_base_topic "Base topic (e.g. [base_topic]/led/1)" string "ledtree"