Fix ICTA controller bugs

This commit is contained in:
Joachim Stolberg 2022-08-09 20:27:33 +02:00
parent c0a11e2477
commit c78ea7eb66
3 changed files with 9 additions and 5 deletions

View File

@ -282,6 +282,9 @@ local tubing = {
return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload)
end end
end, end,
on_beduino_request_data = function(pos, src, topic, payload)
return CRD(pos).State:on_beduino_request_data(pos, topic, payload)
end,
} }
local node_name_ta2, node_name_ta3, node_name_ta4 = local node_name_ta2, node_name_ta3, node_name_ta4 =

View File

@ -230,6 +230,7 @@ function techage.add_node(pos, name, is_ta2)
local key = minetest.hash_node_position(pos) local key = minetest.hash_node_position(pos)
local num = NumbersToBeRecycled[key] local num = NumbersToBeRecycled[key]
if num then if num then
NodeInfoCache[num] = nil
backend.set_nodepos(num, pos) backend.set_nodepos(num, pos)
NumbersToBeRecycled[key] = nil NumbersToBeRecycled[key] = nil
return num return num

View File

@ -153,7 +153,7 @@ techage.icta_register_condition("input", {
return env.input[data.number] return env.input[data.number]
end end
local result = function(val) local result = function(val)
return techage.compare(val, tonumber(data.value) or 0, data.operand) return techage.compare(val, data.value or "invalid", data.operand)
end end
return condition, result return condition, result
end, end,
@ -196,7 +196,7 @@ techage.icta_register_condition("state", {
return techage.send_single(environ.number, data.number, "state") return techage.send_single(environ.number, data.number, "state")
end end
local result = function(val) local result = function(val)
return techage.compare(val, tonumber(data.value) or 0, data.operand) return techage.compare(val, data.value or "invalid", data.operand)
end end
return condition, result return condition, result
end, end,
@ -408,7 +408,7 @@ techage.icta_register_condition("chest", {
return techage.send_single(environ.number, data.number, "state") return techage.send_single(environ.number, data.number, "state")
end end
local result = function(val) local result = function(val)
return techage.compare(val, tonumber(data.value) or 0, data.operand) return techage.compare(val, data.value or "invalid", data.operand)
end end
return condition, result return condition, result
end, end,
@ -449,7 +449,7 @@ techage.icta_register_condition("signaltower", {
return techage.send_single(environ.number, data.number, "state") return techage.send_single(environ.number, data.number, "state")
end end
local result = function(val) local result = function(val)
return techage.compare(val, tonumber(data.value) or 0, data.operand) return techage.compare(val, data.value or "invalid", data.operand)
end end
return condition, result return condition, result
end, end,
@ -919,7 +919,7 @@ techage.icta_register_condition("get_filter", {
return techage.send_single(environ.number, data.number, "port", data.color) return techage.send_single(environ.number, data.number, "port", data.color)
end end
local result = function(val) local result = function(val)
return techage.compare(val, tonumber(data.value) or 0, data.operand) return techage.compare(val, data.value or "invalid", data.operand)
end end
return condition, result return condition, result
end, end,