module documentation

Settings - Configure device settings.

Function run Run the app and handle setting input.
Function start Start the app and build the settings menu.
Function stop Stop the app and clean up.
Constant STATE_ANTHROPIC_API_KEY Undocumented
Constant STATE_DARK_MODE Undocumented
Constant STATE_DEBUG Undocumented
Constant STATE_DEEPSEEK_API_KEY Undocumented
Constant STATE_EXIT_BUTTON Undocumented
Constant STATE_GEMINI_API_KEY Undocumented
Constant STATE_LOCAL_URL Undocumented
Constant STATE_LVGL_MODE Undocumented
Constant STATE_ONSCREEN_KEYBOARD Undocumented
Constant STATE_OPENAI_API_KEY Undocumented
Constant STATE_SCREEN_BRIGHTNESS Undocumented
Constant STATE_SERVER_SETTINGS Undocumented
Constant STATE_THEME_COLOR Undocumented
Constant STATE_TIME Undocumented
Constant STATE_USB_STREAM Undocumented
Constant STATE_XAI_API_KEY Undocumented
Function __anthropic_save_callback Callback triggered when the Anthropic API key keyboard is saved.
Function __apply_toggle_setting Apply a toggle setting change to the view manager.
Function __back_to_menu Clean up any sub-view and return to the main menu.
Function __back_to_server_menu Return to the Server Settings sub-menu.
Function __back_to_time_menu Return to the Time sub-menu from a date picker or keyboard.
Function __color_values Get the list of color values corresponding to the color names.
Function __config Get the configuration tuple for the current setting.
Function __deepseek_save_callback Callback triggered when the DeepSeek API key keyboard is saved.
Function __exit_button_mapping Get the mapping of button values to their names for the exit button setting.
Function __gemini_save_callback Callback triggered when the Gemini API key keyboard is saved.
Function __gmt_save_callback Callback triggered when the GMT offset keyboard is saved.
Function __local_url_save_callback Callback triggered when the Local URL keyboard is saved.
Function __open_anthropic_keyboard Open the keyboard for entering the Anthropic API key.
Function __open_choice Open a Choice sub-view for the theme color setting.
Function __open_choice_brightness Open a Choice sub-view for the screen brightness setting.
Function __open_choice_button Open a Choice sub-view for the button to exit setting.
Function __open_date_picker Open the DatePicker pre-loaded with the current RTC time.
Function __open_deepseek_keyboard Open the keyboard for entering the DeepSeek API key.
Function __open_gemini_keyboard Open the keyboard for entering the Gemini API key.
Function __open_gmt_keyboard Open the keyboard for entering the GMT offset.
Function __open_local_url_keyboard Open the keyboard for entering the Local URL.
Function __open_openai_keyboard Open the keyboard for entering the OpenAI API key.
Function __open_server_keyboard Open the keyboard for entering the server username or password.
Function __open_server_menu Open the Server Settings sub-menu (Username / Password).
Function __open_time_menu Open the Time sub-menu (Date & Time / GMT Offset).
Function __open_toggle Open a Toggle sub-view for the given setting index.
Function __open_xai_keyboard Open the keyboard for entering the xAI API key.
Function __openai_save_callback Callback triggered when the OpenAI API key keyboard is saved.
Function __save_server_password Save the server password to storage.
Function __save_server_username Save the server username to storage.
Function __server_save_callback Callback triggered when the server keyboard is saved.
Function __xai_save_callback Callback triggered when the xAI API key keyboard is saved.
Constant _MODE_ANTHROPIC_KEYBOARD Undocumented
Constant _MODE_CHOICE Undocumented
Constant _MODE_DATE_PICKER Undocumented
Constant _MODE_DEEPSEEK_KEYBOARD Undocumented
Constant _MODE_GEMINI_KEYBOARD Undocumented
Constant _MODE_GMT_KEYBOARD Undocumented
Constant _MODE_LOCAL_URL_KEYBOARD Undocumented
Constant _MODE_MENU Undocumented
Constant _MODE_OPENAI_KEYBOARD Undocumented
Constant _MODE_SERVER_KEYBOARD Undocumented
Constant _MODE_SERVER_MENU Undocumented
Constant _MODE_TIME_MENU Undocumented
Constant _MODE_TOGGLE Undocumented
Constant _MODE_XAI_KEYBOARD Undocumented
Variable _anthropic_save_requested Undocumented
Variable _choice Undocumented
Variable _current_setting Undocumented
Variable _date_picker Undocumented
Variable _deepseek_save_requested Undocumented
Variable _gemini_save_requested Undocumented
Variable _gmt_save_requested Undocumented
Variable _local_url_save_requested Undocumented
Variable _menu Undocumented
Variable _openai_save_requested Undocumented
Variable _server_keyboard_field Undocumented
Variable _server_menu Undocumented
Variable _server_save_requested Undocumented
Variable _settings Undocumented
Variable _time_menu Undocumented
Variable _toggle Undocumented
Variable _view_manager Undocumented
Variable _xai_save_requested Undocumented
def run(view_manager):

