class documentation

class Settings:

Constructor: Settings(storage)

View In Hierarchy

Settings management for Picoware.

Method __init__ Initialize settings, loading from storage if present.
Method anthropic_api_key.setter Set the Anthropic API key.
Method dark_mode.setter Set dark mode.
Method debug.setter Set debug mode.
Method deepseek_api_key.setter Set the DeepSeek API key.
Method exit_button.setter Set the exit button setting.
Method gemini_api_key.setter Set the Gemini API key.
Method gmt_offset.setter Set GMT offset.
Method local_url.setter Set the local URL.
Method lvgl_mode.setter Set LVGL mode.
Method onscreen_keyboard.setter Set onscreen keyboard.
Method openai_api_key.setter Set the OpenAI API key.
Method screen_brightness.setter Set the screen brightness.
Method server_settings.setter Set the server settings.
Method theme_color.setter Set the theme color.
Method usb_stream.setter Set USB streaming.
Method wifi_settings.setter Set the WiFi settings.
Method xai_api_key.setter Set the xAI API key.
Class Variable __slots__ Undocumented
Property anthropic_api_key Return the current Anthropic API key.
Property dark_mode Return True if dark mode is enabled, False otherwise.
Property debug Return True if debug mode is enabled, False otherwise.
Property deepseek_api_key Return the current DeepSeek API key.
Property exit_button Return the current exit button setting.
Property gemini_api_key Return the current Gemini API key.
Property gmt_offset Return the current GMT offset.
Property local_url Return the current local URL.
Property lvgl_mode Return True if LVGL mode is enabled, False otherwise.
Property onscreen_keyboard Return True if onscreen keyboard is enabled, False otherwise.
Property openai_api_key Return the current OpenAI API key.
Property screen_brightness Return the current screen brightness.
Property server_settings Return the current server settings.
Property settings Return all settings as a dictionary.
Property theme_color Return the current theme color.
Property usb_stream Return True if USB streaming is enabled, False otherwise.
Property wifi_settings Return the current WiFi settings.
Property xai_api_key Return the xAI API key.
Method __fetch_setting Fetch a setting value from storage.
Method __save_settings Save settings to storage.
Instance Variable _path Undocumented
Instance Variable _settings Undocumented
Instance Variable _storage Undocumented
def __init__(self, storage):

Initialize settings, loading from storage if present.

Parameters
storage:StorageThe storage instance for reading and writing settings.
def anthropic_api_key(self, value: str):

Set the Anthropic API key.

Parameters
value:strThe API key to set.
def dark_mode(self, value: bool):

Set dark mode.

Parameters
value:boolTrue to enable dark mode.
def debug(self, value: bool):

Set debug mode.

Parameters
value:boolTrue to enable debug mode.
def deepseek_api_key(self, value: str):

Set the DeepSeek API key.

Parameters
value:strThe API key to set.
def exit_button(self, value: int):

Set the exit button setting.

Parameters
value:intThe button code to use as the exit button.
def gemini_api_key(self, value: str):

Set the Gemini API key.

Parameters
value:strThe API key to set.
def gmt_offset(self, value: int):

Set GMT offset.

Parameters
value:intThe GMT offset in hours.
def local_url(self, value: str):

Set the local URL.

Parameters
value:strThe local URL to set.
def lvgl_mode(self, value: bool):

Set LVGL mode.

Parameters
value:boolTrue to enable LVGL mode.
def onscreen_keyboard(self, value: bool):

Set onscreen keyboard.

Parameters
value:boolTrue to enable the onscreen keyboard.
def openai_api_key(self, value: str):

Set the OpenAI API key.

Parameters
value:strThe API key to set.
def screen_brightness(self, value: int):

Set the screen brightness.

Parameters
value:intThe brightness level (0-100).
def server_settings(self, value: dict):

Set the server settings.

Parameters
value:dictDict with username and password keys.
def theme_color(self, value: int):

Set the theme color.

Parameters
value:intThe theme color value.
def usb_stream(self, value: bool):

Set USB streaming.

Parameters
value:boolTrue to enable USB streaming.
def wifi_settings(self, value: dict):

Set the WiFi settings.

Parameters
value:dictDict with ssid and password keys.
def xai_api_key(self, value: str):

Set the xAI API key.

Parameters
value:strThe API key to set.
__slots__: list[str] =

Undocumented

@property
anthropic_api_key: str =

Return the current Anthropic API key.

@property
dark_mode: bool =

Return True if dark mode is enabled, False otherwise.

@property
debug: bool =

Return True if debug mode is enabled, False otherwise.

@property
deepseek_api_key: str =

Return the current DeepSeek API key.

@property
exit_button: int =

Return the current exit button setting.

@property
gemini_api_key: str =

Return the current Gemini API key.

@property
gmt_offset: int =

Return the current GMT offset.

@property
local_url: str =

Return the current local URL.

@property
lvgl_mode: bool =

Return True if LVGL mode is enabled, False otherwise.

@property
onscreen_keyboard: bool =

Return True if onscreen keyboard is enabled, False otherwise.

@property
openai_api_key: str =

Return the current OpenAI API key.

@property
screen_brightness: int =

Return the current screen brightness.

@property
server_settings: dict =

Return the current server settings.

@property
settings: dict =

Return all settings as a dictionary.

@property
theme_color: int =

Return the current theme color.

@property
usb_stream: bool =

Return True if USB streaming is enabled, False otherwise.

@property
wifi_settings: dict =

Return the current WiFi settings.

@property
xai_api_key: str =

Return the xAI API key.

def __fetch_setting(self, path: str, key: str, default=''):

Fetch a setting value from storage.

Parameters
path:strThe storage path of the settings file.
key:strThe setting key to look up.
default:objectValue returned when the setting is missing. Defaults to "".
Returns
objectThe fetched setting value or the default.
def __save_settings(self) -> bool:

Save settings to storage.

Returns
boolTrue if the settings were saved successfully.
_path: str =

Undocumented

_settings =

Undocumented

_storage =

Undocumented