konashi.Settings package

Submodules

konashi.Settings.Bluetooth module

class konashi.Settings.Bluetooth.BluetoothSettingsConnectionPhy(value)

Bases: IntFlag

An enumeration.

CODED_PHY_125k = 4
CODED_PHY_500k = 8
ONE_M_PHY_UNCODED = 1
TWO_M_PHY_UNCODED = 2
class konashi.Settings.Bluetooth.BluetoothSettingsExAdvertiseContents(value)

Bases: IntFlag

An enumeration.

AIO0_IN = 4096
AIO1_IN = 8192
AIO2_IN = 16384
AIO_IN_ALL = 28672
BLE_ALL = 117440512
DEVICE_NAME = 16777216
GPIO0_IN = 65536
GPIO1_IN = 131072
GPIO2_IN = 262144
GPIO3_IN = 524288
GPIO4_IN = 1048576
GPIO5_IN = 2097152
GPIO6_IN = 4194304
GPIO7_IN = 8388608
GPIO_IN_ALL = 16711680
MANUF_DATA = 67108864
NONE = 0
UUID128 = 33554432
class konashi.Settings.Bluetooth.BluetoothSettingsExAdvertiseStatus(value)

Bases: IntEnum

An enumeration.

DISABLED = 0
ERROR = 15
EXTENDED = 2
LEGACY = 1
class konashi.Settings.Bluetooth.BluetoothSettingsFunction(value)

Bases: IntEnum

An enumeration.

EX_ADVERTISER = 1
MESH = 0
class konashi.Settings.Bluetooth.BluetoothSettingsPrimaryPhy(value)

Bases: IntEnum

An enumeration.

CODED_PHY = 4
ONE_M_PHY = 1
class konashi.Settings.Bluetooth.BluetoothSettingsSecondaryPhy(value)

Bases: IntEnum

An enumeration.

CODED_PHY = 4
ONE_M_PHY = 1
TWO_M_PHY = 2
class konashi.Settings.Bluetooth._Bluetooth(konashi)

Bases: _KonashiElementBase

_ntf_cb_settings(sender, data)
async _on_connect() None
async enable_function(function: BluetoothSettingsFunction, enable: bool) None

Enable or disable a Bluetooth functionality.

Parameters
  • function (BluetoothSettingsFunction) – The function to enable or disable.

  • enable (bool) – True to enable, False to disable.

async get_settings() _BluetoothSettings

Get the current Bluetooth settings.

Returns

The current bluetooth settings.
This class has 7 members:

enabled_functions: A bitmask of enabled Bluetooth functions, see BluetoothSettingsFunction. main_conn_pref_phy: The main connection preferred PHY, see BluetoothSettingsConnectionPhy. main_adv_sec_phy: The main advertising secondary PHY, see BluetoothSettingsSecondaryPhy. ex_adv_sec_phy: The secondary advertiser secondary PHY, see BluetoothSettingsSecondaryPhy. ex_adv_prim_phy: The secondary advertiser primary PHY, see BluetoothSettingsPrimaryPhy. ex_adv_contents: A bitmask of the secondary advertiser contents, see BluetoothSettingsExAdvertiseContents. ex_adv_status: The secondary advertiser status, see BluetoothSettingsExAdvertiseStatus.

Return type

_BluetoothSettings

async set_ex_adv_contents(contents: BluetoothSettingsExAdvertiseContents) None

Set the secondary advertiser advertising contents. If the resulting advertising data length is longer than 31 bytes, advertising will automatically be in extended mode, otherwise it will be legacy mode.

Parameters

contents (BluetoothSettingsExAdvertiseContents) – A mask of the contents to show.

async set_ex_adv_phy(prim_phy: BluetoothSettingsPrimaryPhy, sec_phy: BluetoothSettingsSecondaryPhy) None

Set the secondary advertiser primary and secondary PHYs.

Parameters
async set_main_adv_sec_phy(phy: BluetoothSettingsSecondaryPhy) None