Run the app and handle setting input.

Parameters
view_manager:ViewManagerThe view manager instance for display and storage access.
def start(view_manager) -> bool:

Start the app and build the settings menu.

Parameters
view_manager:ViewManagerThe view manager instance for display and storage access.
Returns
boolTrue if the app started, False if no SD card is present.
def stop(view_manager):

Stop the app and clean up.

Parameters
view_manager:ViewManagerThe view manager instance for display and storage access.
STATE_ANTHROPIC_API_KEY =

Undocumented

Value
const(11)
STATE_DARK_MODE =

Undocumented

Value
const(0)
STATE_DEBUG =

Undocumented

Value
const(4)
STATE_DEEPSEEK_API_KEY =

Undocumented

Value
const(9)
STATE_EXIT_BUTTON =

Undocumented

Value
const(6)
STATE_GEMINI_API_KEY =

Undocumented

Value
const(12)
STATE_LOCAL_URL =

Undocumented

Value
const(13)
STATE_LVGL_MODE =

Undocumented

Value
const(2)
STATE_ONSCREEN_KEYBOARD =

Undocumented

Value
const(1)
STATE_OPENAI_API_KEY =

Undocumented

Value
const(8)
STATE_SCREEN_BRIGHTNESS =

Undocumented

Value
const(15)
STATE_SERVER_SETTINGS =

Undocumented

Value
const(7)
STATE_THEME_COLOR =

Undocumented

Value
const(3)
STATE_TIME =

Undocumented

Value
const(5)
STATE_USB_STREAM =

Undocumented

Value
const(10)
STATE_XAI_API_KEY =

Undocumented

Value
const(14)
def __anthropic_save_callback(result: str):

Callback triggered when the Anthropic API key keyboard is saved.

Parameters
result:strThe saved keyboard value.
def __apply_toggle_setting(index: int, state: bool):

Apply a toggle setting change to the view manager.

Parameters
index:intThe setting index to apply.
state:boolThe new toggle state.
def __back_to_menu():

Clean up any sub-view and return to the main menu.

def __back_to_server_menu():

Return to the Server Settings sub-menu.

def __back_to_time_menu():

Return to the Time sub-menu from a date picker or keyboard.

def __color_values() -> list[int]:

Get the list of color values corresponding to the color names.

Returns
list[int]The color values matching the theme color names.
def __config() -> tuple:

Get the configuration tuple for the current setting.

Returns
tupleThe (menu label, json key, default value) tuples.
def __deepseek_save_callback(result: str):

Callback triggered when the DeepSeek API key keyboard is saved.

Parameters
result:strThe saved keyboard value.
def __exit_button_mapping() -> dict[int, str]:

Get the mapping of button values to their names for the exit button setting.

Returns
dict[int, str]The button value to name mapping.
def __gemini_save_callback(result: str):

Callback triggered when the Gemini API key keyboard is saved.

Parameters
result:strThe saved keyboard value.
def __gmt_save_callback(result: str):

Callback triggered when the GMT offset keyboard is saved.

