Skip to content

Commit

Permalink
network: bugfix: change AllowEnable on power state setting
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Feb 22, 2022
1 parent cb2c50a commit 756eda0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rpcclient/rpcclient/darwin/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ def disconnect(self):
self._client.symbols.Apple80211Disassociate(self._interface)

def _set(self, is_on: bool):
with self._client.preferences.sc.get_preferences_object('com.apple.wifi.plist') as pref:
pref.set('AllowEnable', int(is_on))

if not is_on:
if self._client.symbols.WiFiManagerClientDisable(self._wifi_manager_client):
raise BadReturnValueError(f'WiFiManagerClientDisable failed ({self._client.last_error})')
Expand Down

0 comments on commit 756eda0

Please sign in to comment.