diff --git a/debian/changelog b/debian/changelog index 28b9aab..6eb54ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +wlanpi-fpms (1.4.7) unstable; urgency=medium + + * Add NO as regdom choice + + -- Josh Schmelzle Mon, 16 Dec 2024 11:32:51 -0500 + wlanpi-fpms (1.4.6) unstable; urgency=medium * Fix crash when running on WLAN Pi Pro diff --git a/fpms/__version__.py b/fpms/__version__.py index 0b8ddba..f3ac350 100644 --- a/fpms/__version__.py +++ b/fpms/__version__.py @@ -14,5 +14,5 @@ __url__ = "https://github.com/wlan-pi/wlanpi-fpms" __author__ = "Jiri Brejcha" __author_email__ = "jirka@jiribrejcha.net" -__version__ = "1.4.6" +__version__ = "1.4.7" __license__ = "BSD-3-Clause" diff --git a/fpms/fpms.py b/fpms/fpms.py index b81fa68..80607e3 100755 --- a/fpms/fpms.py +++ b/fpms/fpms.py @@ -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 @@ -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} ]}, diff --git a/fpms/modules/reg_domain.py b/fpms/modules/reg_domain.py index b5c1098..9ba223e 100644 --- a/fpms/modules/reg_domain.py +++ b/fpms/modules/reg_domain.py @@ -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