Parameters
result:strThe saved keyboard value.
def __local_url_save_callback(result: str):

Callback triggered when the Local URL keyboard is saved.

Parameters
result:strThe saved keyboard value.
def __open_anthropic_keyboard():

Open the keyboard for entering the Anthropic API key.

def __open_choice():

Open a Choice sub-view for the theme color setting.

def __open_choice_brightness():

Open a Choice sub-view for the screen brightness setting.

def __open_choice_button():

Open a Choice sub-view for the button to exit setting.

def __open_date_picker():

Open the DatePicker pre-loaded with the current RTC time.

def __open_deepseek_keyboard():

Open the keyboard for entering the DeepSeek API key.

def __open_gemini_keyboard():

Open the keyboard for entering the Gemini API key.

def __open_gmt_keyboard():

Open the keyboard for entering the GMT offset.

def __open_local_url_keyboard():

Open the keyboard for entering the Local URL.

def __open_openai_keyboard():

Open the keyboard for entering the OpenAI API key.

def __open_server_keyboard(field: int):

Open the keyboard for entering the server username or password.

Parameters
field:int0 for username, 1 for password.
def __open_server_menu():

Open the Server Settings sub-menu (Username / Password).

def __open_time_menu():

Open the Time sub-menu (Date & Time / GMT Offset).

def __open_toggle(setting_index: int):

Open a Toggle sub-view for the given setting index.

Parameters
setting_index:intThe setting index to toggle.
def __open_xai_keyboard():

Open the keyboard for entering the xAI API key.

def __openai_save_callback(result: str):

Callback triggered when the OpenAI API key keyboard is saved.

Parameters
result:strThe saved keyboard value.
def __save_server_password(value: str) -> bool:

Save the server password to storage.

Parameters
value:strThe password to save.
Returns
boolTrue on success.
def __save_server_username(value: str) -> bool:

Save the server username to storage.

Parameters
value:strThe username to save.
Returns
boolTrue on success.
def __server_save_callback(result: str):

Callback triggered when the server keyboard is saved.

Parameters
result:strThe saved keyboard value.
def __xai_save_callback(result: str):

Callback triggered when the xAI API key keyboard is saved.

Parameters
result:strThe saved keyboard value.
_MODE_ANTHROPIC_KEYBOARD =

Undocumented

Value
const(10)
_MODE_CHOICE =

Undocumented

Value
const(2)
_MODE_DATE_PICKER =

Undocumented

Value
const(4)
_MODE_DEEPSEEK_KEYBOARD =

Undocumented

Value
const(9)
_MODE_GEMINI_KEYBOARD =

Undocumented

Value
const(11)
_MODE_GMT_KEYBOARD =

Undocumented

Value
const(5)
_MODE_LOCAL_URL_KEYBOARD =

Undocumented

Value
const(12)
_MODE_MENU =

Undocumented

Value
const(0)
_MODE_OPENAI_KEYBOARD =

Undocumented

Value
const(8)
_MODE_SERVER_KEYBOARD =

Undocumented

Value
const(7)
_MODE_SERVER_MENU =

Undocumented

Value
const(6)
_MODE_TIME_MENU =

Undocumented

Value
const(3)
_MODE_TOGGLE =

Undocumented

Value
const(1)
_MODE_XAI_KEYBOARD =

Undocumented

Value
const(13)
_anthropic_save_requested: bool =

Undocumented

_choice =

Undocumented

_current_setting: int =

Undocumented

_date_picker =

Undocumented

_deepseek_save_requested: bool =

Undocumented

_gemini_save_requested: bool =

Undocumented

_gmt_save_requested: bool =

Undocumented

_local_url_save_requested: bool =

Undocumented

_menu =

Undocumented

_openai_save_requested: bool =

Undocumented

_server_keyboard_field: int =

Undocumented

_server_menu =

Undocumented

_server_save_requested: bool =

Undocumented

_settings =

Undocumented

_time_menu =

Undocumented

_toggle =

Undocumented

_view_manager =

Undocumented

_xai_save_requested: bool =

Undocumented