Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[reg domain and time zone] reboot behavior #80

Open
joshschmelzle opened this issue Oct 3, 2022 · 0 comments
Open

[reg domain and time zone] reboot behavior #80

joshschmelzle opened this issue Oct 3, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@joshschmelzle
Copy link
Member

joshschmelzle commented Oct 3, 2022

In order for user to set both reg domain and time zone from FPMS, the current behavior forces two reboots.

We should consider not rebooting after setting reg domain or timezone from FPMS and instead inform the user that a reboot is required for the setting to apply.

This would enable the user to set both the reg domain and time zone from FPMS and subsequently reboot once when they desire on their own time.

Relevant code:

def set_reg_domain_us(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 US", 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

def set_time_zone_from_gvars(self, g_vars):
timezone_selected = g_vars['timezone_selected']
self.alert_obj.display_popup_alert(g_vars, 'Setting TZ: {0}'.format(timezone_selected), delay=2)
try:
alert_msg = subprocess.check_output(f"{TIME_ZONE_FILE} set {timezone_selected}", shell=True).decode()
time.sleep(1)
except subprocess.CalledProcessError as exc:
print(exc)
self.alert_obj.display_alert_error(g_vars, 'Failed to set time zone')
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

@joshschmelzle joshschmelzle added enhancement New feature or request help wanted Extra attention is needed labels Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant