upnp/upnp-device.js
function (controlPoint, uuid, location, desc, localAddress) {
    EventEmitter.call(this);

    if (TRACE) {
        logger.info({
            method: "UpnpDevice",
            uuid: uuid,
        }, "new device object");
    }
    this.controlPoint = controlPoint;

    this.uuid = uuid;
    this.udn = desc.UDN[0];

    this.forgotten = false
    this.last_seen = (new Date()).getTime();

    this.location = location;

    this.deviceType = desc.deviceType ? desc.deviceType[0] : null;
    this.friendlyName = desc.friendlyName ? desc.friendlyName[0] : null;
    this.manufacturer = desc.manufacturer ? desc.manufacturer[0] : null;
    this.manufacturerUrl = desc.manufacturerURL ? desc.manufacturerURL[0] : null;
    this.modelNumber = desc.modelNumber ? desc.modelNumber[0] : null;
    this.modelDescription = desc.modelDescription ? desc.modelDescription[0] : null;
    this.modelName = desc.modelName ? desc.modelName[0] : null;
    this.modelUrl = desc.modelURL ? desc.modelURL[0] : null;
    this.softwareVersion = desc.softwareVersion ? desc.softwareVersion[0] : null;
    this.hardwareVersion = desc.hardwareVersion ? desc.hardwareVersion[0] : null;
    this.serialNum = desc.serialNum ? desc.serialNum[0] : null;

    var u = url.parse(this.location);
    this.host = u.hostname;
    this.port = u.port;

    this.localAddress = localAddress;

    this.devices = {}; // sub-devices

    this.services = {};

    this._handleDeviceInfo(desc);

    if (seend[this.uuid] === undefined) {
        seend[this.uuid] = true;
        logger.info({
            method: "UpnpDevice",
            device: {
                loction: this.location,
                uuid: this.uuid,
                deviceType: this.deviceType,
                friendlyName: this.friendlyName,
                manufacturer: this.manufacturer,
                manufacturerUrl: this.manufacturerURL,
                modelNumber: this.modelNumber,
                modelDescription: this.modelDescription,
                modelName: this.modelName,
                modelUrl: this.modelURL,
            }
        }, "previously unseen UPnP device");
    }
    // var self = this;
    // this._getDeviceDetails(function(desc) {
    // self._handleDeviceInfo(desc);
    // });

}
function (controlPoint, uuid, location, desc, localAddress) {
    EventEmitter.call(this);

    if (TRACE) {
        logger.info({
            method: "UpnpDevice",
            uuid: uuid,
        }, "new device object");
    }
    this.controlPoint = controlPoint;

    this.uuid = uuid;
    this.udn = desc.UDN[0];

    this.forgotten = false
    this.last_seen = (new Date()).getTime();

    this.location = location;

    this.deviceType = desc.deviceType ? desc.deviceType[0] : null;
    this.friendlyName = desc.friendlyName ? desc.friendlyName[0] : null;
    this.manufacturer = desc.manufacturer ? desc.manufacturer[0] : null;
    this.manufacturerUrl = desc.manufacturerURL ? desc.manufacturerURL[0] : null;
    this.modelNumber = desc.modelNumber ? desc.modelNumber[0] : null;
    this.modelDescription = desc.modelDescription ? desc.modelDescription[0] : null;
    this.modelName = desc.modelName ? desc.modelName[0] : null;
    this.modelUrl = desc.modelURL ? desc.modelURL[0] : null;
    this.softwareVersion = desc.softwareVersion ? desc.softwareVersion[0] : null;
    this.hardwareVersion = desc.hardwareVersion ? desc.hardwareVersion[0] : null;
    this.serialNum = desc.serialNum ? desc.serialNum[0] : null;

    var u = url.parse(this.location);
    this.host = u.hostname;
    this.port = u.port;

    this.localAddress = localAddress;

    this.devices = {}; // sub-devices

    this.services = {};

    this._handleDeviceInfo(desc);

    if (seend[this.uuid] === undefined) {
        seend[this.uuid] = true;
        logger.info({
            method: "UpnpDevice",
            device: {
                loction: this.location,
                uuid: this.uuid,
                deviceType: this.deviceType,
                friendlyName: this.friendlyName,
                manufacturer: this.manufacturer,
                manufacturerUrl: this.manufacturerURL,
                modelNumber: this.modelNumber,
                modelDescription: this.modelDescription,
                modelName: this.modelName,
                modelUrl: this.modelURL,
            }
        }, "previously unseen UPnP device");
    }
    // var self = this;
    // this._getDeviceDetails(function(desc) {
    // self._handleDeviceInfo(desc);
    // });

}
function ( controlPoint , uuid , location , desc , localAddress ) { EventEmitter . call ( this ) ; if ( TRACE ) { logger . info ( { method : "UpnpDevice" , uuid : uuid , } , "new device object" ) ; } this . controlPoint = controlPoint ; this . uuid = uuid ; this . udn = desc . UDN [ 0 ] ; this . forgotten = false this . last_seen = ( new Date ( ) ) . getTime ( ) ; this . location = location ; this . deviceType = desc . deviceType ? desc . deviceType [ 0 ] : null ; this . friendlyName = desc . friendlyName ? desc . friendlyName [ 0 ] : null ; this . manufacturer = desc . manufacturer ? desc . manufacturer [ 0 ] : null ; this . manufacturerUrl = desc . manufacturerURL ? desc . manufacturerURL [ 0 ] : null ; this . modelNumber = desc . modelNumber ? desc . modelNumber [ 0 ] : null ; this . modelDescription = desc . modelDescription ? desc . modelDescription [ 0 ] : null ; this . modelName = desc . modelName ? desc . modelName [ 0 ] : null ; this . modelUrl = desc . modelURL ? desc . modelURL [ 0 ] : null ; this . softwareVersion = desc . softwareVersion ? desc . softwareVersion [ 0 ] : null ; this . hardwareVersion = desc . hardwareVersion ? desc . hardwareVersion [ 0 ] : null ; this . serialNum = desc . serialNum ? desc . serialNum [ 0 ] : null ; var u = url . parse ( this . location ) ; this . host = u . hostname ; this . port = u . port ; this . localAddress = localAddress ; this . devices = { } ; // sub-devices this . services = { } ; this . _handleDeviceInfo ( desc ) ; if ( seend [ this . uuid ] === undefined ) { seend [ this . uuid ] = true ; logger . info ( { method : "UpnpDevice" , device : { loction : this . location , uuid : this . uuid , deviceType : this . deviceType , friendlyName : this . friendlyName , manufacturer : this . manufacturer , manufacturerUrl : this . manufacturerURL , modelNumber : this . modelNumber , modelDescription : this . modelDescription , modelName : this . modelName , modelUrl : this . modelURL , } } , "previously unseen UPnP device" ) ; } // var self = this; // this._getDeviceDetails(function(desc) { // self._handleDeviceInfo(desc); // }); }
A UPnP WeMo Controllee.  Includes socket switch.
A UPnP WeMo Controllee . Includes socket switch .