system.kanoa.asset.updateMode
Description
Updates the mode and also updates the enabled bit for any asset mode links in case the enabled mode has changed (kanoaOPS).Syntax
updateMode(modeInfo, userId)- modeInfo (dict) - A dictionary containing mode information with the following keys:
- 'modeName' (str): Name of the mode.
- 'modeTypeId' (int): ID of the mode type.
- 'enabled' (bool): Enabled status of the mode.
- 'canSelect' (bool): Whether mode can be selected.
- 'canSchedule' (bool): Whether mode can be scheduled.
- 'modeColor' (str): Color code for the mode.
- 'iconPath' (str): Path to the mode's icon.
- 'modeId' (int): ID of the mode to be updated.
- userId (int) - ID of the user performing the update.
- modeId (int) - ID of the updated mode.
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)