Skip to main content

system.kanoa.event.getAdjacentStateEvent(assetId, tStamp, ascending)

Gets the previous or next stateEvent entry for the assetId based on the tStamp passed and the direction to look i.e. ascending or 'descending


Parameters

assetId Integer: Id of asset
tStamp DateTime: Time stmap to search from
ascending Boolean: True for ascending, false for descending


Returns

stateEventData pyDataset


Example

assetId = 123
tStamp = system.date.now()
modeEventId, msg = system.kanoa.event.getAdjacentStateEvent(assetId, tStamp, True)