Skip to content

Commit

Permalink
Merge pull request #130 from joshschmelzle/main
Browse files Browse the repository at this point in the history
Add NO to regdom choices
  • Loading branch information
joshschmelzle authored Dec 16, 2024
2 parents 7b567e9 + 33e76dc commit 1fa36ef
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
wlanpi-fpms (1.4.7) unstable; urgency=medium

* Add NO as regdom choice

-- Josh Schmelzle <[email protected]> Mon, 16 Dec 2024 11:32:51 -0500

wlanpi-fpms (1.4.6) unstable; urgency=medium

* Fix crash when running on WLAN Pi Pro
Expand Down
2 changes: 1 addition & 1 deletion fpms/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
__url__ = "https://github.com/wlan-pi/wlanpi-fpms"
__author__ = "Jiri Brejcha"
__author_email__ = "[email protected]"
__version__ = "1.4.6"
__version__ = "1.4.7"
__license__ = "BSD-3-Clause"
6 changes: 6 additions & 0 deletions fpms/fpms.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,10 @@ def set_reg_domain_de():
system_obj = RegDomain(g_vars)
system_obj.set_reg_domain_de(g_vars)

def set_reg_domain_no():
system_obj = RegDomain(g_vars)
system_obj.set_reg_domain_no(g_vars)

def rotate_display():
if g_vars['display_orientation'] == DISPLAY_ORIENTATION_NORMAL:
g_vars['display_orientation'] = DISPLAY_ORIENTATION_FLIPPED
Expand Down Expand Up @@ -848,6 +852,8 @@ def create_shortcut(menu, path, location=[]):
{"name": "Confirm & Reboot", "action": set_reg_domain_nl},]},
{"name": "Set Domain DE", "action": [
{"name": "Confirm & Reboot", "action": set_reg_domain_de},]},
{"name": "Set Domain NO", "action": [
{"name": "Confirm & Reboot", "action": set_reg_domain_no},]},
]},
{"name": "Rotate Display", "action": rotate_display}
]},
Expand Down
20 changes: 20 additions & 0 deletions fpms/modules/reg_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,23 @@ def set_reg_domain_de(self, g_vars):
time.sleep(1)
os.system('reboot')
return

def set_reg_domain_no(self, g_vars):
self.alert_obj.display_popup_alert(g_vars, 'Setting domain', delay=2)

try:
alert_msg = subprocess.check_output(f"{REG_DOMAIN_FILE} set NO --no-prompt", shell=True).decode()
time.sleep(1)
except subprocess.CalledProcessError as exc:
print(exc)
self.alert_obj.display_alert_error(g_vars, 'Failed to set domain')
g_vars['display_state'] = 'menu'
return

self.alert_obj.display_popup_alert(g_vars, 'Successfully set', delay=1)
g_vars['display_state'] = 'menu'
g_vars['shutdown_in_progress'] = True
oled.drawImage(g_vars['reboot_image'])
time.sleep(1)
os.system('reboot')
return

0 comments on commit 1fa36ef

Please sign in to comment.