From 2fbe490ea2fc691b8f65f223b9816e8487039582 Mon Sep 17 00:00:00 2001 From: Frank Hunleth Date: Mon, 8 Apr 2024 07:43:46 -0400 Subject: [PATCH] Fix logic for detecting wlan0 unconfigured --- lib/circuits_quickstart/application.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/circuits_quickstart/application.ex b/lib/circuits_quickstart/application.ex index 04b7c58..a462129 100644 --- a/lib/circuits_quickstart/application.ex +++ b/lib/circuits_quickstart/application.ex @@ -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"] @@ -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