Credo: IO.inspect leftovers out, dropped Enum.maps become Enum.each

f16dbff · Gabe Morell · 2026-11-04 20:45

17 files +25 -22

Files changed

modified lib/lambent_ex/schema/links.ex
+0 −1
@@ -144,7 +144,6 @@ defmodule LambentEx.Schema.LinksB do
144 144 {:ok, :ok}
145 145
146 146 false ->
147 − IO.inspect(res)
148 147 {:error, res}
149 148 end
150 149 end
modified lib/lambent_ex/supervision/link.ex
+5 −2
@@ -1,6 +1,8 @@
1 1 defmodule LambentEx.LinkSupervisor do
2 2 use DynamicSupervisor
3 3
4 + require Logger
5 +
4 6 def start_link(init_arg) do
5 7 DynamicSupervisor.start_link(__MODULE__, init_arg, name: __MODULE__)
6 8 end
@@ -25,10 +27,11 @@ defmodule LambentEx.LinkSupervisor do
25 27 Task.start(fn ->
26 28 LambentEx.Meta.get_saved_links()
27 29 |> Enum.map(fn l ->
28 − IO.inspect(l[:opts])
30 + Logger.info("Restoring link #{inspect(l[:opts])}")
29 31 spec = {LambentEx.Link, l[:opts]}
30 32 #
31 − DynamicSupervisor.start_child(__MODULE__, spec) |> IO.inspect()
33 + DynamicSupervisor.start_child(__MODULE__, spec)
34 + |> tap(&Logger.debug("Restored link: #{inspect(&1)}"))
32 35 end)
33 36 end)
34 37
modified lib/lambent_ex/supervision/machine.ex
+3 −1
@@ -1,6 +1,8 @@
1 1 defmodule LambentEx.MachineSupervisor do
2 2 use DynamicSupervisor
3 3
4 + require Logger
5 +
4 6 def start_link(init_arg) do
5 7 DynamicSupervisor.start_link(__MODULE__, init_arg, name: __MODULE__)
6 8 end
@@ -30,7 +32,7 @@ defmodule LambentEx.MachineSupervisor do
30 32 Task.start(fn ->
31 33 LambentEx.Meta.get_saved_machines()
32 34 |> Enum.map(fn m ->
33 − IO.inspect(m[:opts])
35 + Logger.info("Restoring machine #{inspect(m[:opts])}")
34 36 spec = {LambentEx.Machine, m[:opts]}
35 37 #
36 38 DynamicSupervisor.start_child(__MODULE__, spec)
modified lib/lambent_ex/supervision/mqtt.ex
+3 −1
@@ -1,6 +1,8 @@
1 1 defmodule LambentEx.MQTTSupervisor do
2 2 use DynamicSupervisor
3 3
4 + require Logger
5 +
4 6 def start_link(init_arg) do
5 7 DynamicSupervisor.start_link(__MODULE__, init_arg, name: __MODULE__)
6 8 end
@@ -88,7 +90,7 @@ defmodule LambentEx.MQTTSupervisor do
88 90 Task.start(fn ->
89 91 LambentEx.Meta.get_saved_cfg_mqtt()
90 92 |> Enum.map(fn m ->
91 − IO.inspect(m[:opts])
93 + Logger.info("Restoring MQTT client #{inspect(m[:opts])}")
92 94 spec = {LambentEx.MQTT, m[:opts]}
93 95 #
94 96 DynamicSupervisor.start_child(__MODULE__, spec)
modified lib/lambent_ex_web/components/ple_components.ex
+7 −9
@@ -26,7 +26,7 @@ defmodule LambentEx.Phoenix.LiveEditable.Interface.Tailwind3 do
26 26 phx-click="ple-focus"
27 27 phx-target={@myself}
28 28 >
29 − <%= @ple_data %>
29 + {@ple_data}
30 30 </span>
31 31 """
32 32 end
@@ -42,11 +42,11 @@ defmodule LambentEx.Phoenix.LiveEditable.Interface.Tailwind3 do
42 42 >
43 43 <input style="width: 100px;" type="text" name="data" target={@myself} value={@ple_data} />
44 44 <button class="button" style="margin-left: 5px" type="submit">
45 − <%= raw(Svg.inline("CircleOk")) %>
45 + {raw(Svg.inline("CircleOk"))}
46 46 </button>
47 47 </form>
48 48 <button class="button" style="margin-left: 5px">
49 − <%= raw(Svg.inline("CircleCancel")) %>
49 + {raw(Svg.inline("CircleCancel"))}
50 50 </button>
51 51 </div>
52 52 """
@@ -71,7 +71,7 @@ defmodule LambentEx.Phoenix.LiveEditable.Interface.Tailwind3 do
71 71 phx-click="ple-focus"
72 72 phx-target={@myself}
73 73 >
74 − <%= @ple_data %>
74 + {@ple_data}
75 75 </span>
76 76 """
77 77 end
@@ -87,7 +87,7 @@ defmodule LambentEx.Phoenix.LiveEditable.Interface.Tailwind3 do
87 87 phx-click-away={@ple_action}
88 88 phx-value-target="myfield"
89 89 >
90 − <%= select(:ok, :ord, @ple_options, phx_change: "reorder", phx_target: @myself) %>
90 + {select(:ok, :ord, @ple_options, phx_change: "reorder", phx_target: @myself)}
91 91 </form>
92 92 </div>
93 93 """
@@ -103,19 +103,17 @@ defmodule LambentEx.Phoenix.LiveEditable.Interface.Tailwind3 do
103 103 phx-target={@myself}
104 104 phx-click-away={@ple_action}
105 105 >
106 − <%= select(:ok, :ord, @ple_options,
106 + {select(:ok, :ord, @ple_options,
107 107 phx_change: "reorder",
108 108 phx_target: @myself,
109 109 selected: @ple_data
110 − ) %>
110 + )}
111 111 </form>
112 112 </div>
113 113 """
114 114 end
115 115
116 116 def render(assigns) do
117 − IO.inspect(assigns)
118 −
119 117 ~H"""
120 118 <div></div>
121 119 """
modified lib/lambent_ex_web/controllers/data_controller.ex
+2 −2
@@ -13,7 +13,7 @@ defmodule LambentExWeb.DataController do
13 13 {path, data} = data |> Map.pop("path")
14 14
15 15 LambentEx.Meta.get_http()
16 − |> Enum.map(fn {name, hpath} ->
16 + |> Enum.each(fn {name, hpath} ->
17 17 case {name, hpath} do
18 18 {name, ^path} -> Phoenix.PubSub.broadcast(@pubsub_name, @pubsub_topic, {name, path, data})
19 19 {name, _path} -> :ok
@@ -27,7 +27,7 @@ defmodule LambentExWeb.DataController do
27 27 {path, data} = data |> Map.pop("path")
28 28
29 29 LambentEx.Meta.get_http()
30 − |> Enum.map(fn {name, hpath} ->
30 + |> Enum.each(fn {name, hpath} ->
31 31 case {name, hpath} do
32 32 {name, ^path} -> Phoenix.PubSub.broadcast(@pubsub_name, @pubsub_topic, {name, path, data})
33 33 {name, _path} -> :ok
modified lib/lambent_ex_web/controllers/device_controller.ex
+2 −2
@@ -13,7 +13,7 @@ defmodule LambentExWeb.DeviceController do
13 13 {path, data} = data |> Map.pop("path")
14 14
15 15 LambentEx.Meta.get_http()
16 − |> Enum.map(fn {name, hpath} ->
16 + |> Enum.each(fn {name, hpath} ->
17 17 case {name, hpath} do
18 18 {name, ^path} -> Phoenix.PubSub.broadcast(@pubsub_name, @pubsub_topic, {name, path, data})
19 19 {name, _path} -> :ok
@@ -24,4 +24,4 @@ defmodule LambentExWeb.DeviceController do
24 24
25 25 text(conn, %{esp82667777: d})
26 26 end
27 −end
27 +end
modified lib/lambent_ex_web/live/machines/index.ex
+4 −5
@@ -21,10 +21,10 @@ defmodule LambentExWeb.MachinesLive.Index do
21 21 1000 => :ONES,
22 22 2000 => :TWOS,
23 23 5000 => :FIVES,
24 − 10000 => :TENS,
25 − 20000 => :TWENTYS,
26 − 30000 => :THIRTYS,
27 − 60000 => :MINS
24 + 10_000 => :TENS,
25 + 20_000 => :TWENTYS,
26 + 30_000 => :THIRTYS,
27 + 60_000 => :MINS
28 28 }
29 29
30 30 @impl true
@@ -139,7 +139,6 @@ defmodule LambentExWeb.MachinesLive.Index do
139 139 opts = spec[:mach_opts] || []
140 140
141 141 LambentEx.MachineSupervisor.start_child(spec[:machine], spec[:args], entry, opts)
142 − |> IO.inspect()
143 142
144 143 {:noreply, socket}
145 144 end

Parents: 6c7da73