my_account = Account(account_token)
# get the device token from the scope
new_device = {
'name': command_vars['serial_number'],
'active': True,
'visible': True,
'connector': '605c9654da971900114d4550',
'network': '602275f9fc48a40018510a8a',
'tags': [
{'key': 'owner', 'value': command_vars['user_id']}
],
'type':'immutable',
'chunk_period': 'month',
'chunk_retention': 2,
'eui': command_vars['eui']
}
result = my_account.devices.create(new_device)
context.log(result)