Skip to content

Commit 46a723d

Browse files
wip
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
1 parent 4029cc9 commit 46a723d

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

core/services/wifi/wifi_handlers/networkmanager/networkmanager.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ async def start(self) -> None:
139139

140140
logger.info(f"Using WiFi device: {self._interface_name} ({self._device_path})")
141141

142-
# Create virtual AP interface if needed
143-
await self._create_virtual_interface()
142+
# Create virtual AP interface and hotspot watchdog only for wlan0
143+
if self._interface_name == "wlan0":
144+
await self._create_virtual_interface()
145+
self._tasks.append(asyncio.get_event_loop().create_task(self.hotspot_watchdog()))
146+
144147
self._tasks.append(asyncio.get_event_loop().create_task(self._autoscan()))
145-
self._tasks.append(asyncio.get_event_loop().create_task(self.hotspot_watchdog()))
146148

147149
async def _autoscan(self) -> None:
148150

@@ -326,6 +328,11 @@ async def _find_existing_connection(self, credentials: WifiCredentials) -> Optio
326328

327329
# pylint: disable=too-many-branches
328330
async def enable_hotspot(self, save_settings: bool = True) -> bool:
331+
# Hotspot is only supported on wlan0
332+
if self._interface_name != "wlan0":
333+
logger.debug(f"Hotspot not supported on {self._interface_name}, only wlan0")
334+
return False
335+
329336
if not await self._create_virtual_interface():
330337
logger.error("Failed to create virtual interface for AP")
331338
return False
@@ -447,7 +454,8 @@ async def hotspot_is_running(self) -> bool:
447454
return self._create_ap_process is not None and self._create_ap_process.poll() is None
448455

449456
async def supports_hotspot(self) -> bool:
450-
return True
457+
# Hotspot is only supported on wlan0
458+
return self._interface_name == "wlan0"
451459

452460
async def status(self) -> WifiStatus:
453461
if not self._device_path:

0 commit comments

Comments
 (0)