|  Developer
Updated on November 22, 2021

add_device()

  • Register a device for a specific gateway.
Edit
  • params: device (table). Note, don’t pass id into table, it’s auto-generated.
  • return: device id (string) or nil if failed to add a device.
Edit
				
					require "core"

local gateway = core.get_gateway()
local device = core.add_device( { gateway_id = gateway.id, ... } )