mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-22 15:33:45 +08:00
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:
@@ -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)
|
||||
========================
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user