  ###
 createDevice = (name) ->
 
+  _name = name
   _state = tangojs.tango.DevState.OFF
 
   get_status: -> 'ON'

    goto_fault: createCommand((-> _state = tangojs.tango.DevState.FAULT),
                              'goto_fault',
                              tangojs.tango.DispLevel.OPERATOR)
    goto_alarm: createCommand((-> _state = tangojs.tango.DevState.OFF),
                              'goto_off',
                              tangojs.tango.DispLevel.OPERATOR)


  get_info: -> new tangojs.struct.DeviceInfo
    exported: true
    ior: 'IOR:123456789'
    name: _name

  properties:
    scalar: new tangojs.struct.DbDatum('scalar', 1)
