Skip to main content

system.kanoa.asset.updateMode

Requires kanoaOPS license

Description

Updates the mode and also updates the enabled bit for any asset mode links in case the enabled mode has changed.

Syntax

updateMode(modeInfo, userId)

Parameters:
  • modeInfo (dict): A dictionary containing mode information
  • userId (int): ID of the user performing the update.

  • Returns:
  • modeId (int): ID of the updated mode.
  • Dictionary

    ParameterTypeRequiredNotes
    modeNamestrName of the mode.
    modeTypeIdintID of the mode type.
    enabledboolEnabled status of the mode.
    canSelectboolWhether mode can be selected.
    canScheduleboolWhether mode can be scheduled.
    modeColorstrColor code for the mode.
    iconPathstrPath to the mode's icon.
    modeIdintID of the mode to be updated.

    Code Examples

    # Example Usage:
    mode_info = {
    'modeName': 'Updated Mode',
    'modeTypeId': 2,
    'enabled': True,
    'canSelect': True,
    'canSchedule': False,
    'modeColor': '#FF0000',
    'iconPath': '/path/to/icon.png',
    'modeId': 10
    }
    user_id = 123
    updated_mode_id = system.kanoa.asset.updateMode(mode_info, user_id)