Merge "Add check when persisting AdiDeviceStates" into main