Retain hotspot/tether: Initialize after modem is configured (#295)

This commit is contained in:
Jason Wen
2023-09-25 10:48:39 -04:00
committed by GitHub
parent 8d75ca9a7b
commit 7445c42b5d
3 changed files with 4 additions and 4 deletions
-3
View File
@@ -267,9 +267,6 @@ def main() -> None:
# SystemExit on sigterm
signal.signal(signal.SIGTERM, lambda signum, frame: sys.exit(1))
if Params().get_bool("HotspotOnBoot") and Params().get_bool("HotspotOnBootConfirmed"):
os.system('nmcli con up Hotspot')
try:
manager_thread()
except Exception:
+2
View File
@@ -156,6 +156,8 @@ def hw_state_thread(end_event, hw_queue):
cloudlog.warning("configuring modem")
HARDWARE.configure_modem()
modem_configured = True
if Params().get_bool("HotspotOnBoot") and Params().get_bool("HotspotOnBootConfirmed"):
os.system('nmcli con up Hotspot')
prev_hw_state = hw_state
except Exception:
+2 -1
View File
@@ -125,7 +125,8 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid
ListWidget *list = new ListWidget(this);
// Enable tethering layout
tetheringToggle = new ToggleControl(tr("Enable Tethering"), "", "", wifi->isTetheringEnabled());
const bool set_hotspot_on_boot = params.getBool("HotspotOnBootConfirmed");
tetheringToggle = new ToggleControl(tr("Enable Tethering"), "", "", wifi->isTetheringEnabled() || set_hotspot_on_boot);
list->addItem(tetheringToggle);
QObject::connect(tetheringToggle, &ToggleControl::toggleFlipped, this, &AdvancedNetworking::toggleTethering);