Skip to main content

system.kanoa.asset.updateAsset(assetInfo, userId)

Updates an asset. . All assetInfo keys are required


Parameters

assetInfo Dictionary

- aFloatThreshold settings to display 'Good' indicator
- assetGroupIdIntegerId of asset group. Can be none
- assetIdIntegerId of asset to update
- assetNameStringName of asset
- assetTypeIdIntegerIf of asset type
- enabledBoolean
- oeeFloatThreshold settings to display 'Good, Warning and Bad' indicators
- oeeTypeStringSet to 'OEE_Enabled' if stae and count data will be collected for this asset.
- pFloatThreshold settings to display 'Good,' indicator
- parentIdIntegerId of parent asset. Can be none
- qFloatThreshold settings to display 'Good' indicator
- sortOrderInteger
- targetThresholdFloatSets the threshold to determine 'Warning and Bad' indicator
- timeZoneStringi.e 'Pacific Standard Time'. Only needed at the site level

userId Integer: Id of user executing the function


Returns

# of records modified Integer
message String None if success


Example

userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
assetTypeId = system.kanoa.utilities.getFieldValue('assetTypeId', system.kanoa.asset.getAssetTypes({'assetTypeName': 'enterprise'}))
assetInfo = {
'assetName': 'New Enterprise',
'parentId': None,
'assetTypeId': 1,
'assetGroupId': None,
'oeeType': None,
'oee': None,
'a': None,
'p': None,
'q': None,
'targetThreshold': None,
'sortOrder': 1,
'enabled': True,
'timeZone': None
}
retVal, msg = system.kanoa.asset.updateAsset(assetInfo, userId)
print retVal, msg
>>> 1, None