Skip to content

Commit

Permalink
Fix logic for detecting wlan0 unconfigured
Browse files Browse the repository at this point in the history
  • Loading branch information
fhunleth committed Apr 8, 2024
1 parent 30f8d29 commit 2fbe490
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/circuits_quickstart/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule CircuitsQuickstart.Application do
defp setup_wifi() do
kv = Nerves.Runtime.KV.get_all()

if true?(kv["wifi_force"]) or wlan0_unconfigured?() do
if true?(kv["wifi_force"]) or not wlan0_configured?() do
ssid = kv["wifi_ssid"]
passphrase = kv["wifi_passphrase"]

Expand All @@ -33,7 +33,7 @@ defmodule CircuitsQuickstart.Application do
end
end

defp wlan0_unconfigured?() do
defp wlan0_configured?() do
VintageNet.get_configuration("wlan0") |> VintageNetWiFi.network_configured?()
catch
_, _ -> false
Expand Down

0 comments on commit 2fbe490

Please sign in to comment.