 
 `import * as tangojs from 'tangojs'`
+
+###*
+ * @private
+ ###
+createDeviceAttributeStruct = (name, data_format, value) ->
+  new tangojs.struct.DeviceAttribute
+    data_format: data_format
+    data_type: undefined
+    err_list: []
+    name: name
+    quality: tangojs.tango.AttrQuality.ATTR_VALID
+    r_dim: null
+    time: new tangojs.tango.TimeVal
+      tv_sec: parseInt(new Date().getTime()/1000)
+      tv_usec: 0
+      tv_nsec: 0
+    value: value
+    w_dim: null
 
 ###*
  * @private

                              max_warning: '50'
                              max_alarm: '70'
                            }))
    string: createAttribute(undefined
                            'string'
                            undefined,
                            tangojs.tango.AttrDataFormat.SCALAR,

                            undefined,
                            undefined,
                            null)
    sine_trend: (->
      name = 'sine_trend'
      format = 'scientific,setprecision(3)'
      attr = createAttribute(0,
                             name,
                             'u',
                             tangojs.tango.AttrDataFormat.SCALAR,
                             format,
                             tangojs.tango.DispLevel.OPERATOR,
                             tangojs.tango.AttrWriteType.READ,
                             undefined,
                             undefined,
                             null)
      attr.get_value = ->
        value = Math.sin((new Date()).getTime()/1000.0)
        createDeviceAttributeStruct(name, format, value)
      attr
    )()
    boolean: createAttribute(false,
                             'boolean'
                             undefined,
                             tangojs.tango.AttrDataFormat.SCALAR,
                             undefined,
                             tangojs.tango.DispLevel.OPERATOR,
                             tangojs.tango.AttrWriteType.READ_WRITE,
                             undefined,
                             undefined,
                             null)
    spectrum: createAttribute(([1..10].map (_i) -> Math.random()),
                              'spectrum'
                              undefined,
                              tangojs.tango.AttrDataFormat.SPECTRUM,
                              undefined,
                              tangojs.tango.DispLevel.OPERATOR,
                              tangojs.tango.AttrWriteType.READ,
                              undefined,
                              undefined,
                              null)

  commands:
    double_arg: createCommand(((x) -> 2*x),
                              'double',
                              tangojs.tango.DispLevel.OPERATOR)
    to_upper: createCommand(((x) -> x.toUpperCase()),
                            'to_upper',
                            tangojs.tango.DispLevel.OPERATOR)
    goto_on: createCommand((-> _state = tangojs.tango.DevState.ON),
                           'goto_on',
                           tangojs.tango.DispLevel.OPERATOR)
    goto_off: createCommand((-> _state = tangojs.tango.DevState.OFF),
                            'goto_off',
                            tangojs.tango.DispLevel.OPERATOR)
    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)

###*
 * @private
