local relay_box = {fixed = {{(-1 / 2), (-1 / 2), (-1 / 2), (1 / 2), ((-1 / 2) + (2 / 16)), (1 / 2)}, {(-5 / 16), ((-1 / 2) + (2 / 16)), (-6 / 16), (5 / 16), (1 / 2), (6 / 16)}}, type = "fixed"}
minetest.register_node("electricity:relay", {description = "Relay", drawtype = "nodebox", groups = {conductor = 1, crumbly = 3}, node_box = relay_box, paramtype = "light", paramtype2 = "facedir", selection_box = relay_box, tiles = {"electricity_relay.png", "electricity_relay_bottom.png", "electricity_relay_back_side.png", "electricity_relay_control_side.png", "electricity_relay_connect_side.png", "electricity_relay_connect_side.png"}})
local relay_resistance = 0.01
local U_e2_82_98_e1_b5_a2_e2_82_99 = 1
local function get_sec_resis(U)
  local function _0_()
    if (math.abs(U) >= U_e2_82_98_e1_b5_a2_e2_82_99) then
      return relay_resistance
    else
      return math.pow(10, 50)
    end
  end
  return real(_0_())
end
local function _0_(pos, id)
  local meta = minetest.get_meta(pos)
  local U = meta:get_float("U")
  local input, output, control = dirtwopole(pos)
  return {neg = ground, pos = control}, {{["neg-node"] = output, ["pos-node"] = input, name = id, type = "consumer", value = get_sec_resis(U)}}
end
model["electricity:relay"] = _0_
return nil
