     device
 
 
-Device = new EventEmitter()
+device = new EventEmitter()
 
-Device.announce = (callback = ->) ->
+device.announce = (callback = ->) ->
     ssdp.start.call @
     do callback
     @
 
-MediaServer = Object.create Device,
+mediaserver = Object.create device,
+    type: { value: 'MediaServer' }
     version: { value: 1 }
     schemaPrefix: { value: 'urn:schemas-upnp-org' }
     schemaVersion: { value: '1.0' }

xml        = require './xml'

exports.createDevice = (type, name, address) ->
    unless type of devices
        device = new EventEmitter()
        device.emit 'error', new Error "UPnP device of type #{type} is not yet implemented."
        return device

    device = Object.create devices[type],
        type: { value: type, enumerable: true }

    device.name = name or type
    device.address = address if address?



# Need an object to reference a device by its type.
devices = mediaserver: mediaserver

# Asynchronous operations to get some device properties.
init = (device, callback) ->