Set the main advertiser Secondary PHY.

Parameters

phy (BluetoothSettingsSecondaryPhy) – The secondary PHY type.

async set_main_preferred_conn_phy(phy: BluetoothSettingsConnectionPhy) None

Set the main preferred connection PHYs. Multiple preferred PHYs can be set in the form of a bitmask.

Parameters

phy (BluetoothSettingsConnectionPhy) – The preferred connection PHYs

class konashi.Settings.Bluetooth._BluetoothSettings

Bases: Structure

_fields_ = [('enabled_functions', <class 'ctypes.c_ubyte'>), ('main_conn_pref_phy', <class 'ctypes.c_ubyte'>, 4), ('main_adv_sec_phy', <class 'ctypes.c_ubyte'>, 4), ('ex_adv_sec_phy', <class 'ctypes.c_ubyte'>, 4), ('ex_adv_prim_phy', <class 'ctypes.c_ubyte'>, 4), ('ex_adv_contents', <class 'ctypes.c_uint'>, 28), ('ex_adv_status', <class 'ctypes.c_uint'>, 4)]
_pack_ = 1
enabled_functions

Structure/Union member

ex_adv_contents

Structure/Union member

ex_adv_prim_phy

Structure/Union member

ex_adv_sec_phy

Structure/Union member

ex_adv_status

Structure/Union member

main_adv_sec_phy

Structure/Union member

main_conn_pref_phy

Structure/Union member

konashi.Settings.System module

class konashi.Settings.System.SystemSettingsNvmSaveTrigger(value)

Bases: IntEnum

An enumeration.

AUTO = 0
MANUAL = 1
class konashi.Settings.System.SystemSettingsNvmUse(value)

Bases: IntEnum

An enumeration.

DISABLED = 0
ENABLED = 1
class konashi.Settings.System._Command(value)

Bases: IntEnum

An enumeration.

FCT_BTN_EMULATE_LONG_PRESS = 6
FCT_BTN_EMULATE_PRESS = 5
FCT_BTN_EMULATE_VERY_LONG_PRESS = 7
NVM_ERASE_NOW = 4
NVM_SAVE_NOW = 3
NVM_SAVE_TRIGGER_SET = 2
NVM_USE_SET = 1
class konashi.Settings.System._System(konashi)

Bases: _KonashiElementBase

_ntf_cb_settings(sender, data)
async _on_connect() None
async emul_long_press() None

Emulate a function button long press.

async emul_press() None

Emulate a function button simple press.

async emul_very_long_press() None

Emulate a function button very long press.

async get_settings() _SystemSettings

Get the current system settings.

Returns

The current system settings.
This class has 2 members:

nvm_use: 1 if the NVM is set to be used, 0 otherwise. nvm_save_trigger: 1 if manual save, 0 if auto save.

Return type

_SystemSettings

async nvm_erase_now() None

Erase all from NVM now.

async nvm_save_now() None

Save all to NVM now.

async set_nvm_save_trigger(trigger: SystemSettingsNvmSaveTrigger) None

Set the NVM save trigger.

Parameters

trigger (SystemSettingsNvmSaveTrigger) – AUTO for automatic save, MANUAL for manual save (nvm_save_now needs to be called to save).

async set_nvm_use(enable: bool) None

Set if NVM is used or not.

Parameters

enable (bool) – True to enable, False to disable.

class konashi.Settings.System._SystemSettings

Bases: Structure

_fields_ = [('nvm_use', <class 'ctypes.c_ubyte'>), ('nvm_save_trigger', <class 'ctypes.c_ubyte'>)]
_pack_ = 1
nvm_save_trigger

Structure/Union member

nvm_use

Structure/Union member

Module contents

class konashi.Settings._Settings(konashi)

Bases: object

async _on_connect()
property bluetooth: _Bluetooth

This Konashi devices Bluetooth Settings interface.

property system: _System

This Konashi devices System Settings interface.