Retain hotspot/tethering state across reboots (#89)

* Retain tethering state across reboots

* store state

* Update CHANGELOGS.md

* Add toggle to "SP - General"

* Network icon
This commit is contained in:
Jason Wen
2023-06-03 00:17:13 -04:00
committed by GitHub
parent c4fc609883
commit f627a34e47
4 changed files with 14 additions and 0 deletions
+1
View File
@@ -2,6 +2,7 @@ sunnypilot - 0.9.2.x (2023-02-22)
========================
* Dashcam Viewer (native & screen recordings) via Browser support thanks to actuallylemoncurd, AlexandreSato, ntegan1, and royjr!
* Honda Clarity 2018-22 support thanks to mcallbosco, vanillagorillaa and wirelessnet2!
* Retain hotspot/tethering state across reboots thanks to rogerioaguas!
sunnypilot - Version Latest (2023-02-22)
========================
+3
View File
@@ -167,6 +167,9 @@ def manager_init() -> None:
if os.path.isfile(f'{CRASHES_DIR}/error.txt'):
os.remove(f'{CRASHES_DIR}/error.txt')
if params.get_bool("HotspotOnBoot"):
os.system('nmcli con up Hotspot')
def manager_prepare() -> None:
for p in managed_processes.values():
+1
View File
@@ -204,6 +204,7 @@ void AdvancedNetworking::refresh() {
}
void AdvancedNetworking::toggleTethering(bool enabled) {
params.putBool("HotspotOnBoot", enabled);
wifi->setTetheringEnabled(enabled);
tetheringToggle->setEnabled(false);
}
@@ -52,6 +52,15 @@ SPGeneralPanel::SPGeneralPanel(QWidget *parent) : QWidget(parent) {
"../assets/offroad/icon_road.png"
));
// General: Retain hotspot/tethering state
main_layout->addWidget(horizontal_line());
main_layout->addWidget(new ParamControl(
"HotspotOnBoot",
tr("Retain hotspot/tethering state"),
tr("Enabling this toggle will retain the hotspot/tethering toggle state across reboots."),
"../assets/offroad/icon_network.png"
));
// General: Max Time Offroad (Shutdown timer)
main_layout->addWidget(horizontal_line());
main_layout->addWidget(new MaxTimeOffroad());