mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-27 07:22:05 +08:00
Retain hotspot/tether: Initialize after modem is configured (#295)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user